From: mark-nielsen Date: Sun, 8 Apr 2007 21:02:16 +0000 (+0000) Subject: Merging in fixes for MDL-8414 and MDL-9250 from MOODLE_18_STABLE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=362f2ce9738fb3b90f409da869e044eb6154e17a;p=moodle.git Merging in fixes for MDL-8414 and MDL-9250 from MOODLE_18_STABLE --- diff --git a/mod/lesson/action/editpage.php b/mod/lesson/action/editpage.php index 8188f43645..dbf4760593 100644 --- a/mod/lesson/action/editpage.php +++ b/mod/lesson/action/editpage.php @@ -130,15 +130,15 @@ } else { echo ""; } - echo get_string("arrangebuttonshorizontally", "lesson")."
\n"; + echo get_string("arrangebuttonshorizontally", "lesson")."\n"; echo "
"; if ($page->display) { - echo "
"; + echo ""; } else { - echo "
"; + echo ""; } - echo get_string("displayinleftmenu", "lesson")."
\n"; - echo "\n"; + echo get_string("displayinleftmenu", "lesson")."\n"; + echo "
\n"; echo "".get_string("branchtable", "lesson")." \n"; break; case LESSON_CLUSTER : @@ -157,7 +157,7 @@ echo ""; break; } - // xhtml bug here + echo "\n"; // get the answers in a set order, the id order diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 8162eb0780..4a0211bff9 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -1258,7 +1258,7 @@ function lesson_unseen_question_jump($lesson, $user, $pageid) { * @param int $userid User id. * @return int Will return the page id of a branch table or end of lesson **/ -function lesson_unseen_branch_jump($lesson, $userid) { +function lesson_unseen_branch_jump($lessonid, $userid) { if (!$retakes = count_records("lesson_grades", "lessonid", $lessonid, "userid", $userid)) { $retakes = 0; } diff --git a/mod/lesson/styles.php b/mod/lesson/styles.php index 9d19bb3cb7..a195aa7e5d 100644 --- a/mod/lesson/styles.php +++ b/mod/lesson/styles.php @@ -178,51 +178,17 @@ border-left: 2px solid #4a4a4a; } - -/*** - *** Use these to override lessonbutton class - *** Or just comment out all of lessonbutton class definitions and start from scratch below - ***/ - -/* for previous branch buttons only */ -.mod-lesson .previousbutton { -} - -/* for next branch buttons only */ -.mod-lesson .nextbutton { -} - -/* All other branch buttons */ -.mod-lesson .standardbutton { -} - -/* Next classes are for branch table buttons when displayed horizontally */ -.mod-lesson .prevhorizontal, -.mod-lesson .prevhorizontal div, -.mod-lesson .nexthorizontal, -.mod-lesson .nexthorizontal div, -.mod-lesson .standardhorizontal, -.mod-lesson .standardhorizontal div { +/* Branch table buttons when displayed horizontally */ +.mod-lesson .branchbuttoncontainer.horizontal div, +.mod-lesson .branchbuttoncontainer.horizontal form { display: inline; } -/* Next classes are for branch table buttons when displayed vertically */ -.mod-lesson .prevvertical .lessonbutton, -.mod-lesson .nextvertical .lessonbutton, -.mod-lesson .standardvertical .lessonbutton { +/* Branch table buttons when displayed vertically */ +.mod-lesson .branchbuttoncontainer.vertical .lessonbutton { padding: 5px; } -/* branchbuttoncontainer wraps around branch table buttons */ -.mod-lesson .branchbuttoncontainer { - text-align: center; - padding: 13px 3px 3px 3px; -} - -.mod-lesson .branchbuttoncontainer form { - display: inline; -} - /*** *** Lesson Progress Bar *** Default styles for this are very basic right now. diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 51cdcd1f23..d7723112b6 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -539,16 +539,14 @@ // 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 ""; - echo ""; - if (!$lesson->slideshow) { - if ($page->qtype != LESSON_BRANCHTABLE) { - print_simple_box_start("center"); - } + if ($page->qtype != LESSON_BRANCHTABLE) { // To fix XHTML problem (BT have their own forms) + echo ""; + echo '
'; + echo "id\" />"; + echo ""; + echo ""; + echo ""; + print_simple_box_start("center"); echo ''; } // default format text options @@ -687,20 +685,9 @@ case LESSON_BRANCHTABLE : $options = new stdClass; $options->para = false; - $buttons = array('next' => array(), 'prev' => array(), 'other' => array()); - /// seperate out next and previous jumps from the other jumps + $buttons = array(); $i = 0; foreach ($answers as $answer) { - if ($answer->jumpto == LESSON_NEXTPAGE) { - $type = 'next'; - $class = 'nextbutton'; - } else if ($answer->jumpto == LESSON_PREVIOUSPAGE) { - $type = 'prev'; - $class = 'prevbutton'; - } else { - $type = 'other'; - $class = 'standardbutton'; - } // Each button must have its own form inorder for it to work with JavaScript turned off $button = "wwwroot/mod/lesson/lesson.php\">\n". '
'. @@ -709,11 +696,11 @@ "\n". "\n". "jumpto\" />\n". - lesson_print_submit_link(strip_tags(format_text($answer->answer, FORMAT_MOODLE, $options)), "answerform$i", '', $class, '', '', true). + lesson_print_submit_link(strip_tags(format_text($answer->answer, FORMAT_MOODLE, $options)), "answerform$i", '', '', '', '', true). '
'. ''; - $buttons[$type][] = $button; + $buttons[] = $button; $i++; } @@ -724,10 +711,8 @@ $orientation = 'vertical'; } - $fullbuttonhtml = "\n
\n " . - "
".implode("\n", $buttons['prev']).'
'. - "
".implode("\n", $buttons['other']).'
'. - "
".implode("\n", $buttons['next']).'
'. + $fullbuttonhtml = "\n
\n" . + implode("\n", $buttons). "\n
\n"; if ($lesson->slideshow) { @@ -737,13 +722,7 @@ echo '
'; echo $fullbuttonhtml; } else { - echo '
'; // ends the answers table - // When buttons are horizontal and inside the table, the button then line wraps when clicked in FF. - // Seems like the border-collapse might be the problem? Easiest fix is to move the buttons outside - // of the table. - print_simple_box_start('center'); echo $fullbuttonhtml; - print_simple_box_end(); } break; @@ -765,11 +744,13 @@ print_simple_box_end(); break; } - echo '
'; - echo "\n"; + if ($page->qtype != LESSON_BRANCHTABLE) { // To fix XHTML problem (BT have their own forms) + echo '
'; + echo "\n"; + } } else { // a page without answers - find the next (logical) page - echo "
wwwroot/mod/lesson/view.php\">\n"; + echo "wwwroot/mod/lesson/view.php\">\n"; echo '
'; echo "id\" />\n"; if ($lesson->nextpagedefault) {