';
- print_simple_box_end();
-
- //we pass a new parameter to the function so it won't we printed if is_lams=1
- print_footer($course,null, false,$cm->is_lams);
+ print_simple_box_start('center');
+ echo '
";
+ }
lesson_print_submit_link(get_string('continue', 'lesson'), 'password', 'center', 'standardbutton submitbutton');
echo '';
print_simple_box_end();
echo "\n";
- //we pass a new parameter to the function so it won't we printed if is_lams=1
- print_footer($course,null, false,$cm->is_lams);
+ print_footer($course,null, false,$cm->is_lams);
exit();
}
@@ -161,8 +158,7 @@
echo '
';
print_simple_box_end();
echo '';
- //we pass a new parameter to the function so it won't we printed if is_lams=1
- print_footer($course,null, false,$cm->is_lams);
+ print_footer($course,null, false,$cm->is_lams);
exit();
}
}
@@ -192,7 +188,7 @@
lesson_set_message(get_string('lessonnotready', 'lesson', $course->teacher)); // a nice message to the student
} else {
if (!count_records('lesson_pages', 'lessonid', $lesson->id)) {
- redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id&is_learner=$is_learner"); // no pages - redirect to add pages
+ redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id&is_learner=$is_learner&count_records('lesson_pages'"); // no pages - redirect to add pages
} else {
lesson_set_message(get_string('lessonpagelinkingbroken', 'lesson')); // ok, bad mojo
}
@@ -263,11 +259,11 @@
// get the first page
if (!$firstpageid = get_field('lesson_pages', 'id', 'lessonid', $lesson->id,
'prevpageid', 0)) {
- if($cm->is_lams==0){
- error('Navigation: first page not found');
- }else{
- include('showlamsnext.php');
- }
+ if($cm->is_lams==0){
+ error('Navigation: first page not found');
+ }else{
+ include('showlamsnext.php');
+ }
}
lesson_print_header($cm, $course, $lesson);
if ($lesson->timed) {
@@ -277,17 +273,12 @@
''.
get_string('continue', 'lesson').'';
} else {
-
- print_simple_box_start('center');
- echo '
';
- echo get_string('leftduringtimednoretake', 'lesson');
- // don't display the return to lesson or to course buttons if you are in a Lams lesson
- if($cm->is_lams==0){
- echo '
';
+ print_simple_box_end();
}
} else {
@@ -303,8 +294,7 @@
get_string('no').'';
echo '';
}
- //we pass a new parameter to the function so it won't we printed if is_lams=1
- print_footer($course,null, false,$cm->is_lams);
+ print_footer($course,null, false,$cm->is_lams);
exit();
}
@@ -318,14 +308,12 @@
print_simple_box_start('center');
echo "
";
echo get_string("noretake", "lesson");
- // don't display the return to lesson or to course buttons if you are in a Lams lesson
- if($cm->is_lams==0){
- echo "
';
+ }
+ echo "";
print_simple_box_end();
- //we pass a new parameter to the function so it won't we printed if is_lams=1
- print_footer($course,null, false,$cm->is_lams);
+ print_footer($course,null, false,$cm->is_lams);
exit();
//redirect("../../course/view.php?id=$course->id", get_string("alreadytaken", "lesson"));
// allow student to retake course even if they have the maximum grade
@@ -336,11 +324,11 @@
}
// start at the first page
if (!$pageid = get_field('lesson_pages', 'id', 'lessonid', $lesson->id, 'prevpageid', 0)) {
- if($cm->is_lams==0){
- error('Navigation: first page not found');
- }else{
- include('showlamsnext.php');
- }
+ if($cm->is_lams==0){
+ error('Navigation: first page not found');
+ }else{
+ include('showlamsnext.php');
+ }
}
/// This is the code for starting a timed test
if(!isset($USER->startlesson[$lesson->id]) && !has_capability('mod/lesson:manage', $context)) {
@@ -381,14 +369,13 @@
add_to_log($course->id, 'lesson', 'view', 'view.php?id='. $cm->id, $pageid, $cm->id);
if (!$page = get_record('lesson_pages', 'id', $pageid)) {
- if($cm->is_lams==0){
- error('Navigation: the page record not found');
- }else{
- include('showlamsnext.php');
- print_r("This lesson hasn't been edited yet by the teacher");
- break;
- }
-
+ if($cm->is_lams==0){
+ error('Navigation: the page record not found');
+ }else{
+ include('showlamsnext.php');
+ print_r("This lesson hasn't been edited yet by the teacher");
+ break;
+ }
}
if ($page->qtype == LESSON_CLUSTER) { //this only gets called when a user starts up a new lesson and the first page is a cluster page
@@ -550,7 +537,6 @@
}
/// Print the page header, heading and tabs
- //LAMS: we pass a new parameter so when in a lams sequence we don't display Moodle's headers
$PAGE->print_header('','',$cm->is_lams);
if ($attemptflag) {
@@ -973,8 +959,8 @@
echo "
".get_string("displayofgrade", "lesson")."
\n";
}
print_simple_box_end(); //End of Lesson button to Continue.
- //LAMS: if the student have finished the activity
- $finishlesson=1;
+ //LAMS: if the student have finished the activity
+ $finishlesson=1;
// after all the grade processing, check to see if "Show Grades" is off for the course
// if yes, redirect to the course page
if (!$course->showgrades&&$cm->is_lams==0) {
@@ -1053,25 +1039,25 @@
}
}
}
- // don't display the return to lesson or to course buttons if you are in a Lams lesson
- if($cm->is_lams==0){
- echo "
\n";
+ }
}
+
if($cm->is_lams==1){
- if($uploaded==1||$editing==1){
- //lams: display the finish edditing button if we have added any kind of question
- include('showlamsfinish.php');
- }elseif($finishlesson==1||$is_learner==1||!get_record('lesson_pages', 'lessonid', $lesson->id)){
- //lams: display the next activity button if we have added any kind of question
- include('showlamsnext.php');
- }
- }
+ if($uploaded==1||$editing==1){
+ //lams: display the finish edditing button if we have added any kind of question
+ include('showlamsfinish.php');
+ }elseif($finishlesson==1||$is_learner==1||!get_record('lesson_pages', 'lessonid', $lesson->id)){
+ //lams: display the next activity button if we have added any kind of question
+ include('showlamsnext.php');
+ }
+ }
+
/// Finish the page
- //we pass a new parameter to the function so it won't we printed if is_lams=1
- print_footer($course,null, false,$cm->is_lams);
+ print_footer($course,null, false,$cm->is_lams);
?>