';
+ 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);
exit();
} else if ($lesson->usepassword and empty($USER->lessonloggedin[$lesson->id])) { // Password protected lesson code
@@ -71,16 +79,20 @@
if (optional_param('userpassword', 0, PARAM_CLEAN)) {
notify(get_string('loginfail', 'lesson'));
}
-
- echo get_string('passwordprotectedlesson', 'lesson', format_string($lesson->name))."
";
+ }
lesson_print_submit_link(get_string('continue', 'lesson'), 'password', 'center', 'standardbutton submitbutton');
echo '';
print_simple_box_end();
echo "\n";
- print_footer($course);
+ //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);
exit();
}
@@ -149,7 +161,8 @@
echo '
';
print_simple_box_end();
echo '';
- print_footer($course);
+ //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);
exit();
}
}
@@ -250,7 +263,11 @@
// get the first page
if (!$firstpageid = get_field('lesson_pages', 'id', 'lessonid', $lesson->id,
'prevpageid', 0)) {
- error('Navigation: first page not found');
+ if($cm->is_lams==0){
+ error('Navigation: first page not found');
+ }else{
+ include('showlamsnext.php');
+ }
}
lesson_print_header($cm, $course, $lesson);
if ($lesson->timed) {
@@ -260,12 +277,17 @@
''.
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 '
';
+ }
+ echo "";
print_simple_box_end();
- print_footer($course);
+ //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);
exit();
//redirect("../../course/view.php?id=$course->id", get_string("alreadytaken", "lesson"));
// allow student to retake course even if they have the maximum grade
@@ -309,7 +336,11 @@
}
// start at the first page
if (!$pageid = get_field('lesson_pages', 'id', 'lessonid', $lesson->id, 'prevpageid', 0)) {
- error('Navigation: first page not found');
+ 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)) {
@@ -350,7 +381,14 @@
add_to_log($course->id, 'lesson', 'view', 'view.php?id='. $cm->id, $pageid, $cm->id);
if (!$page = get_record('lesson_pages', 'id', $pageid)) {
- error('Navigation: the page record not found');
+ 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
@@ -512,7 +550,8 @@
}
/// Print the page header, heading and tabs
- $PAGE->print_header();
+ //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) {
print_heading(get_string('attempt', 'lesson', $retries + 1));
@@ -934,10 +973,11 @@
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;
// 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) {
+ if (!$course->showgrades&&$cm->is_lams==0) {
redirect($CFG->wwwroot.'/course/view.php?id='.$course->id);
}
@@ -1013,12 +1053,26 @@
}
}
}
-
- 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||!get_record('lesson_pages', 'lessonid', $lesson->id)){
+ //lams: display the next activity button if we have added any kind of question
+ echo("dfdfdf");
+ include('showlamsnext.php');
+ }
+ }
/// Finish the page
- print_footer($course);
+ //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);
?>