From fc9cb24a185cacf666a8270649d2fe4801da784b Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Wed, 10 Jan 2007 08:29:41 +0000 Subject: [PATCH] MDL-7861, fixes for workshop --- lib/weblib.php | 21 +++-- mod/workshop/assess.php | 15 +-- mod/workshop/assessment_grading_form.html | 6 +- mod/workshop/assessments.php | 30 +++--- mod/workshop/index.php | 2 +- mod/workshop/lib.php | 2 +- mod/workshop/locallib.php | 110 ++++++++++++---------- mod/workshop/mod.html | 10 +- mod/workshop/submissions.php | 20 ++-- mod/workshop/view.php | 6 +- mod/workshop/viewassessment.php | 9 +- theme/standard/styles_layout.css | 8 ++ 12 files changed, 132 insertions(+), 107 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 5fb433e34b..f349f8a087 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2824,7 +2824,7 @@ function print_headline($text, $size=2, $return=false) { */ function print_heading($text, $align='', $size=2, $class='main', $return=false) { if ($align) { - $align = ' align="'.$align.'"'; + $align = ' style="text-align:'.$align.';"'; } if ($class) { $class = ' class="'.$class.'"'; @@ -2891,10 +2891,14 @@ function print_continue($link, $return=false) { $output = ''; if (!$link) { + $link = $_SERVER['HTTP_REFERER']; } $output .= '
'; + // MDL-7861, referer string might not be xhtml strict + // e.g. & + $output .= print_single_button($link, NULL, get_string('continue'), 'post', $CFG->framename, true); $output .= '
'."\n"; @@ -2982,7 +2986,7 @@ function print_single_button($link, $options, $label='OK', $method='get', $targe $output = ''; $output .= '
'; // taking target out, will need to add later target="'.$target.'" - $output .= '
'; + $output .= ''; $output .= '
'; if ($options) { foreach ($options as $name => $value) { @@ -3385,7 +3389,7 @@ function print_table($table, $return=false) { if (isset($table->align)) { foreach ($table->align as $key => $aa) { if ($aa) { - $align[$key] = ' align="'. $aa .'"'; + $align[$key] = ' text-align:'. $aa.';'; } else { $align[$key] = ''; } @@ -3394,7 +3398,7 @@ function print_table($table, $return=false) { if (isset($table->size)) { foreach ($table->size as $key => $ss) { if ($ss) { - $size[$key] = ' width="'. $ss .'"'; + $size[$key] = ' width:'. $ss .';'; } else { $size[$key] = ''; } @@ -3403,7 +3407,7 @@ function print_table($table, $return=false) { if (isset($table->wrap)) { foreach ($table->wrap as $key => $ww) { if ($ww) { - $wrap[$key] = ' style="white-space:nowrap;" '; + $wrap[$key] = ' white-space:nowrap;'; } else { $wrap[$key] = ''; } @@ -3448,7 +3452,10 @@ function print_table($table, $return=false) { if (!isset($align[$key])) { $align[$key] = ''; } - $output .= ''. $heading .''; + + $output .= ''. $heading .''; + // commenting the following code out as '. $heading .''; } $output .= ''."\n"; } @@ -3471,7 +3478,7 @@ function print_table($table, $return=false) { if (!isset($wrap[$key])) { $wrap[$key] = ''; } - $output .= ''. $item .''; + $output .= ''. $item .''; } } $output .= ''."\n"; diff --git a/mod/workshop/assess.php b/mod/workshop/assess.php index c955b316bd..99d23b7d07 100644 --- a/mod/workshop/assess.php +++ b/mod/workshop/assess.php @@ -28,7 +28,7 @@ if (!$redirect) { //seems not to work properly -// $redirect = urlencode($_SERVER["HTTP_REFERER"].'#sid='.$submission->id); + $redirect = htmlentities($_SERVER["HTTP_REFERER"].'#sid='.$submission->id); } @@ -59,11 +59,12 @@ /// top frame with the navigation bar and the assessment form if ($frameset == "top") { - + // removed + // because it does not validate MDL-7861 print_header_simple(format_string($workshop->name), "", "id\">$strworkshops -> id\">".format_string($workshop->name,true)." -> $strassess", - "", '', true); + "", '', true); // there can be an assessment record (for teacher submissions), if there isn't... if (!$assessment = get_record("workshop_assessments", "submissionid", $submission->id, "userid", @@ -129,8 +130,8 @@ } /// print bottom frame with the submission - - print_header('', '', '', '', ''); + // removed as it does not validate MDL-7861 + print_header('', '', '', '', ''); $title = '"'.$submission->title.'" '; if (workshop_is_teacher($workshop)) { $title .= ' '.get_string('by', 'workshop').' '.workshop_fullname($submission->userid, $course->id); @@ -139,9 +140,9 @@ workshop_print_submission($workshop, $submission); if (workshop_is_teacher($workshop)) { - echo '
'.get_string('assessments', 'workshop').':
'; + echo '
'.get_string('assessments', 'workshop').':
'; echo workshop_print_submission_assessments($workshop, $submission, "all"); - echo '
'; + echo '
'; } diff --git a/mod/workshop/assessment_grading_form.html b/mod/workshop/assessment_grading_form.html index b8d5f7e3d7..b2d17aa9f4 100644 --- a/mod/workshop/assessment_grading_form.html +++ b/mod/workshop/assessment_grading_form.html @@ -4,11 +4,12 @@ } ?> +
-
+
@@ -25,5 +26,6 @@
:
" /> -
+ +
\ No newline at end of file diff --git a/mod/workshop/assessments.php b/mod/workshop/assessments.php index e8f753deac..451b70d4ed 100644 --- a/mod/workshop/assessments.php +++ b/mod/workshop/assessments.php @@ -97,7 +97,7 @@ -
+
\n"; echo "\n"; - echo "
\n"; - echo "
".get_string("assessment", "workshop"). "
\n"; + echo "\n"; + echo "
".get_string("assessment", "workshop"). "
\n"; workshop_print_assessment($workshop, $assessment); } @@ -385,7 +385,7 @@ } //save time of agreement set_field("workshop_assessments", "timeagreed", $timenow, "id", $assessment->id); - echo "".get_string("savedok", "workshop")."
\n"; + echo "
".get_string("savedok", "workshop")."

\n"; add_to_log($course->id, "workshop", "agree", "viewassessment.php?id=$cm->id&aid=$assessment->id", "$assessment->id"); print_continue("view.php?id=$cm->id"); @@ -422,7 +422,7 @@ -
+
\n"; echo "
\n"; echo "\n"; - echo "
\n"; + echo "\n"; workshop_print_assessment($workshop, $assessment); } @@ -457,7 +457,7 @@
-
+
 \n"; echo "\n"; } - echo "

\n"; - echo "
".get_string("gradetable","workshop")."
\n"; - echo "
". + echo "

\n"; + echo "
".get_string("gradetable","workshop")."
\n"; + echo "
\n"; for ($j = $workshop->grade; $j >= 0; $j--) { @@ -555,7 +555,7 @@ choose_from_menu($numbers, "maxscore[$i]", $elements[$i]->maxscore, ""); echo "\n"; } - echo "
". get_string("numberofnegativeresponses", "workshop"); echo "". get_string("suggestedgrade", "workshop")."
\n"; + echo "\n"; break; case 3: // criterion grading @@ -619,7 +619,7 @@
" /> " /> -
+
".get_string("teacherassessments", "workshop", $course->teacher)."\n"; + echo "
".get_string("teacherassessments", "workshop", $course->teacher)."
\n"; workshop_print_assessment($workshop, $teachersassessment); } // now the student's assessment (don't allow changes) $user = get_record("user", "id", $assessment->userid); - echo "
".get_string("assessmentby", "workshop", $user->firstname." ".$user->lastname)."
\n"; + echo "
".get_string("assessmentby", "workshop", $user->firstname." ".$user->lastname)."
\n"; workshop_print_assessment($workshop, $assessment); include('assessment_grading_form.html'); @@ -1304,7 +1304,7 @@ set_field("workshop_comments", "timecreated", $timenow, "id", $comment->id); // ..and kick to comment into life (probably not needed but just in case) set_field("workshop_comments", "mailed", 0, "id", $comment->id); - echo "".get_string("savedok", "workshop")."
\n"; + echo "".get_string("savedok", "workshop")."
\n"; add_to_log($course->id, "workshop", "comment", "viewassessment.php?id=$cm->id&aid=$assessment->id", "$comment->id"); diff --git a/mod/workshop/index.php b/mod/workshop/index.php index 3a04f3e566..5e9aae0988 100644 --- a/mod/workshop/index.php +++ b/mod/workshop/index.php @@ -61,7 +61,7 @@ $submitted = userdate($submission->timecreated); } else { - $submitted = "".userdate($submission->timecreated).""; + $submitted = "".userdate($submission->timecreated).""; } if (!$workshop->visible) { //Show dimmed if the mod is hidden diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index 6fd7629a17..877b41a907 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -1644,7 +1644,7 @@ function workshop_grade_assessments($workshop, $verbose=false) { } } if ($verbose) { - echo "

".get_string("numberofsubmissions", "workshop", count($num))."
\n"; + echo "

".get_string("numberofsubmissions", "workshop", count($num))."
\n"; echo get_string("numberofassessmentsweighted", "workshop", $total)."

\n"; } diff --git a/mod/workshop/locallib.php b/mod/workshop/locallib.php index 822755cfac..39f7ebec11 100644 --- a/mod/workshop/locallib.php +++ b/mod/workshop/locallib.php @@ -871,8 +871,8 @@ function workshop_list_all_submissions($workshop, $user) { print_table($table); } - echo "

".get_string("studentsubmissions", "workshop", $course->student). - "


\n"; + echo "

".get_string("studentsubmissions", "workshop", $course->student). + "


\n"; unset($table); $table->head = array (get_string("title", "workshop"), get_string("action", "workshop"), get_string("comment", "workshop")); @@ -1050,7 +1050,7 @@ function workshop_list_assessed_submissions($workshop, $user) { print_table($table); } else { - echo "
".get_string("noassessmentsdone", "workshop")."
\n"; + echo "
".get_string("noassessmentsdone", "workshop")."
\n"; } } @@ -1124,7 +1124,7 @@ function workshop_list_peer_assessments($workshop, $user) { print_table($table); } else { - echo "
".get_string("noassessmentsdone", "workshop")."
\n"; + echo "
".get_string("noassessmentsdone", "workshop")."
\n"; } } @@ -1170,8 +1170,8 @@ function workshop_list_self_assessments($workshop, $user) { } } if (isset($table->data)) { - echo "

".get_string("pleaseassessyoursubmissions", "workshop", $course->student). - "

\n"; + echo "

".get_string("pleaseassessyoursubmissions", "workshop", $course->student). + "

\n"; print_table($table); } } @@ -1297,12 +1297,12 @@ function workshop_list_student_submissions($workshop, $user) { } if (isset($table->data)) { - echo "

".get_string("pleaseassessthesestudentsubmissions", "workshop", $course->student). - "

\n"; + echo "

".get_string("pleaseassessthesestudentsubmissions", "workshop", $course->student). + "

\n"; print_table($table); } else { - echo "

".get_string("nosubmissionsavailableforassessment", "workshop")."

\n"; + echo "

".get_string("nosubmissionsavailableforassessment", "workshop")."

\n"; } } @@ -1466,7 +1466,7 @@ function workshop_list_submissions_for_admin($workshop, $order) { number_format($stats->min* $workshop->gradinggrade / 100, 1)); print_heading(get_string("gradinggrade", "workshop")." ".get_string("analysis", "workshop")); print_table($table); - echo "

id&action=regradestudentassessments\">". + echo "

id&action=regradestudentassessments\">". get_string("regradestudentassessments", "workshop")." "; helpbutton("regrading", get_string("regradestudentassessments", "workshop"), "workshop"); echo "

\n"; @@ -1508,7 +1508,7 @@ function workshop_list_submissions_for_admin($workshop, $order) { } $datesubmitted = userdate($submission->timecreated); if ($submission->late) { - $datesubmitted = "".$datesubmitted.""; + $datesubmitted = "".$datesubmitted.""; } $action = "id&sid=$submission->id\">". get_string("amendtitle", "workshop").""; @@ -1597,7 +1597,7 @@ function workshop_list_teacher_assessments_by_user($workshop, $user) { print_table($table); } else { - echo "
".get_string("noassessmentsdone", "workshop")."
\n"; + echo "
".get_string("noassessmentsdone", "workshop")."
\n"; } } @@ -1900,7 +1900,7 @@ function workshop_list_user_submissions($workshop, $user) { } $datesubmitted = userdate($submission->timecreated); if ($submission->late) { - $datesubmitted = "".$datesubmitted.""; + $datesubmitted = "".$datesubmitted.""; } $n = count_records_select("workshop_assessments", "submissionid = $submission->id AND timecreated < ($timenow - $CFG->maxeditingtime)"); @@ -1957,8 +1957,10 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges error ("Workshop_print_assessment: Submission record not found"); } + // removed target=\"submission\" as it does not validate + // MDL-7861 print_heading(get_string('assessmentof', 'workshop', - "id&action=showsubmission&sid=$submission->id\" target=\"submission\">". + "id&action=showsubmission&sid=$submission->id\" >". $submission->title.'')); } @@ -1979,7 +1981,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges $showgrades = true; } - echo "
\n"; + echo "
\n"; // see if this is a pre-filled assessment for a re-submission... if ($assessment->resubmission) { @@ -2015,11 +2017,11 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges // show links depending on who doing the viewing $firstcomment = FALSE; if (workshop_is_teacher($workshop, $USER->id) and ($comment->userid != $USER->id)) { - echo "

id&aid=$assessment->id\">". + echo "

id&aid=$assessment->id\">". get_string("reply", "workshop")."

\n"; } elseif (($comment->userid ==$USER->id) and (($timenow - $comment->timecreated) < $CFG->maxeditingtime)) { - echo "

id&cid=$comment->id\">". + echo "

id&cid=$comment->id\">". get_string("edit", "workshop")."\n"; if ($USER->id == $submission->userid) { echo " | id&aid=$assessment->id\">". @@ -2029,7 +2031,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges } elseif (($comment->userid != $USER->id) and (($USER->id == $assessment->userid) or ($USER->id == $submission->userid))) { - echo "

id&aid=$assessment->id\">". + echo "

id&aid=$assessment->id\">". get_string("reply", "workshop")."\n"; if ($USER->id == $submission->userid) { echo " | id&aid=$assessment->id\">". @@ -2042,31 +2044,32 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges } echo ''; } - echo '

'; + echo ''; } // now print the grading form with the grading grade if any // FORM is needed for Mozilla browsers, else radio bttons are not checked ?>
+
-
- +
+
\n"; - echo " \n"; + echo '
'.userdate($assessment->timecreated)."\n"; echo "\n"; // only show the grade if grading strategy > 0 and the grade is positive @@ -2169,8 +2172,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges echo "\n"; echo " \n"; echo " \n"; if ($showgrades) { echo "\n"; @@ -2183,7 +2186,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges switch ($SCALE->type) { case 'radio' : // show selections highest first - echo "
$SCALE->start   "; + echo "
$SCALE->start   "; for ($j = $SCALE->size - 1; $j >= 0 ; $j--) { $checked = false; if (isset($grades[$i]->grade)) { @@ -2203,7 +2206,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges echo "    \n"; } } - echo "   $SCALE->end
\n"; + echo "   $SCALE->end\n"; break; case 'selection' : unset($numbers); @@ -2275,8 +2278,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo " \n"; @@ -2287,7 +2290,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges switch ($SCALE->type) { case 'radio' : // show selections highest first - echo "
$SCALE->start   "; + echo "
$SCALE->start   "; for ($j = $SCALE->size - 1; $j >= 0 ; $j--) { $checked = false; if (isset($grades[$i]->grade)) { @@ -2307,7 +2310,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges echo "    \n"; } } - echo "   $SCALE->end
\n"; + echo "   $SCALE->end\n"; break; case 'selection' : unset($numbers); @@ -2376,10 +2379,10 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges // echo "\n"; // echo "\n"; // echo " \n"; - echo "
"; + echo "
"; if ($assessment and workshop_is_teacher($workshop)) { $user = get_record('user', 'id', $assessment->userid); print_string("assessmentby", "workshop", fullname($user)); } else { print_string('assessment', 'workshop'); } - echo '
'.userdate($assessment->timecreated)."

". get_string("element","workshop")." $iplus1:

".format_text($elements[$i]->description); - echo "

".get_string("weight", "workshop").": ". - number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."

\n"; + echo "

".get_string("weight", "workshop").": ". + number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."

\n"; echo "

". get_string("element","workshop")." $iplus1:

".format_text($elements[$i]->description); - echo "

".get_string("weight", "workshop").": ". - number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."\n"; + echo "

".get_string("weight", "workshop").": ". + number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."\n"; echo "

". get_string("grade"). ":

".get_string("numberofnegativeitems", "workshop")."$negativecount
 
\n"; + echo "
\n"; // now print the grade table - echo "

".get_string("gradetable","workshop")."
\n"; - echo "
". + echo "

".get_string("gradetable","workshop")."
\n"; + echo "
\n"; for ($j = 100; $j >= 0; $j--) { @@ -2393,8 +2396,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges echo "\n"; } } - echo "
". get_string("numberofnegativeresponses", "workshop"); echo "". get_string("suggestedgrade", "workshop")."
$i{$elements[$i]->maxscore}
\n"; - echo "

".get_string("optionaladjustment", + echo "
\n"; + echo "

\n"; } - echo "
".get_string("optionaladjustment", "workshop")."\n"; unset($numbers); for ($j = 20; $j >= -20; $j--) { @@ -2435,8 +2438,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges } echo "{$elements[$i]->maxscore}
\n"; - echo "

".get_string("optionaladjustment", + echo "
\n"; + echo "

\n"; echo "\n"; echo "\n"; + "

".get_string("weight", "workshop").": ". + number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."\n"; echo "

\n"; echo " \n"; @@ -2635,8 +2638,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges onclick=\"getElementById('assessmentform').action.value='addcomment';getElementById('assessmentform').submit();\" />\n"; } } - echo ""; - echo "\n"; + echo ""; + echo "\n"; } @@ -2650,7 +2653,7 @@ function workshop_print_assessments_by_user_for_admin($workshop, $user) { if ($assessments = workshop_get_user_assessments_done($workshop, $user)) { foreach ($assessments as $assessment) { workshop_print_assessment($workshop, $assessment); - echo "

". + echo "

". ''. get_string('assessthisassessment', 'workshop').' | '. "id&aid=$assessment->id\">". @@ -2672,9 +2675,9 @@ function workshop_print_assessments_for_admin($workshop, $submission) { if (!$user = get_record("user", "id", $assessment->userid)) { error (" workshop_print_assessments_for_admin: unable to get user record"); } - echo "

".get_string("assessmentby", "workshop", fullname($user))."

\n"; + echo "

".get_string("assessmentby", "workshop", fullname($user))."

\n"; workshop_print_assessment($workshop, $assessment); - echo "

id&aid=$assessment->id\">". + echo "

id&aid=$assessment->id\">". get_string("delete", "workshop")."


\n"; } } @@ -2707,7 +2710,7 @@ function workshop_print_assignment_info($workshop) { if ($date) { $strdifference = format_time($date - time()); if (($date - time()) < 0) { - $strdifference = "$strdifference"; + $strdifference = "$strdifference"; } $string .= ''.get_string($type, 'workshop').': '.userdate($date)." ($strdifference)
"; } @@ -2734,7 +2737,7 @@ function workshop_print_assignment_info($workshop) { function workshop_print_difference($time) { if ($time < 0) { $timetext = get_string("late", "assignment", format_time($time)); - return " ($timetext)"; + return " ($timetext)"; } else { $timetext = get_string("early", "assignment", format_time($time)); return " ($timetext)"; @@ -2749,7 +2752,7 @@ function workshop_print_key($workshop) { if (!$course = get_record("course", "id", $workshop->course)) { error("Print key: course not found"); } - echo "
\n"; + echo "
\n"; echo "

{} ".get_string("assessmentby", "workshop", $course->student).";  \n"; echo "[] ".get_string("assessmentby", "workshop", $course->teacher).";  \n"; echo "<> ".get_string("assessmentdropped", "workshop").";\n"; @@ -2863,8 +2866,10 @@ function workshop_print_submission($workshop, $submission) { $ffurl = "file.php?file=/$filearea/$file"; } echo "

"; + " wwwroot/$ffurl\">$file"; $n++; } } @@ -2968,7 +2973,7 @@ function workshop_print_submission_title($workshop, $submission) { function workshop_print_time_to_deadline($time) { if ($time < 0) { $timetext = get_string("afterdeadline", "workshop", format_time($time)); - return " ($timetext)"; + return " ($timetext)"; } else { $timetext = get_string("beforedeadline", "workshop", format_time($time)); return " ($timetext)"; @@ -2988,8 +2993,9 @@ function workshop_print_upload_form($workshop) { } $usehtmleditor = can_use_html_editor(); - echo "
"; + echo "
"; echo "
"; + echo "
"; echo " id\" />"; echo "
".get_string("optionaladjustment", "workshop")."\n"; unset($numbers); for ($j = 20; $j >= -20; $j--) { @@ -2458,8 +2461,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges echo "
".get_string("element", "workshop")." $iplus1:".format_text($elements[$i]->description). - "

".get_string("weight", "workshop").": ". - number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."

".get_string("select", "workshop"). "
".get_string("attachment", "workshop")." $n: \n"; + // removed target=\"uploadedfile\" as it does not validate + // MDL-7861 echo "pixpath/f/$icon\" class=\"icon\" alt=\"".get_string('file')."\" />". - " wwwroot/$ffurl\">$file
\n"; // now get the submission @@ -3010,7 +3016,7 @@ function workshop_print_upload_form($workshop) { } echo "
\n"; echo " "; - echo ""; + echo ""; echo "
"; } diff --git a/mod/workshop/mod.html b/mod/workshop/mod.html index 0137ac879e..0d63bdcee3 100644 --- a/mod/workshop/mod.html +++ b/mod/workshop/mod.html @@ -93,7 +93,6 @@
:
- "; @@ -107,7 +106,6 @@ } ?>
-
'; } else { - echo '

'; + echo '

'; helpbutton("textformat", get_string("formattexttype")); print_string("formattexttype"); echo ': '; @@ -408,7 +406,7 @@


-
+
@@ -419,7 +417,5 @@ " /> " /> - - -
+ diff --git a/mod/workshop/submissions.php b/mod/workshop/submissions.php index 658372d0cd..b71a82358e 100644 --- a/mod/workshop/submissions.php +++ b/mod/workshop/submissions.php @@ -74,10 +74,11 @@ print_heading(get_string("amendtitle", "workshop")); ?>
+
-
+
title\" />\n"; echo "
\n"; echo "\n"; - echo "
\n"; + echo "
\n"; print_heading("
frametarget href=\"view.php?id=$cm->id#sid=$submission->id\">".get_string("cancel").""); } @@ -242,10 +243,11 @@ } ?>
+
-
+
\n"; $n = 1; @@ -270,9 +272,11 @@ } else { $ffurl = "file.php?file=/$filearea/$file"; } + // removed target=\"uploadedfile\" + // as it does not validate MDL_7861 echo "\n"; + " wwwroot/$ffurl\">$file\n"; } } else { echo "\n"; @@ -291,7 +295,7 @@ echo "
". get_string("title", "workshop").":\n"; @@ -259,7 +261,7 @@ if ($basedir = workshop_file_area($workshop, $submission)) { if ($files = get_directory_list($basedir)) { echo "
".get_string("attachments", "workshop"). - "
".get_string("attachment", "workshop")." $n: pixpath/f/$icon\" class=\"icon\" alt=\"".get_string('file')."\" />". - " wwwroot/$ffurl\">$file
".get_string("noattachments", "workshop")."
\n"; echo "\n"; - echo "
\n"; + echo "
\n"; } @@ -380,9 +384,9 @@ $title .= get_string('by', 'workshop').' '.workshop_fullname($submission->userid, $course->id); } print_heading($title); - echo '
'.get_string('submitted', 'workshop').': '.userdate($submission->timecreated).'

'; + echo '
'.get_string('submitted', 'workshop').': '.userdate($submission->timecreated).'

'; workshop_print_submission($workshop, $submission); - print_continue($_SERVER['HTTP_REFERER'].'#sid='.$submission->id); + print_continue(htmlentities($_SERVER['HTTP_REFERER'].'#sid='.$submission->id)); } diff --git a/mod/workshop/view.php b/mod/workshop/view.php index 7a3cb397bd..2816f71aef 100644 --- a/mod/workshop/view.php +++ b/mod/workshop/view.php @@ -91,7 +91,7 @@ // show the final grades as stored in the tables... if ($submissions = workshop_get_user_submissions($workshop, $USER)) { // any submissions from user? print_heading(get_string("displayoffinalgrades", "workshop")); - echo "
"; + echo "
"; echo ""; if ($workshop->wtype) { echo ""; @@ -121,7 +121,7 @@ echo ""; echo "\n"; } - echo "
".get_string("submissions", "workshop")."".get_string("assessmentsdone", "workshop")."$grade".number_format($gradinggrade + $grade, 1)."

\n"; + echo "
\n"; workshop_print_key($workshop); } else { print_heading(get_string('nowork', 'workshop')); @@ -528,7 +528,7 @@ workshop_print_assignment_info($workshop); print_simple_box(format_text($workshop->description, $workshop->format), 'center', '70%', '', 5, 'generalbox', 'intro'); if (isset($_SERVER["HTTP_REFERER"])) { - print_continue($_SERVER["HTTP_REFERER"]); + print_continue(htmlentities($_SERVER["HTTP_REFERER"])); } else { print_continue("$CFG->wwwroot/course/view.php?id=$cm->id"); } diff --git a/mod/workshop/viewassessment.php b/mod/workshop/viewassessment.php index 3290c73550..cba5bbd1e4 100644 --- a/mod/workshop/viewassessment.php +++ b/mod/workshop/viewassessment.php @@ -26,7 +26,7 @@ } if (!$redirect) { - $redirect = urlencode($_SERVER["HTTP_REFERER"].'#sid='.$submission->id); + $redirect = htmlentities($_SERVER["HTTP_REFERER"].'#sid='.$submission->id); } require_login($course->id, false, $cm); @@ -59,10 +59,11 @@ if ($frameset == "top") { + // removed as it does not validate print_header_simple(format_string($workshop->name), "", "id\">$strworkshops -> id\">".format_string($workshop->name,true)." -> $strassess", - "", '', true); + "", '', true); // show assessment but don't allow changes workshop_print_assessment($workshop, $assessment, false, $allowcomments); @@ -77,8 +78,8 @@ } /// print bottom frame with the submission - - print_header('', '', '', '', ''); + // removed as it does not validate + print_header('', '', '', '', ''); $title = '"'.$submission->title.'" '; if (workshop_is_teacher($workshop)) { $title .= ' '.get_string('by', 'workshop').' '.workshop_fullname($submission->userid, $course->id); diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index b6eddbb5be..2a665e58a9 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -2717,3 +2717,11 @@ wikiadminactions { /*** *** Modules: Workshop ***/ +.redfont { + color: red; +} + +.workshopuploadform, +.workshopkey { + text-align:center; +} \ No newline at end of file -- 2.39.5