From c94d37997d480a92e90d27d65ab04d3d4095e709 Mon Sep 17 00:00:00 2001 From: mark-nielsen Date: Sun, 10 Sep 2006 18:41:38 +0000 Subject: [PATCH] Removed action set to navigation because view.php no longer uses action --- mod/lesson/action/continue.html | 9 +++------ mod/lesson/action/continue.php | 4 ++-- mod/lesson/action/updatepage.php | 4 ++-- mod/lesson/edit.php | 3 +-- mod/lesson/locallib.php | 2 +- mod/lesson/tabs.php | 2 +- mod/lesson/view.php | 28 ++++++++++++---------------- 7 files changed, 22 insertions(+), 30 deletions(-) diff --git a/mod/lesson/action/continue.html b/mod/lesson/action/continue.html index 0d66667099..309b86270c 100644 --- a/mod/lesson/action/continue.html +++ b/mod/lesson/action/continue.html @@ -57,9 +57,8 @@ if ($lesson->displayleft) { modattempts[$lesson->id])) { // User is modifying attempts - save button and some instructions ?> -
+ -

@@ -80,9 +79,8 @@ if ($lesson->displayleft) { review && !$correctanswer && !$noanswer && !$isessayquestion) { // Review button back ?> - + -

@@ -93,9 +91,8 @@ if ($lesson->displayleft) { - + - review && !$correctanswer && !$noanswer && !$isessayquestion) { // Review button continue ?> diff --git a/mod/lesson/action/continue.php b/mod/lesson/action/continue.php index 249c908853..abeb6d4d5e 100644 --- a/mod/lesson/action/continue.php +++ b/mod/lesson/action/continue.php @@ -37,7 +37,7 @@ if ((($timer->starttime + $lesson->maxtime * 60) - time()) <= 0) { // Out of time lesson_set_message(get_string('eolstudentoutoftime', 'lesson')); - redirect("view.php?id=$cm->id&action=navigation&pageid=".LESSON_EOL."&outoftime=normal", get_string("outoftime", "lesson")); + redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&pageid=".LESSON_EOL."&outoftime=normal", get_string("outoftime", "lesson")); } } @@ -557,7 +557,7 @@ $newpageid = lesson_unseen_branch_jump($lesson->id, $USER->id); } // no need to record anything in lesson_attempts - redirect("view.php?id=$cm->id&action=navigation&pageid=$newpageid"); + redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&pageid=$newpageid"); break; } diff --git a/mod/lesson/action/updatepage.php b/mod/lesson/action/updatepage.php index 3bc8c59940..732958c887 100644 --- a/mod/lesson/action/updatepage.php +++ b/mod/lesson/action/updatepage.php @@ -16,7 +16,7 @@ if (optional_param('cancel', '', PARAM_ALPHA)) { if ($redirect == 'navigation') { // redirect to viewing the page - redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&action=navigation&pageid=$page->id"); + redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&pageid=$page->id"); } else { redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id"); } @@ -172,7 +172,7 @@ redirect("$CFG->wwwroot/mod/lesson/lesson.php?id=$cm->id&action=editpage&pageid=$page->id&redirect=$redirect"); } else if ($redirect == 'navigation') { // takes us back to viewing the page - redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&action=navigation&pageid=$page->id", get_string('updatedpage', 'lesson')); + redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&pageid=$page->id", get_string('updatedpage', 'lesson')); } else { redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id", get_string('updatedpage', 'lesson')); } diff --git a/mod/lesson/edit.php b/mod/lesson/edit.php index 1949797476..a51f7d9d7c 100644 --- a/mod/lesson/edit.php +++ b/mod/lesson/edit.php @@ -55,9 +55,8 @@ echo ''; } else { // print the pages - echo "\n"; + echo "wwwroot/mod/lesson/view.php\">\n"; echo "id\" />\n"; - echo "\n"; echo "\n"; $branch = false; $singlePage = false; diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 10aeefb869..f6e7dc7d49 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -1357,7 +1357,7 @@ function lesson_print_tree_link_menu($page, $id, $showpages=false) { $output .= '

  • '; - $output .= "id\">".format_string($page->title,true)."\n"; + $output .= "id\">".format_string($page->title,true)."\n"; $output .= "
  • "; diff --git a/mod/lesson/tabs.php b/mod/lesson/tabs.php index 9536227c82..f13ff3a5aa 100644 --- a/mod/lesson/tabs.php +++ b/mod/lesson/tabs.php @@ -35,7 +35,7 @@ $counts->attempts = count_records('lesson_grades', 'lessonid', $lesson->id); $counts->student = $course->student; - $row[] = new tabobject('view', "$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&action=navigation", get_string('preview', 'lesson'), get_string('previewlesson', 'lesson', format_string($lesson->name))); + $row[] = new tabobject('view', "$CFG->wwwroot/mod/lesson/view.php?id=$cm->id", get_string('preview', 'lesson'), get_string('previewlesson', 'lesson', format_string($lesson->name))); $row[] = new tabobject('edit', "$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id", get_string('edit'), get_string('editlesson', 'lesson', format_string($lesson->name))); $row[] = new tabobject('reports', "$CFG->wwwroot/mod/lesson/report.php?id=$cm->id", get_string('reports', 'lesson'), get_string('viewreports', 'lesson', $counts)); if (has_capability('mod/lesson:edit', $context)) { diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 5f04b50dcf..8e91b56708 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -52,28 +52,25 @@ print_footer($course); exit(); - } else if ($lesson->usepassword) { // Password protected lesson code + } else if ($lesson->usepassword and empty($USER->lessonloggedin[$lesson->id])) { // Password protected lesson code $correctpass = false; if ($password = optional_param('userpassword', '', PARAM_CLEAN)) { if ($lesson->password == md5(trim($password))) { $USER->lessonloggedin[$lesson->id] = true; $correctpass = true; if ($lesson->highscores) { - // Logged in, now we can show high scores - redirect("$CFG->wwwroot/mod/lesson/highscores.php?id=$cm->id", '', 0); + // Logged in - redirect so we go through all of these checks before starting the lesson. + redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id"); } } - } elseif (isset($USER->lessonloggedin[$lesson->id])) { - $correctpass = true; } if (!$correctpass) { lesson_print_header($cm, $course, $lesson); echo "
    \n"; print_simple_box_start('center'); - echo '' . "\n"; + echo '' . "\n"; echo '' . "\n"; - echo '' . "\n"; if (optional_param('userpassword', 0, PARAM_CLEAN)) { notify(get_string('loginfail', 'lesson')); } @@ -159,7 +156,7 @@ } } - } else if ($lesson->highscores and !$lesson->practice and !optional_param('viewed', 0)) { // TODO: THIS DOES NOT WORK!!!! + } else if ($lesson->highscores and !$lesson->practice and !optional_param('viewed', 0) and empty($pageid)) { // TODO: THIS DOES NOT WORK!!!! // Display high scores before starting lesson redirect("$CFG->wwwroot/mod/lesson/highscores.php?id=$cm->id"); } @@ -262,7 +259,7 @@ if ($lesson->retake) { print_simple_box('

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

    ', 'center'); echo ''; } else { print_simple_box_start('center'); @@ -279,10 +276,10 @@ echo '
    '; echo ''. - ''. + ''. get_string('yes').'   '; echo ''. - ''. + ''. get_string('no').'
    '; echo ''; } @@ -381,7 +378,7 @@ } else { $nextpageid = $page->nextpageid; } - redirect("view.php?id=$cm->id&action=navigation&pageid=$nextpageid", get_string('endofclustertitle', 'lesson')); + redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&pageid=$nextpageid"); } @@ -429,7 +426,7 @@ } else { if ((($timer->starttime + $lesson->maxtime * 60) - time()) <= 0) { lesson_set_message(get_string('eolstudentoutoftime', 'lesson')); - redirect("view.php?id=$cm->id&action=navigation&pageid=".LESSON_EOL."&outoftime=normal", get_string("outoftime", "lesson")); + redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&pageid=".LESSON_EOL."&outoftime=normal", get_string("outoftime", "lesson")); } // update clock when viewing a new page... no special treatment if ((($timer->starttime + $lesson->maxtime * 60) - time()) < 60) { @@ -476,7 +473,7 @@ } else if ($answer->jumpto == LESSON_PREVIOUSPAGE) { $answer->jumpto = $page->prevpageid; } - redirect("view.php?id=$cm->id&action=navigation&pageid=$answer->jumpto"); + redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&pageid=$answer->jumpto"); break; } } else { @@ -767,9 +764,8 @@ echo "\n"; } else { // a page without answers - find the next (logical) page - echo "
    \n"; + echo "wwwroot/mod/lesson/view.php\">\n"; echo "id\" />\n"; - echo "\n"; if ($lesson->nextpagedefault) { // in Flash Card mode... // ...first get number of retakes -- 2.39.5