2.9 Getting rid of unnecessary steps

2.9 Getting rid of unnecessary steps

by Wendi Daniels -
Number of replies: 5

I just upgraded to 2.9, and now lesson has an added step that I don't want. When you click on a lesson that you have already visited, you get this message:


You have seen more than one page of this lesson already.
Do you want to start at the last page you saw?


I want to get rid of this in all lessons. How do I do this?

Average of ratings: -
In reply to Wendi Daniels

Re: 2.9 Getting rid of unnecessary steps

by Jean-Michel Védrine -

Hello Wendi,

this step is not "unnecessary" it is absolutely needed so that lesson_branch and lesson_timer are correctly updated in the database when a student leave a lesson and come back. In fact this dialog was already present in previous Moodle versions but the process was buggy and as a result student attempts were not correctly recorded in the database.

Thanks to Stephen Bourget for fixing this nasty bug.

Average of ratings: Useful (1)
In reply to Jean-Michel Védrine

Re: 2.9 Getting rid of unnecessary steps

by Wendi Daniels -

Thank you Jean-Michel, and thank you Stephen!


I altered the wording, and I would like to remove the button for "no". I tried to modify the code I found in mod/lesson/view, but the "no" button is still there. How do I fix this?

In reply to Wendi Daniels

Re: 2.9 Getting rid of unnecessary steps

by Jean-Michel Védrine -

I don't know what you have modified in mod/lesson/view.php but your modification is certainly wrong (so please undo it as it can have adverse effects wink ) the code you want to modify is in mod/lesson/renderer.php in the continue_links function.


In reply to Jean-Michel Védrine

Re: 2.9 Getting rid of unnecessary steps

by Wendi Daniels -

Excellent! Thank you!


Now I am trying to turn that link into a button. I have tried to put the html into the language customization, and into mod/lesson/renderer, and nothing works. How do I turn it from a link to a button?


RESOLVED!


I have made several hacks, but this is what I did and it worked for me* (see end of this entry)


In site administration > Language > Language Customization...

1) highlight "Moodle.php" in the core strings, enter "yes" in the "only strings containing" box and press enter.


2) Go down to the string that says "yes", and put in this code:

<div class="singlebutton"><input type="submit" value="whatever you want the button to say" /></div>

*********************************************************

3) In your ftp files, go into mod/lesson/renderer and change line 172 from

        $output .= html_writer::tag('span', $yeslink, array('class'=>'lessonbutton standardbutton));

to

        $output .= html_writer::tag('span', $yeslink, array('class'=>'lessonbutton singlebutton));

******************************************************

4) Go to site administration > appearance > themes > (your selected theme) and enter proper css coding. You can create the button you want, and get the css code here:

http://livetools.uiparade.com/button-builder.html#


_______________________________________________________________________________

The code, as you can see, was originally "standardbutton", and not "singlebutton". I am uncertain if this will work with just these three areas of change. If it does not work perhaps trying "standardbutton" in all areas may serve you better.

In reply to Wendi Daniels

Re: 2.9 Getting rid of unnecessary steps

by Wendi Daniels -

Now I'm trying to get rid of the end-of-lesson "preview" page ("congratulations, you passed the lesson"), and just take the student back to the home page when they complete a lesson. This is how I had it before the upgrade, and I can't see how to get rid of that preview page. Please advise.