]> git.mjollnir.org Git - moodle.git/commitdiff
mod/exercise: HTML fixes
authormattc-catalyst <mattc-catalyst>
Mon, 16 Apr 2007 23:20:39 +0000 (23:20 +0000)
committermattc-catalyst <mattc-catalyst>
Mon, 16 Apr 2007 23:20:39 +0000 (23:20 +0000)
Fixed errors in HTML causing parser errors in Firefox when in developers
debug mode.

Author: Matt Clarkson <mattc@catalyst.net.nz>

mod/exercise/assessments.php
mod/exercise/lib.php
mod/exercise/view.php

index 9b07dd2ef48c8aaba8b124b295bdf584d8bd9fe1..5985b2fa37a26cbbd867803e52e58305e6277bf6 100644 (file)
                 for ($i=0; $i<$exercise->nelements; $i++) {
                     $iplus1 = $i+1;
                     echo "<tr valign=\"top\">\n";
-                    echo "  <td align=\"right\"><p><b>". get_string("element","exercise")." $iplus1:</b></td>\n";
+                    echo "  <td align=\"right\"><p><b>". get_string("element","exercise")." $iplus1:</b></p></td>\n";
                     echo "<td><textarea name=\"description[]\" rows=\"3\" cols=\"75\" wrap=\"virtual\">".
                         $elements[$i]->description."</textarea>\n";
                     echo "  </td></tr>\n";
                 for ($i=0; $i<$exercise->nelements; $i++) {
                     $iplus1 = $i+1;
                     echo "<tr valign=\"top\">\n";
-                    echo "  <td align=\"right\"><p><b>". get_string("element","exercise")." $iplus1:</b></td>\n";
+                    echo "  <td align=\"right\"><p><b>". get_string("element","exercise")." $iplus1:</b></p></td>\n";
                     echo "<td><textarea name=\"description[]\" rows=\"3\" cols=\"75\" wrap=\"virtual\">".
                         $elements[$i]->description."</textarea>\n";
                     echo "  </td></tr>\n";
                     if ($elements[$i]->weight == '') { // not set
                         $elements[$i]->weight = 11; // unity
                     }
-                    echo "</tr>\n";
+                    echo "</td></tr>\n";
                     echo "<tr valign=\"top\"><td align=\"right\"><b>".get_string("elementweight", "exercise").
                         ":</b></td><td>\n";
                     exercise_choose_from_menu($EXERCISE_EWEIGHTS, "weight[]", $elements[$i]->weight, "");
                 for ($i=0; $i<$exercise->nelements; $i++) {
                     $iplus1 = $i+1;
                     echo "<tr valign=\"top\">\n";
-                    echo "  <td align=\"right\"><p><b>". get_string("element","exercise")." $iplus1:</b></td>\n";
+                    echo "  <td align=\"right\"><p><b>". get_string("element","exercise")." $iplus1:</b></p></td>\n";
                     echo "<td><textarea name=\"description[$i]\" rows=\"3\" cols=\"75\" wrap=\"virtual\">".
                         $elements[$i]->description."</textarea>\n";
                     echo "  </td></tr>\n";
                     echo "</tr>\n";
                 }
                 echo "</center></table><br />\n";
-                echo "<p><center><b>".get_string("gradetable","exercise")."</b></center>\n";
+                echo "<p><center><b>".get_string("gradetable","exercise")."</b></p></center>\n";
                 echo "<center><table cellpadding=\"5\" border=\"1\"><tr><td align=\"CENTER\">".
                     get_string("numberofnegativeresponses", "exercise");
                 echo "</td><td>". get_string("suggestedgrade", "exercise")."</td></tr>\n";
                     $iplus1 = $i+1;
                     echo "<tr valign=\"top\">\n";
 
-                    echo "  <td align=\"right\"><p><b>". get_string("criterion","exercise")." $iplus1:</b></td>\n";
+                    echo "  <td align=\"right\"><p><b>". get_string("criterion","exercise")." $iplus1:</b></p></td>\n";
                     echo "<td><textarea name=\"description[$i]\" rows=\"3\" cols=\"75\" wrap=\"virtual\">".
                         $elements[$i]->description."</textarea>\n";
                     echo "  </td></tr>\n";
                 for ($i=0; $i<$exercise->nelements; $i++) {
                     $iplus1 = $i+1;
                     echo "<tr valign=\"top\">\n";
-                    echo "  <td align=\"right\"><p><b>". get_string("element","exercise")." $iplus1:</b></td>\n";
+                    echo "  <td align=\"right\"><p><b>". get_string("element","exercise")." $iplus1:</b></p></td>\n";
                     echo "<td><textarea name=\"description[$i]\" rows=\"3\" cols=\"75\" wrap=\"virtual\">".
                         $elements[$i]->description."</textarea>\n";
                     echo "  </td></tr>\n";
                             $rubrics[$i][$j] = "";
                         }
                         echo "<tr valign=\"top\">\n";
-                        echo "  <td align=\"right\"><p><b>". get_string("grade")." $j:</b></td>\n";
+                        echo "  <td align=\"right\"><p><b>". get_string("grade")." $j:</b></p></td>\n";
                         echo "<td><textarea name=\"rubric[$i][$j]\" rows=\"3\" cols=\"75\" wrap=\"virtual\">".
                             $rubrics[$i][$j]."</textarea>\n";
                         echo "  </td></tr>\n";
                     error("Could not insert exercise element!");
                 }
                 $grade = ($elements[intval($error + 0.5)]->maxscore + $form->grade[$i]) * 100 / $exercise->grade;
-                echo "<p><b>".get_string("weightederrorcount", "exercise", intval($error + 0.5))."</b>\n";
+                echo "<p><b>".get_string("weightederrorcount", "exercise", intval($error + 0.5))."</b></p>\n";
                 break;
 
             case 3: // criteria grading
index 1ccb278a58a1d68abe888e82753c39c9b5e4dff7..f7f1319bc974d6387cc0b6696985f94bb5402aef 100644 (file)
@@ -101,7 +101,7 @@ function exercise_choose_from_menu ($options, $name, $selected="", $nothing="cho
         $javascript = "";
     }
 
-    $output = "<select name=$name $javascript>\n";
+    $output = "<select name=\"$name\" $javascript>\n";
     if ($nothing) {
         $output .= "   <option value=\"$nothingvalue\"\n";
         if ($nothingvalue == $selected) {
index ef863befbff6a151aa34cec9ebbc356f16c7e1b4..f4a9d1c29a4752ded0d002c7479c775114af6aa4 100644 (file)
                 }
             }
         }
-        echo "</table><br clear=\"all\" />\n";
+        echo "</table></center><br clear=\"all\" />\n";
         if ($exercise->showleaguetable) {
             exercise_print_league_table($exercise);
         }
         // show student's assessment (linked to the teacher's exercise/submission
         print_heading(get_string("yourassessment", "exercise"));
         exercise_list_teacher_submissions($exercise, $USER);
-        echo "<hr size=\"1\" noshade>";
+        echo "<hr size=\"1\" noshade=\"noshade\" />";
         if ($submissions = exercise_get_user_submissions($exercise, $USER)) {
             print_heading(get_string("yoursubmission", "exercise"));
             print_simple_box_start("center");
         // always allow student to resubmit
         if (exercise_test_for_resubmission($exercise, $USER)) {
             // if resubmission requested print upload form
-            echo "<hr size=\"1\" noshade>";
+            echo "<hr size=\"1\" noshade=\"noshade\" />";
             print_heading(get_string("pleasesubmityourwork", "exercise").":");
             exercise_print_upload_form($exercise);
         }
-        echo "<hr size=\"1\" noshade>";
+        echo "<hr size=\"1\" noshade=\"noshade\" />";
     }
 
 
             // may resubmit if allowed
             else {
                 exercise_list_teacher_submissions($exercise, $USER);
-                echo "<hr size=\"1\" noshade>";
+                echo "<hr size=\"1\" noshade=\"noshade\" />";
                 print_heading(get_string("yoursubmission", "exercise"));
                 exercise_list_user_submissions($exercise, $USER);
                 if (exercise_test_for_resubmission($exercise, $USER)) {
                     // if resubmission requested print upload form
-                    echo "<hr size=\"1\" noshade>";
+                    echo "<hr size=\"1\" noshade=\"noshade\" />";
                     print_heading(get_string("pleasesubmityourwork", "exercise").":");
                     exercise_print_upload_form($exercise);
-                    echo "<hr size=\"1\" noshade>";
+                    echo "<hr size=\"1\" noshade=\"noshade\" />";
                 }
             }
         }
         // list previous submissions from this user
         exercise_list_user_submissions($exercise, $USER);
 
-        echo "<hr size=\"1\" NOSHADE>";
+        echo "<hr size=\"1\" noshade=\"noshade\" />";
 
         // print upload form
         print_heading(get_string("submitexercisedescription", "exercise").":");
                 case 1: // set up assignment
                     if (isteacheredit($course->id)) {
                         echo "<p><b><a href=\"assessments.php?id=$cm->id&amp;action=editelements\">".
-                            get_string("amendassessmentelements", "exercise")."</a></b> \n";
+                            get_string("amendassessmentelements", "exercise")."</a></b></p> \n";
                         helpbutton("elements", get_string("amendassessmentelements", "exercise"), "exercise");
                         echo "<p><b><a href=\"view.php?id=$cm->id&amp;action=submitassignment\">".
-                            get_string("submitexercisedescription", "exercise")."</a></b> \n";
+                            get_string("submitexercisedescription", "exercise")."</a></b></p> \n";
                         helpbutton("submissionofdescriptions", get_string("submitexercisedescription", "exercise"), "exercise");
                     }
                     break;
                     // the submissions
                     echo "<p><b><a href=\"submissions.php?id=$cm->id&amp;action=listforassessmentstudent\">".
                           get_string("studentsubmissionsforassessment", "exercise",
-                          exercise_count_unassessed_student_submissions($exercise))."</a></b> \n";
+                          exercise_count_unassessed_student_submissions($exercise))."</a></b></p> \n";
                     helpbutton("grading", get_string("studentsubmissionsforassessment", "exercise"),
                             "exercise");
                     break;
                 case 3: // show final grades
                     echo "<p><b><a href=\"submissions.php?id=$cm->id&amp;action=listforassessmentstudent\">".
                           get_string("studentsubmissionsforassessment", "exercise",
-                          exercise_count_unassessed_student_submissions($exercise))."</a></b> \n";
+                          exercise_count_unassessed_student_submissions($exercise))."</a></b></p> \n";
                     helpbutton("grading", get_string("studentsubmissionsforassessment", "exercise"),
                             "exercise");
                     print_heading("<a href=\"submissions.php?id=$cm->id&amp;action=displayfinalgrades\">".
         }
         print_heading("<a href=\"submissions.php?id=$cm->id&amp;action=adminlist\">".
             get_string("administration")."</a>");
+       echo "</center>\n";
     }