mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
Removed action set to navigation because view.php no longer uses action
This commit is contained in:
parent
f4bb0ad8f7
commit
c94d37997d
@ -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 ?>
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
@ -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'));
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -1357,7 +1357,7 @@ function lesson_print_tree_link_menu($page, $id, $showpages=false) {
|
||||
|
||||
$output .= '<li>';
|
||||
|
||||
$output .= "<a $class href=\"view.php?id=$id&action=navigation&pageid=$page->id\">".format_string($page->title,true)."</a>\n";
|
||||
$output .= "<a $class href=\"view.php?id=$id&pageid=$page->id\">".format_string($page->title,true)."</a>\n";
|
||||
|
||||
$output .= "</li>";
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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 "<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'));
|
||||
}
|
||||
@ -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('<p align="center">'. get_string('leftduringtimed', 'lesson') .'</p>', 'center');
|
||||
echo '<div align="center" class="lessonbutton standardbutton">'.
|
||||
'<a href="view.php?id='.$cm->id.'&action=navigation&pageid='.$firstpageid.'&startlastseen=no">'.
|
||||
'<a href="view.php?id='.$cm->id.'&pageid='.$firstpageid.'&startlastseen=no">'.
|
||||
get_string('continue', 'lesson').'</a></div>';
|
||||
} else {
|
||||
print_simple_box_start('center');
|
||||
@ -279,10 +276,10 @@
|
||||
|
||||
echo '<div align="center">';
|
||||
echo '<span class="lessonbutton standardbutton">'.
|
||||
'<a href="view.php?id='.$cm->id.'&action=navigation&pageid='.$lastpageseen.'&startlastseen=yes">'.
|
||||
'<a href="view.php?id='.$cm->id.'&pageid='.$lastpageseen.'&startlastseen=yes">'.
|
||||
get_string('yes').'</a></span> ';
|
||||
echo '<span class="lessonbutton standardbutton">'.
|
||||
'<a href="view.php?id='.$cm->id.'&action=navigation&pageid='.$firstpageid.'&startlastseen=no">'.
|
||||
'<a href="view.php?id='.$cm->id.'&pageid='.$firstpageid.'&startlastseen=no">'.
|
||||
get_string('no').'</a></div>';
|
||||
echo '</span>';
|
||||
}
|
||||
@ -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 "</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
|
||||
|
Loading…
x
Reference in New Issue
Block a user