From: vyshane Date: Thu, 11 Jan 2007 08:51:46 +0000 (+0000) Subject: xhtml fixes for MDL-7861. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4085962ae95594d4ef32eace46069240aae48585;p=moodle.git xhtml fixes for MDL-7861. --- diff --git a/mod/lesson/action/addbranchtable.php b/mod/lesson/action/addbranchtable.php index 931978344b..afd31463b1 100644 --- a/mod/lesson/action/addbranchtable.php +++ b/mod/lesson/action/addbranchtable.php @@ -36,28 +36,29 @@ // give teacher a blank proforma print_heading_with_help(get_string("addabranchtable", "lesson"), "overview", "lesson"); ?> -
+ +
-
+
+ \n"; echo "\n"; for ($i = 0; $i < $lesson->maxanswers; $i++) { $iplus1 = $i + 1; @@ -80,5 +81,5 @@

-
"; - echo get_string("pagecontents", "lesson").":
\n"; + echo "
"; + echo get_string("pagecontents", "lesson").":
\n"; print_textarea($usehtmleditor, 25,70, 630, 400, "contents"); use_html_editor("contents"); echo "
\n"; - echo "
"; + echo "
"; echo get_string("arrangebuttonshorizontally", "lesson")."\n"; echo "
"; echo get_string("displayinleftmenu", "lesson"); - echo "
\n"; + echo "\n"; echo "

" /> " /> -
+
diff --git a/mod/lesson/action/addpage.php b/mod/lesson/action/addpage.php index a5d6ec9e48..e6ef9ef1c2 100644 --- a/mod/lesson/action/addpage.php +++ b/mod/lesson/action/addpage.php @@ -46,12 +46,12 @@ // give teacher a blank proforma print_heading_with_help(get_string("addaquestionpage", "lesson"), "overview", "lesson"); ?> -
+ +
-
'.get_string("questiontype", "lesson").": \n"; echo helpbutton("questiontypes", get_string("questiontype", "lesson"), "lesson")."
"; @@ -70,10 +70,10 @@ echo '

'; } ?> - +
+

-
"; echo get_string("pagecontents", "lesson").":
\n"; @@ -193,5 +193,5 @@

" /> " /> -
+
diff --git a/mod/lesson/action/editpage.php b/mod/lesson/action/editpage.php index da4f303da0..35e85eddb6 100644 --- a/mod/lesson/action/editpage.php +++ b/mod/lesson/action/editpage.php @@ -473,7 +473,7 @@ ?>
" - onClick="getElementById('editpage').redisplay.value=1;getElementById('editpage').submit();" /> + onclick="getElementById('editpage').redisplay.value=1;getElementById('editpage').submit();" /> " /> " /> diff --git a/mod/lesson/edit.php b/mod/lesson/edit.php index 99ba5cac10..82d17558f9 100644 --- a/mod/lesson/edit.php +++ b/mod/lesson/edit.php @@ -102,7 +102,7 @@ $pages[$singlepage->id] = $singlepage; case 'full': - echo ' + echo '
'; lesson_print_add_links($cm->id, $prevpageid); @@ -113,7 +113,7 @@ $page = $pages[$pageid]; echo "
\n"; - echo "
".format_string($page->title)."  \n"; + echo "\n"; echo "\n"; // get the answers in a set order, the id order if ($answers = get_records("lesson_answers", "pageid", $page->id, "id")) { - echo "\n"; + echo "\n"; $i = 1; $n = 0; $options = new stdClass; @@ -152,26 +152,26 @@ case LESSON_TRUEFALSE: case LESSON_SHORTANSWER: case LESSON_NUMERICAL: - echo "\n"; - echo "\n"; @@ -180,12 +180,12 @@ if ($n < 2) { if ($answer->answer != NULL) { if ($n == 0) { - echo "\n"; } else { - echo "\n"; @@ -194,35 +194,35 @@ $n++; $i--; } else { - echo "\n"; - echo "\n"; } break; case LESSON_BRANCHTABLE: - echo "\n"; break; @@ -231,18 +231,18 @@ $jumptitle = lesson_get_jump_name($answer->jumpto); if ($page->qtype == LESSON_MATCHING) { if ($i == 1) { - echo "\n"; - echo "\n"; } elseif ($i == 2) { - echo "\n"; - echo "\n"; } } else { @@ -251,12 +251,12 @@ $page->qtype != LESSON_ENDOFBRANCH and $page->qtype != LESSON_CLUSTER and $page->qtype != LESSON_ENDOFCLUSTER) { - echo "\n"; } - echo "\n"; } $i++; diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 4c074bc670..dad672e581 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -245,12 +245,15 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '') { $button = '
".format_string($page->title)."  \n"; lesson_print_page_actions($cm->id, $page, $npages); echo "
\n"; @@ -123,7 +123,7 @@ echo "
\n"; + echo "
\n"; echo lesson_get_qtype_name($page->qtype); switch ($page->qtype) { case LESSON_SHORTANSWER : @@ -140,7 +140,7 @@ echo get_string("firstanswershould", "lesson"); break; } - echo "
\n"; + echo "
\n"; if ($lesson->custom) { // if the score is > 0, then it is correct if ($answer->score > 0) { - echo "".get_string("answer", "lesson")." $i: \n"; + echo ''.get_string("answer", "lesson")." $i: \n"; } else { - echo "".get_string("answer", "lesson")." $i: \n"; + echo ''.get_string("answer", "lesson")." $i: \n"; } } else { if (lesson_iscorrect($page->id, $answer->jumpto)) { // underline correct answers - echo "".get_string("answer", "lesson")." $i: \n"; + echo ''.get_string("answer", "lesson")." $i: \n"; } else { - echo "".get_string("answer", "lesson")." $i: \n"; + echo ''.get_string("answer", "lesson")." $i: \n"; } } - echo "\n"; + echo "\n"; echo format_text($answer->answer, FORMAT_MOODLE, $options); echo "
".get_string("response", "lesson")." $i: \n"; + echo "
".get_string("response", "lesson")." $i: \n"; echo "\n"; echo format_text($answer->response, FORMAT_MOODLE, $options); echo "
".get_string("correctresponse", "lesson").": \n"; + echo "
".get_string("correctresponse", "lesson").": \n"; echo "\n"; echo format_text($answer->answer, FORMAT_MOODLE, $options); echo "
".get_string("wrongresponse", "lesson").": \n"; + echo "
".get_string("wrongresponse", "lesson").": \n"; echo "\n"; echo format_text($answer->answer, FORMAT_MOODLE, $options); echo "
\n"; + echo "
\n"; if ($lesson->custom) { // if the score is > 0, then it is correct if ($answer->score > 0) { - echo "".get_string("answer", "lesson")." $i: \n"; + echo ''.get_string("answer", "lesson")." $i: \n"; } else { - echo "".get_string("answer", "lesson")." $i: \n"; + echo ''.get_string("answer", "lesson")." $i: \n"; } } else { if (lesson_iscorrect($page->id, $answer->jumpto)) { // underline correct answers - echo "".get_string("answer", "lesson")." $i: \n"; + echo ''.get_string("answer", "lesson")." $i: \n"; } else { - echo "".get_string("answer", "lesson")." $i: \n"; + echo ''.get_string("answer", "lesson")." $i: \n"; } } - echo "\n"; + echo "\n"; echo format_text($answer->answer, FORMAT_MOODLE, $options); echo "
".get_string("matchesanswer", "lesson")." $i: \n"; + echo "
''.".get_string("matchesanswer", "lesson")." $i: \n"; echo "\n"; echo format_text($answer->response, FORMAT_MOODLE, $options); echo "
\n"; - echo "".get_string("description", "lesson")." $i: \n"; - echo "\n"; + echo "
\n"; + echo ''.get_string("description", "lesson")." $i: \n"; + echo "\n"; echo format_text($answer->answer, FORMAT_MOODLE, $options); echo "
".get_string("correctanswerscore", "lesson").":"; - echo "\n"; + echo "
".get_string("correctanswerscore", "lesson"); + echo ": \n"; echo "$answer->score
".get_string("correctanswerjump", "lesson").":"; - echo "\n"; + echo "
".get_string("correctanswerjump", "lesson"); + echo ":\n"; echo "$jumptitle
".get_string("wronganswerscore", "lesson").":"; - echo "\n"; + echo "
".get_string("wronganswerscore", "lesson"); + echo ": \n"; echo "$answer->score
".get_string("wronganswerjump", "lesson").":"; - echo "\n"; + echo "
".get_string("wronganswerjump", "lesson"); + echo ": \n"; echo "$jumptitle
".get_string("score", "lesson")." $i:"; - echo "\n"; + echo "
".get_string("score", "lesson")." $i"; + echo ": \n"; echo "$answer->score
".get_string("jump", "lesson")." $i:"; - echo "\n"; + echo "
".get_string("jump", "lesson")." $i"; + echo ": \n"; echo "$jumptitle
'.$button. ''. '
frametarget.' method="get" action="'. $CFG->wwwroot .'/mod/lesson/lesson.php">'. + '
'. ''. ''. ''. ''. - ' -
'; + ''. + ''. + ''. + '
'; } } } else { @@ -401,7 +404,7 @@ function lesson_print_messages() { **/ function lesson_print_submit_link($name, $form, $align = 'center', $class='standardbutton', $title = '', $id = '', $return = false) { if (!empty($align)) { - $align = " align=\"$align\""; + $align = " style=\"text-align:$align\""; } if (!empty($id)) { $id = " id=\"$id\""; @@ -1593,7 +1596,7 @@ function lesson_qtype_menu($qtypes, $selected="", $link="", $onclick="") { $tabrows = array(); foreach ($qtypes as $qtype => $qtypename) { - $tabrows[] = new tabobject($qtype, "$link&qtype=$qtype\" onClick=\"$onclick", $qtypename); + $tabrows[] = new tabobject($qtype, "$link&qtype=$qtype\" onclick=\"$onclick", $qtypename); } $tabs[] = $tabrows; print_tabs($tabs, $selected); @@ -1700,7 +1703,7 @@ function lesson_print_progress_bar($lesson, $course) { echo '
'; echo ''; if ($progress != 0) { // some browsers do not repsect the 0 width. - echo ''; } echo '
'; + echo ''; echo ''; diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 113c6fb8d2..76102c01b4 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -36,7 +36,7 @@ lesson_print_header($cm, $course, $lesson); print_simple_box_start('center'); - echo '
'; + echo ''; @@ -62,6 +62,7 @@ echo "
\n"; print_simple_box_start('center'); echo '
' . "\n"; + echo '
'; echo '' . "\n"; if (optional_param('userpassword', 0, PARAM_CLEAN)) { notify(get_string('loginfail', 'lesson')); @@ -141,7 +142,7 @@ echo '

'; print_simple_box_start('center'); print_string('completethefollowingconditions', 'lesson', $dependentlesson->name); - echo '

'.implode('
'.get_string('and', 'lesson').'
', $errors).'

'; + echo '

'.implode('
'.get_string('and', 'lesson').'
', $errors).'

'; print_simple_box_end(); echo '

'; print_footer($course); @@ -250,13 +251,13 @@ lesson_print_header($cm, $course, $lesson); if ($lesson->timed) { if ($lesson->retake) { - print_simple_box('

'. get_string('leftduringtimed', 'lesson') .'

', 'center'); - echo '
'. + print_simple_box('

'. get_string('leftduringtimed', 'lesson') .'

', 'center'); + echo ''; } else { print_simple_box_start('center'); - echo '
'; + echo '
'; echo get_string('leftduringtimednoretake', 'lesson'); echo '

'; echo '
'; @@ -264,10 +265,10 @@ } } else { - print_simple_box("

".get_string('youhaveseen','lesson').'

', + print_simple_box("

".get_string('youhaveseen','lesson').'

', "center"); - echo '
'; + echo '
'; echo ''. ''. get_string('yes').'   '; @@ -288,7 +289,7 @@ if (!$lesson->retake) { lesson_print_header($cm, $course, $lesson, 'view'); print_simple_box_start('center'); - echo "
"; + echo "
"; echo get_string("noretake", "lesson"); echo "

'; echo "
"; @@ -524,6 +525,7 @@ // get the answers in a set order, the id order if ($answers = get_records("lesson_answers", "pageid", $page->id, "id")) { echo ""; + echo '
'; echo "id\" />"; echo ""; echo ""; @@ -547,7 +549,7 @@ } else { $value = ""; } - echo '
'. + echo '
'. ": \n"; echo '
'; print_simple_box_end(); @@ -686,12 +688,14 @@ } // Each button must have its own form inorder for it to work with JavaScript turned off $button = "wwwroot/mod/lesson/lesson.php\">\n". + '
'; "id\" />\n". "\n". "\n". "\n". "jumpto\" />\n". lesson_print_submit_link(strip_tags(format_text($answer->answer, FORMAT_MOODLE, $options)), "answerform$i", '', $class, '', '', true). + '
'. ''; $buttons[$type][] = $button; @@ -733,7 +737,7 @@ } else { $value = ""; } - echo '
:'. + echo '
:'. '\n"; echo '
'; print_simple_box_end(); @@ -744,10 +748,12 @@ print_simple_box_end(); break; } + echo ''; echo "\n"; } else { // a page without answers - find the next (logical) page echo "
wwwroot/mod/lesson/view.php\">\n"; + echo '
'; echo "id\" />\n"; if ($lesson->nextpagedefault) { // in Flash Card mode... @@ -795,6 +801,7 @@ } echo "\n"; lesson_print_submit_link(get_string('continue', 'lesson'), 'pageform'); + echo '
'; echo "
\n"; } @@ -837,16 +844,16 @@ if ($gradeinfo->attempts) { if (!$lesson->custom) { - echo "

".get_string("numberofpagesviewed", "lesson", $gradeinfo->nquestions). + echo "

".get_string("numberofpagesviewed", "lesson", $gradeinfo->nquestions). "

\n"; if ($lesson->minquestions) { if ($gradeinfo->nquestions < $lesson->minquestions) { // print a warning and set nviewed to minquestions - echo "

".get_string("youshouldview", "lesson", + echo "

".get_string("youshouldview", "lesson", $lesson->minquestions)."

\n"; } } - echo "

".get_string("numberofcorrectanswers", "lesson", $gradeinfo->earned). + echo "

".get_string("numberofcorrectanswers", "lesson", $gradeinfo->earned). "

\n"; } $a = new stdClass; @@ -855,14 +862,14 @@ if ($gradeinfo->nmanual) { $a->tempmaxgrade = $gradeinfo->total - $gradeinfo->manualpoints; $a->essayquestions = $gradeinfo->nmanual; - echo "
".get_string("displayscorewithessays", "lesson", $a)."
"; + echo "
".get_string("displayscorewithessays", "lesson", $a)."
"; } else { - echo "
".get_string("displayscorewithoutessays", "lesson", $a)."
"; + echo "
".get_string("displayscorewithoutessays", "lesson", $a)."
"; } $a = new stdClass; $a->grade = number_format($gradeinfo->grade * $lesson->grade / 100, 1); $a->total = $lesson->grade; - echo "

".get_string('yourcurrentgradeisoutof', 'lesson', $a)."

\n"; + echo "

".get_string('yourcurrentgradeisoutof', 'lesson', $a)."

\n"; $grade->lessonid = $lesson->id; $grade->userid = $USER->id; @@ -909,7 +916,7 @@ } } else { // display for teacher - echo "

".get_string("displayofgrade", "lesson")."

\n"; + echo "

".get_string("displayofgrade", "lesson")."

\n"; } print_simple_box_end(); //End of Lesson button to Continue. @@ -921,7 +928,7 @@ // high scores code if ($lesson->highscores && !has_capability('mod/lesson:manage', $context) && !$lesson->practice) { - echo "

"; + echo "

"; if ($grades = get_records_select("lesson_grades", "lessonid = $lesson->id", "completed")) { $madeit = false; if ($highscores = get_records_select("lesson_high_scores", "lessonid = $lesson->id")) { @@ -943,14 +950,16 @@ } if (!$highscores or $madeit) { echo '

'.get_string("youmadehighscore", "lesson", $lesson->maxhighscores). - '

+ '

+

'; lesson_print_submit_link(get_string('clicktopost', 'lesson'), 'highscores'); echo '

+
'; } else { echo get_string("nothighscore", "lesson", $lesson->maxhighscores)."
"; @@ -974,24 +983,24 @@ // sure that the student can leave the lesson via pushing the continue button. $lastattempt = end($attempts); $USER->modattempts[$lesson->id] = $lastattempt->pageid; - echo "\n"; + echo "\n"; } elseif ($lesson->modattempts && has_capability('mod/lesson:manage', $context)) { - echo "

".get_string("modattemptsnoteacher", "lesson")."

"; + echo "

".get_string("modattemptsnoteacher", "lesson")."

"; } if ($lesson->activitylink) { if ($module = get_record('course_modules', 'id', $lesson->activitylink)) { if ($modname = get_field('modules', 'name', 'id', $module->module)) if ($instance = get_record($modname, 'id', $module->instance)) { - echo "