From: toyomoyo Date: Wed, 3 Jan 2007 07:29:51 +0000 (+0000) Subject: MDL-7861, fixing various xhtml strict issues and formatting X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e8e76f5a160139b303e1d151f258668f2c2fa89f;p=moodle.git MDL-7861, fixing various xhtml strict issues and formatting --- diff --git a/mod/lesson/action/addpage.php b/mod/lesson/action/addpage.php index 5fd2891f30..3f7ba74e25 100644 --- a/mod/lesson/action/addpage.php +++ b/mod/lesson/action/addpage.php @@ -138,7 +138,7 @@ echo "\n"; } if ($i == 2) { - echo "".get_string("correctanswerjump", "lesson").": \n"; + echo "".get_string("correctanswerjump", "lesson").": \n"; choose_from_menu($jump, "jumpto[$i]", LESSON_NEXTPAGE, ""); helpbutton("jumpto", get_string("jump", "lesson"), "lesson"); if($lesson->custom) { @@ -146,7 +146,7 @@ } echo "\n"; } elseif ($i == 3) { - echo "".get_string("wronganswerjump", "lesson").": \n"; + echo "".get_string("wronganswerjump", "lesson").": \n"; choose_from_menu($jump, "jumpto[$i]", 0, ""); helpbutton("jumpto", get_string("jump", "lesson"), "lesson"); if($lesson->custom) { diff --git a/mod/lesson/action/editpage.php b/mod/lesson/action/editpage.php index df96527d53..10efe0ef55 100644 --- a/mod/lesson/action/editpage.php +++ b/mod/lesson/action/editpage.php @@ -231,7 +231,7 @@ print_textarea(false, 6, 70, 630, 300, "response[$n]", $answer->response); } } - echo "\n"; + echo "wtf\n"; break; case LESSON_TRUEFALSE: case LESSON_MULTICHOICE: @@ -302,15 +302,17 @@ helpbutton("jumpto", get_string("jump", "lesson"), "lesson"); if($lesson->custom) echo get_string("correctanswerscore", "lesson").": score\" size=\"5\" />"; - } + echo "\n"; + } if ($n == 3) { echo "".get_string("wronganswerjump", "lesson").": \n"; choose_from_menu($jump, "jumpto[$n]", $answer->jumpto, ""); helpbutton("jumpto", get_string("jump", "lesson"), "lesson"); if($lesson->custom) echo get_string("wronganswerscore", "lesson").": score\" size=\"5\" />"; - } - echo "\n"; + echo "\n"; + } + //echo "\n"; break; case LESSON_ESSAY : echo "".get_string("jump", "lesson").": \n"; @@ -430,18 +432,21 @@ echo "".get_string("correctanswerjump", "lesson").": \n"; choose_from_menu($jump, "jumpto[$i]", $answer->jumpto, ""); helpbutton("jumpto", get_string("jump", "lesson"), "lesson"); - if($lesson->custom) + if ($lesson->custom) { echo get_string("correctanswerscore", "lesson").": score\" size=\"5\" />"; } + echo "\n"; + } if ($i == 3) { echo "".get_string("wronganswerjump", "lesson").": \n"; choose_from_menu($jump, "jumpto[$i]", $answer->jumpto, ""); helpbutton("jumpto", get_string("jump", "lesson"), "lesson"); - if($lesson->custom) + if ($lesson->custom) { echo get_string("wronganswerscore", "lesson").": score\" size=\"5\" />"; } + echo "\n"; + } - echo "\n"; break; case LESSON_TRUEFALSE: case LESSON_MULTICHOICE: diff --git a/mod/lesson/view.php b/mod/lesson/view.php index a566029270..fe94dc6cab 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -323,7 +323,6 @@ } } } - if ($pageid != LESSON_EOL) { /// This is the code updates the lessontime for a timed test if ($startlastseen = optional_param('startlastseen', '', PARAM_ALPHA)) { /// this deletes old records not totally sure if this is necessary anymore @@ -539,6 +538,7 @@ $options = new stdClass; $options->para = false; // no

$options->noclean = true; + // echo "qtype is $page->qtype"; // debug switch ($page->qtype) { case LESSON_SHORTANSWER : case LESSON_NUMERICAL : @@ -549,7 +549,7 @@ } echo ''. ": \n"; - echo ''; + echo ''; print_simple_box_end(); lesson_print_submit_link(get_string('pleaseenteryouranswerinthebox', 'lesson'), 'answerform'); break; @@ -630,14 +630,15 @@ $responses[] = trim($answer->response); } } - shuffle($responses); - $responses = array_unique($responses); $responseoptions = array(); - foreach ($responses as $response) { - $responseoptions[htmlspecialchars(trim($response))] = $response; + if (!empty($responses)) { + shuffle($responses); + $responses = array_unique($responses); + foreach ($responses as $response) { + $responseoptions[htmlspecialchars(trim($response))] = $response; + } } - if (isset($USER->modattempts[$lesson->id])) { $useranswers = explode(',', $attempt->useranswer); $t = 0; @@ -662,12 +663,11 @@ } } } - echo ''; + echo ''; print_simple_box_end(); lesson_print_submit_link(get_string('pleasematchtheabovepairs', 'lesson'), 'answerform'); break; - case LESSON_BRANCHTABLE : - echo ''; + case LESSON_BRANCHTABLE : $options = new stdClass; $options->para = false; $buttons = array('next' => array(), 'prev' => array(), 'other' => array()); @@ -733,12 +733,16 @@ } else { $value = ""; } - echo ':'. + echo ':'. '\n"; echo ''; print_simple_box_end(); lesson_print_submit_link(get_string('pleaseenteryouranswerinthebox', 'lesson'), 'answerform'); break; + default: // close the tags MDL-7861 + echo (''); + print_simple_box_end(); + break; } echo "\n"; } else {