]> git.mjollnir.org Git - moodle.git/commitdiff
Removed action set to navigation because view.php no longer uses action
authormark-nielsen <mark-nielsen>
Sun, 10 Sep 2006 18:41:38 +0000 (18:41 +0000)
committermark-nielsen <mark-nielsen>
Sun, 10 Sep 2006 18:41:38 +0000 (18:41 +0000)
mod/lesson/action/continue.html
mod/lesson/action/continue.php
mod/lesson/action/updatepage.php
mod/lesson/edit.php
mod/lesson/locallib.php
mod/lesson/tabs.php
mod/lesson/view.php

index 0d666670991271afc3a7e855a18d53362cdb3bba..309b86270c27044863b948a6df57cc2cb6f723ed 100644 (file)
@@ -57,9 +57,8 @@ if ($lesson->displayleft) {
 
 <?php if (isset($USER->modattempts[$lesson->id])) { // User is modifying attempts - save button and some instructions ?>
 
-            <form name="endoflesson" method ="post" action="view.php">
+            <form name="endoflesson" method ="post" action="<?php echo $CFG->wwwroot ?>/mod/lesson/view.php">
             <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
-            <input type="hidden" name="action" value="navigation" />
             <input type="hidden" name="pageid" value="<?php echo LESSON_EOL; ?>" />
     
             <p align="center">
@@ -80,9 +79,8 @@ if ($lesson->displayleft) {
 
 <?php if ($lesson->review && !$correctanswer && !$noanswer && !$isessayquestion) { // Review button back ?>
     
-            <form name="reviewback" method ="post" action="view.php">
+            <form name="reviewback" method ="post" action="<?php echo $CFG->wwwroot ?>/mod/lesson/view.php">
             <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
-            <input type="hidden" name="action" value="navigation" />
             <input type="hidden" name="pageid" value="<?php echo $pageid; ?>" />
     
             <p>
@@ -93,9 +91,8 @@ if ($lesson->displayleft) {
             
 <?php } ?>
 
-            <form name="pageform" method ="post" action="view.php">
+            <form name="pageform" method ="post" action="<?php echo $CFG->wwwroot ?>/mod/lesson/view.php">
             <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
-            <input type="hidden" name="action" value="navigation" />
             <input type="hidden" name="pageid" value="<?php echo $newpageid ?>" />
 
 <?php if ($lesson->review && !$correctanswer && !$noanswer && !$isessayquestion) { // Review button continue ?>
index 249c908853d716b1b398b97450adf2c6c6fd62ec..abeb6d4d5e0a1004fa37c0b2e0c000bda22e00d8 100644 (file)
@@ -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&amp;pageid=".LESSON_EOL."&outoftime=normal", get_string("outoftime", "lesson"));
             }
         }
         
                 $newpageid = lesson_unseen_branch_jump($lesson->id, $USER->id);
             }
             // no need to record anything in lesson_attempts            
-            redirect("view.php?id=$cm->id&amp;action=navigation&amp;pageid=$newpageid");
+            redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&amp;pageid=$newpageid");
             break;
         
     }
index 3bc8c59940d5be57472d0584e1ac8ac65b9d180f..732958c887e78b7a89e44add28bed975f3678680 100644 (file)
@@ -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&amp;action=navigation&amp;pageid=$page->id");
+            redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&amp;pageid=$page->id");
         } else {
             redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id");
         }
         redirect("$CFG->wwwroot/mod/lesson/lesson.php?id=$cm->id&amp;action=editpage&amp;pageid=$page->id&amp;redirect=$redirect");
     } else if ($redirect == 'navigation') {
         // takes us back to viewing the page
-        redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&amp;action=navigation&amp;pageid=$page->id", get_string('updatedpage', 'lesson'));
+        redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&amp;pageid=$page->id", get_string('updatedpage', 'lesson'));
     } else {
         redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id", get_string('updatedpage', 'lesson'));
     }
index 1949797476e537721c678ce557bc43a8bcac6f48..a51f7d9d7ca8d28a0874c7bea392225161427c05 100644 (file)
@@ -55,9 +55,8 @@
         echo '</div>';
     } else {
         // print the pages
-        echo "<form name=\"lessonpages\" method=\"post\" action=\"view.php\">\n";
+        echo "<form name=\"lessonpages\" method=\"post\" action=\"$CFG->wwwroot/mod/lesson/view.php\">\n";
         echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n";
-        echo "<input type=\"hidden\" name=\"action\" value=\"navigation\" />\n";
         echo "<input type=\"hidden\" name=\"pageid\" />\n";
         $branch = false;
         $singlePage = false;
index 10aeefb8698231934f3098984b2d4305808357c5..f6e7dc7d497101140b4038a87ac5eb89e3d8815d 100644 (file)
@@ -1357,7 +1357,7 @@ function lesson_print_tree_link_menu($page, $id, $showpages=false) {
     
     $output .= '<li>';
     
-    $output .= "<a $class href=\"view.php?id=$id&amp;action=navigation&amp;pageid=$page->id\">".format_string($page->title,true)."</a>\n"; 
+    $output .= "<a $class href=\"view.php?id=$id&amp;pageid=$page->id\">".format_string($page->title,true)."</a>\n"; 
       
     $output .= "</li>";     
 
index 9536227c826e6e615dc6f8c2f6159429e0f06e08..f13ff3a5aa5b8c113ec9809182ba693c3ae16121 100644 (file)
@@ -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&amp;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)) {
index 5f04b50dcfcdf1457136af6d96052b55c08c3a46..8e91b56708ee94c0e482d07a9401cff1d84cedef 100644 (file)
             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 "<div class=\"password-form\">\n";
                 print_simple_box_start('center');
-                echo '<form name="password" method="post" action="view.php">' . "\n";
+                echo '<form name="password" method="post" action="'.$CFG->wwwroot.'/mod/lesson/view.php">' . "\n";
                 echo '<input type="hidden" name="id" value="'. $cm->id .'" />' . "\n";
-                echo '<input type="hidden" name="action" value="navigation" />' . "\n";
                 if (optional_param('userpassword', 0, PARAM_CLEAN)) {
                     notify(get_string('loginfail', 'lesson'));
                 }
                 } 
             }
     
-        } 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");
         }
                 if ($lesson->retake) {
                     print_simple_box('<p align="center">'. get_string('leftduringtimed', 'lesson') .'</p>', 'center');
                     echo '<div align="center" class="lessonbutton standardbutton">'.
-                              '<a href="view.php?id='.$cm->id.'&amp;action=navigation&amp;pageid='.$firstpageid.'&amp;startlastseen=no">'.
+                              '<a href="view.php?id='.$cm->id.'&amp;pageid='.$firstpageid.'&amp;startlastseen=no">'.
                                 get_string('continue', 'lesson').'</a></div>';
                 } else {
                     print_simple_box_start('center');
                 
                 echo '<div align="center">';
                 echo '<span class="lessonbutton standardbutton">'.
-                        '<a href="view.php?id='.$cm->id.'&amp;action=navigation&amp;pageid='.$lastpageseen.'&amp;startlastseen=yes">'.
+                        '<a href="view.php?id='.$cm->id.'&amp;pageid='.$lastpageseen.'&amp;startlastseen=yes">'.
                         get_string('yes').'</a></span>&nbsp;&nbsp;&nbsp;';
                 echo '<span class="lessonbutton standardbutton">'.
-                        '<a href="view.php?id='.$cm->id.'&amp;action=navigation&amp;pageid='.$firstpageid.'&amp;startlastseen=no">'.
+                        '<a href="view.php?id='.$cm->id.'&amp;pageid='.$firstpageid.'&amp;startlastseen=no">'.
                         get_string('no').'</a></div>';
                 echo '</span>';
             }
             } else {
                 $nextpageid = $page->nextpageid;
             }
-            redirect("view.php?id=$cm->id&amp;action=navigation&amp;pageid=$nextpageid", get_string('endofclustertitle', 'lesson'));
+            redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&amp;pageid=$nextpageid");
         }
         
         
             } else {
                 if ((($timer->starttime + $lesson->maxtime * 60) - time()) <= 0) {
                     lesson_set_message(get_string('eolstudentoutoftime', 'lesson'));
-                    redirect("view.php?id=$cm->id&amp;action=navigation&amp;pageid=".LESSON_EOL."&amp;outoftime=normal", get_string("outoftime", "lesson"));
+                    redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&amp;pageid=".LESSON_EOL."&amp;outoftime=normal", get_string("outoftime", "lesson"));
                 }
                 // update clock when viewing a new page... no special treatment
                 if ((($timer->starttime + $lesson->maxtime * 60) - time()) < 60) {
                     } else if ($answer->jumpto == LESSON_PREVIOUSPAGE) {
                         $answer->jumpto = $page->prevpageid;                            
                     }
-                    redirect("view.php?id=$cm->id&amp;action=navigation&amp;pageid=$answer->jumpto");
+                    redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&amp;pageid=$answer->jumpto");
                     break;
                 } 
             } else {
             echo "</form>\n"; 
         } else {
             // a page without answers - find the next (logical) page
-            echo "<form name=\"pageform\" method =\"post\" action=\"view.php\">\n";
+            echo "<form name=\"pageform\" method =\"post\" action=\"$CFG->wwwroot/mod/lesson/view.php\">\n";
             echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n";
-            echo "<input type=\"hidden\" name=\"action\" value=\"navigation\" />\n";
             if ($lesson->nextpagedefault) {
                 // in Flash Card mode...
                 // ...first get number of retakes