2.9 Skip the congratulations page

2.9 Skip the congratulations page

di Wendi Daniels -
Numero di risposte: 3

I would like to skip the congratulations page, and instead direct the student back to course/view.php    How do I do this?

Media dei voti:  -
In riposta a Wendi Daniels

Re: 2.9 Skip the congratulations page

di Wendi Daniels -

What I really want is to remove these:

_________________________________________________

Number of questions answered: 2

Number of correct answers: 2

Your score is 2 (out of 2).
_________________________________________________

and I would like to bring the student to this page IF they have not completed the mandated time. How do I do this? 
In riposta a Wendi Daniels

Re: 2.9 Skip the congratulations page

di Wendi Daniels -

Jean-Michael was able to remove all except "Your score is X (out of X)." Still, I want to bypass this page altogether so that the students see this page if and only if they have not completed the required time. Kindly advise.

In riposta a Wendi Daniels

Re: 2.9 Skip the congratulations page

di Jean-Michel Védrine -

Hello Wendi,

I miss time to do some tests and it's unlikely I will be able to work on this in a near future but looking at the code you could try replacing the 4 lines

lesson_add_fake_blocks($PAGE, $cm, $lesson, $timer);
    echo $lessonoutput->header($lesson, $cm, $currenttab, $extraeditbuttons, $lessonpageid, get_string("congratulations", "lesson"));
    echo $lessoncontent;
    echo $lessonoutput->footer();

at the end of the mod/lesson/view.php file with just one line

   redirect(new moodle_url('/course/view.php', array('id'=>$course->id)));


Warnings:

  • don't suppress the curly brace at the end of this file !
  • this will remove the congratulation page for all lessons on your website

As I said I have not tested this so I can give no guaranty and if it doesn't work it is unlikely I will be able to find time to make it work, but you can try this solution and see if it works.