How to remove the message "You have seen more than one page of this lesson already. Do you want to start at the last page you saw?" from Guest users

How to remove the message "You have seen more than one page of this lesson already. Do you want to start at the last page you saw?" from Guest users

بواسطة - Ana Ferrer
عدد الردود: 3

Hello,

Would anyone know how to remove the message "You have seen more than one page of this lesson already. Do you want to start at the last page you saw?" from Guest users?

This message appears when a guest user starts a lesson. 

This is moodle 3.0 with adaptable theme 1.3.

Thanks

متوسط التقييمات: -
رداً على Ana Ferrer

Re: How to remove the message "You have seen more than one page of this lesson already. Do you want to start at the last page you saw?" from Guest users

بواسطة - Ana Ferrer

If removing this message just from Guest users is not possible, how could we remove it completely for ALL users?

Thanks,

Ana

رداً على Ana Ferrer

Re: How to remove the message "You have seen more than one page of this lesson already. Do you want to start at the last page you saw?" from Guest users

بواسطة - Paola Mendiburu

We have found that commenting this out in the file mod/lesson/view.php removes this message from all users.

// Check to see if end of lesson was reached.

if ((isset($lastpageseen) && ($lastpageseen != LESSON_EOL))) {
if (($DB->count_records('lesson_attempts', array('lessonid' => $lesson->id, 'userid' => $USER->id, 'retry' => $retries)) > 0)
|| $DB->count_records('lesson_branch', array("lessonid" => $lesson->id, "userid" => $USER->id, "retry" => $retries)) > 0) {

echo $lessonoutput->header($lesson, $cm, '', false, null, get_string('leftduringtimedsession', 'lesson'));
if ($lesson->timelimit) {
if ($lesson->retake) {
$continuelink = new single_button(new moodle_url('/mod/lesson/view.php',
array('id' => $cm->id, 'pageid' => $lesson->firstpageid, 'startlastseen' => 'no')),
get_string('continue', 'lesson'), 'get');

echo html_writer::div($lessonoutput->message(get_string('leftduringtimed', 'lesson'), $continuelink),
'center leftduring');

} else {
$courselink = new single_button(new moodle_url('/course/view.php',
array('id' => $PAGE->course->id)), get_string('returntocourse', 'lesson'), 'get');

echo html_writer::div($lessonoutput->message(get_string('leftduringtimednoretake', 'lesson'), $courselink),
'center leftduring');
}
} else {
echo $lessonoutput->continue_links($lesson, $lastpageseen);
}
echo $lessonoutput->footer();
exit();
}
}
However, I don’t know how to just limit the to Guest users. Would anyone know?

Maybe you just need to have:

if (‘userid’ == $GUEST)-->comment out,

else--> leave it.

I don’t know if the condition in the IF statement I have given you is correct.

I hope helps to you.

رداً على Paola Mendiburu

Re: How to remove the message "You have seen more than one page of this lesson already. Do you want to start at the last page you saw?" from Guest users

بواسطة - Ana Ferrer

Thank you Paola!

I wonder if it would work if in the first if statement we included a test to see if it is a guest user ... so, something like:

if ((isset($lastpageseen) && ($lastpageseen != LESSON_EOL)) !(isguestuser()))
and then leave the statement uncommented.
Does anyone know if this would work? We will try it anyway ...
Thanks