]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-7861, fixes for workshop
authortoyomoyo <toyomoyo>
Wed, 10 Jan 2007 08:29:41 +0000 (08:29 +0000)
committertoyomoyo <toyomoyo>
Wed, 10 Jan 2007 08:29:41 +0000 (08:29 +0000)
12 files changed:
lib/weblib.php
mod/workshop/assess.php
mod/workshop/assessment_grading_form.html
mod/workshop/assessments.php
mod/workshop/index.php
mod/workshop/lib.php
mod/workshop/locallib.php
mod/workshop/mod.html
mod/workshop/submissions.php
mod/workshop/view.php
mod/workshop/viewassessment.php
theme/standard/styles_layout.css

index 5fb433e34b993c35befa5a07119689708550e2fd..f349f8a0874e9e707b85ee3bd3a431a64549dd8a 100644 (file)
@@ -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 .= '<div class="continuebutton">';
+    // MDL-7861, referer string might not be xhtml strict
+    // e.g. &amp;
+    
     $output .= print_single_button($link, NULL, get_string('continue'), 'post', $CFG->framename, true);
     $output .= '</div>'."\n";
 
@@ -2982,7 +2986,7 @@ function print_single_button($link, $options, $label='OK', $method='get', $targe
     $output = '';
     $output .= '<div class="singlebutton">';
     // taking target out, will need to add later target="'.$target.'"
-    $output .= '<form action="'. $link .'" method="'. $method .'">';
+    $output .= '<form action="'. $link .'" method="'. $method .'">';   
     $output .= '<fieldset class="invisiblefieldset">';
     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 .= '<th valign="top" '. $align[$key].$size[$key] .' style="white-space:nowrap;" class="header c'.$key.'" scope="col">'. $heading .'</th>';
+            
+            $output .= '<th class="header c'.$key.'" scope="col">'. $heading .'</th>';
+            // commenting the following code out as <th style does not validate MDL-7861
+            //$output .= '<th sytle="vertical-align:top;'. $align[$key].$size[$key] .';white-space:nowrap;" class="header c'.$key.'" scope="col">'. $heading .'</th>';
         }
         $output .= '</tr>'."\n";
     }
@@ -3471,7 +3478,7 @@ function print_table($table, $return=false) {
                     if (!isset($wrap[$key])) {
                         $wrap[$key] = '';
                     }
-                    $output .= '<td '. $align[$key].$size[$key].$wrap[$key] .' class="cell c'.$key.'">'. $item .'</td>';
+                    $output .= '<td style="'. $align[$key].$size[$key].$wrap[$key] .'" class="cell c'.$key.'">'. $item .'</td>';
                 }
             }
             $output .= '</tr>'."\n";
index c955b316bdb5842240221d38ad1bad2f0277c9a4..99d23b7d07c2986140a7f1d3fa9ec42c91d609e5 100644 (file)
@@ -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);
     }
 
 
     /// top frame with the navigation bar and the assessment form
 
     if ($frameset == "top") {
-
+        // removed <base target="_parent" />
+        // because it does not validate MDL-7861
         print_header_simple(format_string($workshop->name), "",
                      "<a href=\"index.php?id=$course->id\">$strworkshops</a> ->
                       <a href=\"view.php?id=$cm->id\">".format_string($workshop->name,true)."</a> -> $strassess",
-                      "", '<base target="_parent" />', 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",
     }
 
     /// print bottom frame with the submission
-
-    print_header('', '', '', '', '<base target="_parent" />');
+    // removed <base target="_parent" /> 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);
     workshop_print_submission($workshop, $submission);
 
     if (workshop_is_teacher($workshop)) {
-        echo '<br /><center><b>'.get_string('assessments', 'workshop').': </b><br />';
+        echo '<br /><div style="text-align:center"><b>'.get_string('assessments', 'workshop').': </b><br />';
         echo workshop_print_submission_assessments($workshop, $submission, "all");
-        echo '</center>';
+        echo '</div>';
     }
 
 
index b8d5f7e3d750bf626a3d90cca6ea9ba1a40295d6..b2d17aa9f477cd7fd504a2c6cb28e2d0b72e2903 100644 (file)
@@ -4,11 +4,12 @@
     }
 ?>
 <form id="gradingform" action="assessments.php" method="post">
+<fieldset class="invisiblefieldset">
   <input type="hidden" name="action" value="updategrading" />
   <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
   <input type="hidden" name="redirect" value="<?php echo $redirect ?>" />
   <input type="hidden" name="aid" value="<?php echo $aid ?>" />
-  <center>
+  <div class="boxaligncenter">
     <table cellpadding="5" border="1">
       <tr valign="top">
         <td align="right"><b><?php print_string("teacherscomment", "workshop") ?>:</b></td>
@@ -25,5 +26,6 @@
       </tr>
     </table>
     <input type="submit" value="<?php print_string("savemygrading", "workshop") ?>" />
-  </center>
+  </div>
+</fieldset>
 </form> 
\ No newline at end of file
index e8f753deac0d5f2ff5212ebee2e11b3225a3be5d..451b70d4edf38472baf1bd217556dfe542032a8c 100644 (file)
@@ -97,7 +97,7 @@
         <input type="hidden" name="action" value="insertcomment" />
         <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
         <input type="hidden" name="aid" value="<?php echo $aid ?>" />
-        <center>
+        <div class="boxaligncenter">
         <table cellpadding="5" border="1">
         <?php
 
 
         echo "  </td></tr></table>\n";
         echo "<input type=\"submit\" value=\"".get_string("savemycomment", "workshop")."\" />\n";
-        echo "</center></form>\n";
-        echo "<center><b>".get_string("assessment", "workshop"). "</b></center>\n";
+        echo "</div></form>\n";
+        echo "<div style=\"text-align:center\"><b>".get_string("assessment", "workshop"). "</b></div>\n";
         workshop_print_assessment($workshop, $assessment);
     }
 
             }
         //save time of agreement
         set_field("workshop_assessments", "timeagreed", $timenow, "id", $assessment->id);
-        echo "<centre><b>".get_string("savedok", "workshop")."</b></center><br />\n";
+        echo "<div style=\"text-align:center\"><b>".get_string("savedok", "workshop")."</b></div><br />\n";
 
         add_to_log($course->id, "workshop", "agree", "viewassessment.php?id=$cm->id&amp;aid=$assessment->id", "$assessment->id");
         print_continue("view.php?id=$cm->id");
         <input type="hidden" name="action" value="updatecomment" />
         <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
         <input type="hidden" name="cid" value="<?php echo $cid ?>" />
-        <center>
+        <div class="boxaligncenter">
         <table cellpadding="5" border="1">
         <?php
 
         echo "      </textarea>\n";
         echo "  </td></tr></table>\n";
         echo "<input type=\"submit\" value=\"".get_string("savemycomment", "workshop")."\" />\n";
-        echo "</center></form>\n";
+        echo "</div></form>\n";
         workshop_print_assessment($workshop, $assessment);
         }
 
         <form id="form" method="post" action="assessments.php">
         <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
         <input type="hidden" name="action" value="insertelements" />
-        <center><table cellpadding="5" border="1">
+        <div class="boxaligncenter"><table cellpadding="5" border="1">
         <?php
 
         // get existing elements, if none set up appropriate default ones
                     echo "  <td colspan=\"2\" class=\"workshopassessmentheading\">&nbsp;</td>\n";
                     echo "</tr>\n";
                 }
-                echo "</center></table><br />\n";
-                echo "<center><b>".get_string("gradetable","workshop")."</b></center>\n";
-                echo "<center><table cellpadding=\"5\" border=\"1\"><tr><td align=\"CENTER\">".
+                echo "</div></table><br />\n";
+                echo "<div style=\"text-align:center\"><b>".get_string("gradetable","workshop")."</b></div>\n";
+                echo "<div class=\"boxaligncenter\"><table cellpadding=\"5\" border=\"1\"><tr><td align=\"CENTER\">".
                     get_string("numberofnegativeresponses", "workshop");
                 echo "</td><td>". get_string("suggestedgrade", "workshop")."</td></tr>\n";
                 for ($j = $workshop->grade; $j >= 0; $j--) {
                     choose_from_menu($numbers, "maxscore[$i]", $elements[$i]->maxscore, "");
                     echo "</td></tr>\n";
                 }
-                echo "</table></center>\n";
+                echo "</table></div>\n";
                 break;
 
             case 3: // criterion grading
         </table><br />
         <input type="submit" value="<?php  print_string("savechanges") ?>" />
         <input type="submit" name="cancel" value="<?php  print_string("cancel") ?>" />
-        </center>
+        </div>
         </form>
         <?php
     }
         }
         // get the teacher's assessment first
         if ($teachersassessment = workshop_get_submission_assessment($submission, $USER)) {
-            echo "<center><b>".get_string("teacherassessments", "workshop", $course->teacher)."</b></center>\n";
+            echo "<div style=\"text-align:center\"><b>".get_string("teacherassessments", "workshop", $course->teacher)."</b></div>\n";
             workshop_print_assessment($workshop, $teachersassessment);
         }
         // now the student's assessment (don't allow changes)
         $user = get_record("user", "id", $assessment->userid);
-        echo "<center><b>".get_string("assessmentby", "workshop", $user->firstname." ".$user->lastname)."</b></center>\n";
+        echo "<div style=\"text-align:center\"><b>".get_string("assessmentby", "workshop", $user->firstname." ".$user->lastname)."</b></div>\n";
         workshop_print_assessment($workshop, $assessment);
 
         include('assessment_grading_form.html');
             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 "<centre><b>".get_string("savedok", "workshop")."</b></center><br />\n";
+            echo "<centre><b>".get_string("savedok", "workshop")."</b></div><br />\n";
 
             add_to_log($course->id, "workshop", "comment",
                     "viewassessment.php?id=$cm->id&amp;aid=$assessment->id", "$comment->id");
index 3a04f3e566c786916c3758b4428227d158d704d2..5e9aae0988157ae3de259c86235083f6e528856c 100644 (file)
@@ -61,7 +61,7 @@
                     $submitted = userdate($submission->timecreated);
                 }
                 else {
-                    $submitted = "<font color=\"red\">".userdate($submission->timecreated)."</font>";
+                    $submitted = "<span class=\"redfont\">".userdate($submission->timecreated)."</span>";
                 }
                 if (!$workshop->visible) {
                     //Show dimmed if the mod is hidden
index 6fd7629a170741ce9018d3dbc9bdc7616e9adbc5..877b41a9078ca85ad843904e8ecd7d6facdd43f9 100644 (file)
@@ -1644,7 +1644,7 @@ function workshop_grade_assessments($workshop, $verbose=false) {
                 }
             }
             if ($verbose) {
-                echo "<p align=\"center\">".get_string("numberofsubmissions", "workshop", count($num))."<br />\n";
+                echo "<p style=\"text-align:center\">".get_string("numberofsubmissions", "workshop", count($num))."<br />\n";
                 echo get_string("numberofassessmentsweighted", "workshop", $total)."</p>\n";
             }
 
index 822755cfacb6ed2646cde5d8ccd2a6bcd67888e8..39f7ebec1135d06bb6f2547c56a3dca43fc59c0a 100644 (file)
@@ -871,8 +871,8 @@ function workshop_list_all_submissions($workshop, $user) {
         print_table($table);
         }
 
-    echo "<center><p><b>".get_string("studentsubmissions", "workshop", $course->student).
-        "</b></center><br />\n";
+    echo "<div style=\"text-align:center;\"><p><b>".get_string("studentsubmissions", "workshop", $course->student).
+        "</b></div><br />\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 "<center>".get_string("noassessmentsdone", "workshop")."</center>\n";
+        echo "<div style=\"text-align:center;\">".get_string("noassessmentsdone", "workshop")."</div>\n";
     }
 }
 
@@ -1124,7 +1124,7 @@ function workshop_list_peer_assessments($workshop, $user) {
         print_table($table);
         }
     else {
-        echo "<center>".get_string("noassessmentsdone", "workshop")."</center>\n";
+        echo "<div style=\"text-align:center;\">".get_string("noassessmentsdone", "workshop")."</div>\n";
         }
     }
 
@@ -1170,8 +1170,8 @@ function workshop_list_self_assessments($workshop, $user) {
         }
     }
     if (isset($table->data)) {
-        echo "<p><center><b>".get_string("pleaseassessyoursubmissions", "workshop", $course->student).
-            "</b></center><br />\n";
+        echo "<p><div style=\"text-align:center;\"><b>".get_string("pleaseassessyoursubmissions", "workshop", $course->student).
+            "</b></div><br />\n";
         print_table($table);
     }
 }
@@ -1297,12 +1297,12 @@ function workshop_list_student_submissions($workshop, $user) {
         }
     
     if (isset($table->data)) {
-        echo "<p><center><b>".get_string("pleaseassessthesestudentsubmissions", "workshop", $course->student).
-            "</b></center><br />\n";
+        echo "<p><div style=\"text-align:center;\"><b>".get_string("pleaseassessthesestudentsubmissions", "workshop", $course->student).
+            "</b></div><br />\n";
         print_table($table);
         }
     else {
-        echo "<p><center><b>".get_string("nosubmissionsavailableforassessment", "workshop")."</b></center><br />\n";
+        echo "<p><div style=\"text-align:center;\"><b>".get_string("nosubmissionsavailableforassessment", "workshop")."</b></div><br />\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 "<p align=\"center\"><a href=\"assessments.php?id=$cm->id&amp;action=regradestudentassessments\">".
+            echo "<p style=\"text-align:center\"><a href=\"assessments.php?id=$cm->id&amp;action=regradestudentassessments\">".
                     get_string("regradestudentassessments", "workshop")."</a> ";
             helpbutton("regrading", get_string("regradestudentassessments", "workshop"), "workshop");
             echo "</p>\n";
@@ -1508,7 +1508,7 @@ function workshop_list_submissions_for_admin($workshop, $order) {
             }
             $datesubmitted = userdate($submission->timecreated);
             if ($submission->late) {
-                $datesubmitted = "<font color=\"red\">".$datesubmitted."</font>";
+                $datesubmitted = "<span class=\"redfont\">".$datesubmitted."</span>";
             }
             $action = "<a href=\"submissions.php?action=adminamendtitle&amp;id=$cm->id&amp;sid=$submission->id\">".
                 get_string("amendtitle", "workshop")."</a>";
@@ -1597,7 +1597,7 @@ function workshop_list_teacher_assessments_by_user($workshop, $user) {
         print_table($table);
         }
     else {
-        echo "<center>".get_string("noassessmentsdone", "workshop")."</center>\n";
+        echo "<div style=\"text-align:center;\">".get_string("noassessmentsdone", "workshop")."</div>\n";
         }
     }
 
@@ -1900,7 +1900,7 @@ function workshop_list_user_submissions($workshop, $user) {
             }
             $datesubmitted = userdate($submission->timecreated);
             if ($submission->late) {
-                $datesubmitted = "<font color=\"red\">".$datesubmitted."</font>";
+                $datesubmitted = "<span class=\"redfont\">".$datesubmitted."</span>";
             }
             $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', 
-            "<a href=\"submissions.php?id=$cm->id&amp;action=showsubmission&amp;sid=$submission->id\" target=\"submission\">".
+            "<a href=\"submissions.php?id=$cm->id&amp;action=showsubmission&amp;sid=$submission->id\" >".
             $submission->title.'</a>'));
     }
     
@@ -1979,7 +1981,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
             $showgrades = true;
         }
         
-        echo "<center>\n";
+        echo "<div class=\"boxaligncenter\">\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 "<p align=\"right\"><a href=\"assessments.php?action=addcomment&amp;id=$cm->id&amp;aid=$assessment->id\">".
+                        echo "<p style=\"text-align:right\"><a href=\"assessments.php?action=addcomment&amp;id=$cm->id&amp;aid=$assessment->id\">".
                             get_string("reply", "workshop")."</a></p>\n";
                     }
                     elseif (($comment->userid ==$USER->id) and (($timenow - $comment->timecreated) < $CFG->maxeditingtime)) {
-                        echo "<p align=\"right\"><a href=\"assessments.php?action=editcomment&amp;id=$cm->id&amp;cid=$comment->id\">".
+                        echo "<p style=\"text-align:right\"><a href=\"assessments.php?action=editcomment&amp;id=$cm->id&amp;cid=$comment->id\">".
                             get_string("edit", "workshop")."</a>\n";
                         if ($USER->id == $submission->userid) {
                             echo " | <a href=\"assessments.php?action=agreeassessment&amp;id=$cm->id&amp;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 "<p align=\"right\"><a href=\"assessments.php?action=addcomment&amp;id=$cm->id&amp;aid=$assessment->id\">".
+                        echo "<p style=\"text-align:right\"><a href=\"assessments.php?action=addcomment&amp;id=$cm->id&amp;aid=$assessment->id\">".
                             get_string("reply", "workshop")."</a>\n";
                         if ($USER->id == $submission->userid) {
                             echo " | <a href=\"assessments.php?action=agreeassessment&amp;id=$cm->id&amp;aid=$assessment->id\">".
@@ -2042,31 +2044,32 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
             }
             echo '</table>';
         }
-        echo '</center>';
+        echo '</div>';
     }
         
     // now print the grading form with the grading grade if any
     // FORM is needed for Mozilla browsers, else radio bttons are not checked
         ?>
     <form id="assessmentform" method="post" action="assessments.php">
+    <div>
     <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
     <input type="hidden" name="aid" value="<?php echo $assessment->id ?>" />
     <input type="hidden" name="action" value="updateassessment" />
     <input type="hidden" name="returnto" value="<?php echo $returnto ?>" />
     <input type="hidden" name="elementno" value="" />
     <input type="hidden" name="stockcommentid" value="" />
-    <center>
-    <table cellpadding="2" border="1">
+    <div class="boxaligncenter">
+    <table cellpadding="2" border="1" class="boxaligncenter">
     <?php
     echo "<tr valign=\"top\">\n";
-    echo "  <td colspan=\"2\" class=\"workshopassessmentheading\"><center><b>";
+    echo "  <td colspan=\"2\" class=\"workshopassessmentheading\"><div style=\"text-align:center;\"><b>";
     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 '</b><br />'.userdate($assessment->timecreated)."</center></td>\n";
+    echo '</b><br />'.userdate($assessment->timecreated)."</div></td>\n";
     echo "</tr>\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 "<tr valign=\"top\">\n";
                 echo "  <td align=\"right\"><p><b>". get_string("element","workshop")." $iplus1:</b></p></td>\n";
                 echo "  <td>".format_text($elements[$i]->description);
-                echo "<p align=\"right\"><font size=\"1\">".get_string("weight", "workshop").": ".
-                    number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."</font></p>\n";
+                echo "<p style=\"text-align:right\">".get_string("weight", "workshop").": ".
+                    number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."</p>\n";
                 echo "</td></tr>\n";
                 if ($showgrades) {
                     echo "<tr valign=\"top\">\n";
@@ -2183,7 +2186,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                     switch ($SCALE->type) {
                         case 'radio' :
                                 // show selections highest first
-                                echo "<center><b>$SCALE->start</b>&nbsp;&nbsp;&nbsp;";
+                                echo "<div class=\"boxaligncenter\"><b>$SCALE->start</b>&nbsp;&nbsp;&nbsp;";
                                 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 " <input type=\"radio\" name=\"grade[$i]\" value=\"$j\" alt=\"$j\" /> &nbsp;&nbsp;&nbsp;\n";
                                         }
                                     }
-                                echo "&nbsp;&nbsp;&nbsp;<b>$SCALE->end</b></center>\n";
+                                echo "&nbsp;&nbsp;&nbsp;<b>$SCALE->end</b></div>\n";
                                 break;
                         case 'selection' :  
                                 unset($numbers);
@@ -2275,8 +2278,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                 echo "<tr valign=\"top\">\n";
                 echo "  <td align=\"right\"><p><b>". get_string("element","workshop")." $iplus1:</b></p></td>\n";
                 echo "  <td>".format_text($elements[$i]->description);
-                echo "<p align=\"right\"><font size=\"1\">".get_string("weight", "workshop").": ".
-                    number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."</font>\n";
+                echo "<p style=\"text-align:right\">".get_string("weight", "workshop").": ".
+                    number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."\n";
                 echo "</td></tr>\n";
                 echo "<tr valign=\"top\">\n";
                 echo "  <td align=\"right\"><p><b>". get_string("grade"). ":</b></p></td>\n";
@@ -2287,7 +2290,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                 switch ($SCALE->type) {
                     case 'radio' :
                             // show selections highest first
-                            echo "<center><b>$SCALE->start</b>&nbsp;&nbsp;&nbsp;";
+                            echo "<div class=\"boxaligncenter\"><b>$SCALE->start</b>&nbsp;&nbsp;&nbsp;";
                             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 " <input type=\"radio\" name=\"grade[$i]\" value=\"$j\" alt=\"$j\" /> &nbsp;&nbsp;&nbsp;\n";
                                     }
                                 }
-                            echo "&nbsp;&nbsp;&nbsp;<b>$SCALE->end</b></center>\n";
+                            echo "&nbsp;&nbsp;&nbsp;<b>$SCALE->end</b></div>\n";
                             break;
                     case 'selection' :  
                             unset($numbers);
@@ -2376,10 +2379,10 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
             // echo "<tr><td>".get_string("numberofnegativeitems", "workshop")."</td><td>$negativecount</td></tr>\n";
             // echo "<tr valign=\"top\">\n";
             // echo "   <td colspan=\"2\" class=\"workshopassessmentheading\">&nbsp;</td>\n";
-            echo "</table></center>\n";
+            echo "</table></div>\n";
             // now print the grade table
-            echo "<p><center><b>".get_string("gradetable","workshop")."</b></center>\n";
-            echo "<center><table cellpadding=\"5\" border=\"1\"><tr><td align=\"CENTER\">".
+            echo "<p><div style=\"text-align:center;\"><b>".get_string("gradetable","workshop")."</b></div>\n";
+            echo "<div class=\"boxaligncenter\"><table cellpadding=\"5\" border=\"1\"><tr><td align=\"CENTER\">".
                 get_string("numberofnegativeresponses", "workshop");
             echo "</td><td>". get_string("suggestedgrade", "workshop")."</td></tr>\n";
             for ($j = 100; $j >= 0; $j--) {
@@ -2393,8 +2396,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                     echo "<tr><td align=\"CENTER\">$i</td><td align=\"CENTER\">{$elements[$i]->maxscore}</td></tr>\n";
                     }
                 }
-            echo "</table></center>\n";
-            echo "<p><center><table cellpadding=\"5\" border=\"1\"><tr><td><b>".get_string("optionaladjustment", 
+            echo "</table></div>\n";
+            echo "<p><div class=\"boxaligncenter\"><table cellpadding=\"5\" border=\"1\"><tr><td><b>".get_string("optionaladjustment", 
                     "workshop")."</b></td><td>\n";
             unset($numbers);
             for ($j = 20; $j >= -20; $j--) {
@@ -2435,8 +2438,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                     }
                 echo "<td align=\"center\">{$elements[$i]->maxscore}</td></tr>\n";
                 }
-            echo "</table></center>\n";
-            echo "<p><center><table cellpadding=\"5\" border=\"1\"><tr><td><b>".get_string("optionaladjustment", 
+            echo "</table></div>\n";
+            echo "<p><div class=\"boxaligncenter\"><table cellpadding=\"5\" border=\"1\"><tr><td><b>".get_string("optionaladjustment", 
                     "workshop")."</b></td><td>\n";
             unset($numbers);
             for ($j = 20; $j >= -20; $j--) {
@@ -2458,8 +2461,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                 echo "<tr valign=\"top\">\n";
                 echo "<td align=\"right\"><b>".get_string("element", "workshop")." $iplus1:</b></td>\n";
                 echo "<td>".format_text($elements[$i]->description).
-                     "<p align=\"right\"><font size=\"1\">".get_string("weight", "workshop").": ".
-                    number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."</font></td></tr>\n";
+                     "<p style=\"text-align:right\">".get_string("weight", "workshop").": ".
+                    number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."</td></tr>\n";
                 echo "<tr valign=\"top\">\n";
                 echo "  <td class=\"workshopassessmentheading\" align=\"center\"><b>".get_string("select", "workshop").
                     "</b></td>\n";
@@ -2635,8 +2638,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                 onclick=\"getElementById('assessmentform').action.value='addcomment';getElementById('assessmentform').submit();\" />\n";
         }
     }
-    echo "</center>";
-    echo "</form>\n";
+    echo "</div>";
+    echo "</div></form>\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 "<p align=\"right\">".
+            echo "<p style=\"text-align:right\">".
                 '<a href="viewassessment.php?&amp;id='.$cm->id.'&amp;stype=student&amp;aid='.$assessment->id.'">'.
                 get_string('assessthisassessment', 'workshop').'</a> | '.
                 "<a href=\"assessments.php?action=confirmdelete&amp;id=$cm->id&amp;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 "<p><center><b>".get_string("assessmentby", "workshop", fullname($user))."</b></center></p>\n";
+            echo "<p><div style=\"text-align:center;\"><b>".get_string("assessmentby", "workshop", fullname($user))."</b></div></p>\n";
             workshop_print_assessment($workshop, $assessment);
-            echo "<p align=\"right\"><a href=\"assessments.php?action=confirmdelete&amp;id=$cm->id&amp;aid=$assessment->id\">".
+            echo "<p style=\"text-align:right\"><a href=\"assessments.php?action=confirmdelete&amp;id=$cm->id&amp;aid=$assessment->id\">".
                 get_string("delete", "workshop")."</a></p><hr />\n";
             }
         }
@@ -2707,7 +2710,7 @@ function workshop_print_assignment_info($workshop) {
         if ($date) {
             $strdifference = format_time($date - time());
             if (($date - time()) < 0) {
-                $strdifference = "<font color=\"red\">$strdifference</font>";
+                $strdifference = "<span class=\"redfont\">$strdifference</span>";
             }
             $string .= '<b>'.get_string($type, 'workshop').'</b>: '.userdate($date)." ($strdifference)<br />";
         }
@@ -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 " (<font color=\"red\">$timetext</font>)";
+        return " (<span class=\"redfont\">$timetext</span>)";
     } 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 "<div align=\"center\">\n";
+    echo "<div class=\"workshopkey\">\n";
     echo "<p><small>{} ".get_string("assessmentby", "workshop", $course->student).";&nbsp;&nbsp;\n";
     echo "[] ".get_string("assessmentby", "workshop", $course->teacher).";&nbsp;&nbsp;\n";
     echo "&lt;&gt; ".get_string("assessmentdropped", "workshop").";\n";
@@ -2863,8 +2866,10 @@ function workshop_print_submission($workshop, $submission) {
                         $ffurl = "file.php?file=/$filearea/$file";
                     }
                     echo "<tr><td><b>".get_string("attachment", "workshop")." $n:</b> \n";
+                    // removed target=\"uploadedfile\" as it does not validate
+                    // MDL-7861
                     echo "<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"".get_string('file')."\" />".
-                        "&nbsp;<a target=\"uploadedfile\" href=\"$CFG->wwwroot/$ffurl\">$file</a></td></tr>";
+                        "&nbsp;<a href=\"$CFG->wwwroot/$ffurl\">$file</a></td></tr>";
                     $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 " (<font color=\"red\">$timetext</font>)";
+        return " (<span class=\"redfont\">$timetext</span>)";
     } 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 "<div align=\"center\">";
+    echo "<div class=\"workshopuploadform\">";
     echo "<form enctype=\"multipart/form-data\" method=\"POST\" action=\"upload.php\">";
+    echo "<fieldset class=\"invisiblefieldset\">";
     echo " <input type=\"hidden\" name=\"id\" value=\"$cm->id\" />";
     echo "<table celpadding=\"5\" border=\"1\" align=\"center\">\n";
     // now get the submission
@@ -3010,7 +3016,7 @@ function workshop_print_upload_form($workshop) {
     }
     echo "</td></tr></table>\n";
     echo " <input type=\"submit\" name=\"save\" value=\"".get_string("submitassignment","workshop")."\" />";
-    echo "</form>";
+    echo "</fieldset></form>";
     echo "</div>";
 }
 
index 0137ac879e18bdd33ed5392ff97d4c7910282574..0d63bdcee3ea32c40b6641819beafceda29ce3f9 100644 (file)
@@ -93,7 +93,6 @@
 </tr>
 <tr valign="top">
     <td align="right"><b><?php  print_string("description", "workshop") ?>:</b><br />
-    <font size="1">
      <?php
         helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
         echo "<br />";
         }
       ?>
       <br />
-    </font>
     </td>
     <td>
     <?php
        if ($usehtmleditor) {
            echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
        } else {
-           echo '<p align="right">';
+           echo '<p style="text-align:right">';
            helpbutton("textformat", get_string("formattexttype"));
            print_string("formattexttype");
            echo ':&nbsp;';
 <?php print_standard_coursemodule_settings($form); ?>
 </table>
 <br />
-<center>
+<div class="boxaligncenter">
 <input type="hidden" name="course"     value="<?php  p($form->course) ?>" />
 <input type="hidden" name="sesskey"    value="<?php  p($form->sesskey) ?>" />
 <input type="hidden" name="coursemodule"  value="<?php  p($form->coursemodule) ?>" />
 <input type="hidden" name="mode"       value="<?php  p($form->mode) ?>" />
 <input type="submit" value="<?php  print_string("savechanges") ?>" />
 <input type="submit" name="cancel" value="<?php  print_string("cancel") ?>" />
-
-
-</center>
+</div>
 </form>
index 658372d0cdb99310d0f097be5cc79f241ef00ee5..b71a82358e93c6704c0fa37126787bdd05e37588 100644 (file)
         print_heading(get_string("amendtitle", "workshop"));
         ?>
         <form id="amendtitleform" action="submissions.php" method="post">
+        <fieldset class="invisiblefieldset">
         <input type="hidden" name="action" value="adminupdatetitle" />
         <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
         <input type="hidden" name="sid" value="<?php echo $sid ?>" />
-        <center>
+        <div class="boxaligncenter">
         <table cellpadding="5" border="1">
         <?php
 
@@ -88,7 +89,7 @@
         echo "      <input type=\"text\" name=\"title\" size=\"60\" maxlength=\"100\" value=\"$submission->title\" />\n";
         echo "  </td></tr></table>\n";
         echo "<input type=\"submit\" value=\"".get_string("amendtitle", "workshop")."\" />\n";
-        echo "</center></form>\n";
+        echo "</div></fieldset></form>\n";
 
         print_heading("<a $CFG->frametarget href=\"view.php?id=$cm->id#sid=$submission->id\">".get_string("cancel")."</a>");
     }
         }
         ?>
         <form id="editform" enctype="multipart/form-data" action="submissions.php" method="post">
+        <fieldset class="invisiblefieldset">
         <input type="hidden" name="action" value="updatesubmission" />
         <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
         <input type="hidden" name="sid" value="<?php echo $sid ?>" />
-        <center>
+        <div class="boxaligncenter">
         <table cellpadding="5" border="1">
         <?php
         echo "<tr valign=\"top\"><td><b>". get_string("title", "workshop").":</b>\n";
             if ($basedir = workshop_file_area($workshop, $submission)) {
                 if ($files = get_directory_list($basedir)) {
                     echo "<tr><td><b>".get_string("attachments", "workshop").
-                        "</b><div align=\"right\"><input type=\"button\" value=\"".get_string("removeallattachments",
+                        "</b><div style=\"text-align:right;\"><input type=\"button\" value=\"".get_string("removeallattachments",
                         "workshop")."\" onclick=\"getElementById('editform').action.value='removeattachments';
                         getElementById('editform').submit();\"/></div></td></tr>\n";
                     $n = 1;
                         } else {
                             $ffurl = "file.php?file=/$filearea/$file";
                         }
+                        // removed target=\"uploadedfile\" 
+                        // as it does not validate MDL_7861
                         echo "<tr><td>".get_string("attachment", "workshop")." $n: <img src=\"$CFG->pixpath/f/$icon\"
                             class=\"icon\" alt=\"".get_string('file')."\" />".
-                            "&nbsp;<a target=\"uploadedfile\" href=\"$CFG->wwwroot/$ffurl\">$file</a></td></tr>\n";
+                            "&nbsp;<a href=\"$CFG->wwwroot/$ffurl\">$file</a></td></tr>\n";
                     }
                 } else {
                     echo "<tr><td><b>".get_string("noattachments", "workshop")."</b></td></tr>\n";
 
         echo "</table>\n";
         echo "<input type=\"submit\" value=\"".get_string("savemysubmission", "workshop")."\" />\n";
-        echo "</center></form>\n";
+        echo "</div></fieldset></form>\n";
     }
 
 
             $title .= get_string('by', 'workshop').' '.workshop_fullname($submission->userid, $course->id);
         }
         print_heading($title);
-        echo '<center>'.get_string('submitted', 'workshop').': '.userdate($submission->timecreated).'</center><br />';
+        echo '<div style="text-align:center">'.get_string('submitted', 'workshop').': '.userdate($submission->timecreated).'</div><br />';
         workshop_print_submission($workshop, $submission);
-        print_continue($_SERVER['HTTP_REFERER'].'#sid='.$submission->id);
+        print_continue(htmlentities($_SERVER['HTTP_REFERER'].'#sid='.$submission->id));
     }
 
 
index 7a3cb397bd169c0680431969a55810409878b1b5..2816f71aef97d5f0820e450cc9b3a1e3a947989e 100644 (file)
@@ -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 "<center><table border=\"1\" width=\"90%\"><tr>";
+            echo "<div class=\"boxaligncenter\"><table border=\"1\" width=\"90%\"><tr>";
             echo "<td><b>".get_string("submissions", "workshop")."</b></td>";
             if ($workshop->wtype) {
                 echo "<td align=\"center\"><b>".get_string("assessmentsdone", "workshop")."</b></td>";
                 echo "<td align=\"center\">$grade</td>";
                 echo "<td align=\"center\">".number_format($gradinggrade + $grade, 1)."</td></tr>\n";
             }
-            echo "</table></center><br clear=\"all\" />\n";
+            echo "</table></div><br clear=\"all\" />\n";
             workshop_print_key($workshop);
         } else {
             print_heading(get_string('nowork', 'workshop'));
         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");
         }
index 3290c73550749223bb93f97fdc670c31f8837bb2..cba5bbd1e49e200eafcd78b1bb22ef11fe1edcc6 100644 (file)
@@ -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);
 
     if ($frameset == "top") {
 
+        // removed <base target="_parent" /> as it does not validate
         print_header_simple(format_string($workshop->name), "",
                      "<a href=\"index.php?id=$course->id\">$strworkshops</a> ->
                       <a href=\"view.php?id=$cm->id\">".format_string($workshop->name,true)."</a> -> $strassess",
-                      "", '<base target="_parent" />', 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('', '', '', '', '<base target="_parent" />');
+    // removed <base target="_parent" /> 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);
index b6eddbb5be6574de196a20adc769d4e4611b0785..2a665e58a9acde3e12f8dd61cdeb45c0ceb0f970 100644 (file)
@@ -2717,3 +2717,11 @@ wikiadminactions {
 /***
  *** Modules: Workshop
  ***/
+.redfont {
+  color: red;
+}
+
+.workshopuploadform,
+.workshopkey {
+  text-align:center;  
+}
\ No newline at end of file