Remove "Re-Attempt Quiz" Button... Moodle 2.9

Remove "Re-Attempt Quiz" Button... Moodle 2.9

by A Smiles -
Number of replies: 10

Hello, using moodle 2.9


I am looking for a way to remove the "re-attempt quiz" button as I have now placed the "back to course" button in the quiz  results, but the "re-attempt quiz" button still shows. This is the last remaining hurdle for me completing a months worth of work. Could someone please explain how to do that please?

I see this in 

moodle/mod/quiz/view.php (lines 213-215)

else {

                $viewobj->buttontext = get_string('reattemptquiz', 'quiz');

            }

Tried remarking it out like so:

else //{

                //$viewobj->buttontext = get_string('reattemptquiz', 'quiz');

            }


But that did not work...





Average of ratings: -
In reply to A Smiles

Re: Remove "Re-Attempt Quiz" Button... Moodle 2.9

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

In the quiz setting, set the number of attempts allowed to 1.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Remove "Re-Attempt Quiz" Button... Moodle 2.9

by A Smiles -

No Tim, it is set to 2 attempts. I don't want someone who fails to retake the quiz again right away (hence why I am trying to remove the "re-attempt quiz" button). I want them to go back through the training again so they have a better chance of success and a greater understanding of the subject matter... I know you can set the re-attempt to a timer but I feel the re-attempt button is too confusing to students if it is shown at all.

In reply to A Smiles

Re: Remove "Re-Attempt Quiz" Button... Moodle 2.9

by John Provasnik -
Picture of Particularly helpful Moodlers Picture of Testers

Can you do what Tim suggested and then have a second instance of the quiz called 2nd Attempt that has conditional activities set (must have failed the first quiz, must have viewed the lesson or a special review lesson that appears after the first failed attempt) etc... There's a lot you can accomplish with the restric access features and a little creativity. 

Average of ratings: Useful (1)
In reply to John Provasnik

Re: Remove "Re-Attempt Quiz" Button... Moodle 2.9

by A Smiles -

Thanks John, I'll give that ago... I'm hoping that for future development this might hopefully be a feature. But I'm uncertain as how to set the second quiz to be dependent on the result of the first. I don't see an option for that in the quiz settings based on the result of the scores from the first quiz.

In reply to A Smiles

Re: Remove "Re-Attempt Quiz" Button... Moodle 2.9

by A Smiles -

I have tried that but I am now running into other problems.

I can't seem to set a retake time between the first and second quizzes (as they are now independent quizzes). 

The student can now go straight to the quiz (either one of them) without watching a video.

When I have a custom message for failure it shows twice on the same page (which is a link back to the lesson video).

In reply to A Smiles

Re: Remove "Re-Attempt Quiz" Button... Moodle 2.9

by A Smiles -

Has anyone achieved what you are suggesting to me so I can either download the course or at least have some idea as to how it was done please? Or perhaps direct me to a Moodle developer so I can ask what the cost of implementing this would be please?

In reply to A Smiles

Re: Remove "Re-Attempt Quiz" Button... Moodle 2.9

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

What if you try this:

else {

                $viewobj->buttontext = ' ';

            }

For the multiple quizzes, you need to set restrictions in the quizzes' settings so that they are not available unless they have completed the video (you need to set the completion setting in the settings for the video).

In reply to Emma Richardson

Re: Remove "Re-Attempt Quiz" Button... Moodle 2.9

by A Smiles -

Thanks Emma, i'll give that a go... I feel a little silly because I also discovered 

In reply to A Smiles

Re: Remove "Re-Attempt Quiz" Button... Moodle 2.9

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

And then you have to enable it in the course too...

In reply to Emma Richardson

Re: Remove "Re-Attempt Quiz" Button... Moodle 2.9

by A Smiles -

That seems to have worked smile but of course the next problem arises! 

As I now have 2 quizzes (the second being dependent on the first  not being passed) which I have even set as invisible until the first is failed. However, I am no longer able to see my general feedback, scores or anything else after the quiz is taken (when logged in as a student). Any suggestions?

Also there is a button that says "back to course" after the quiz is taken... The text above it says "No more attempts are allowed" which I would like to change. The only place I can find that text is in: moodle//mod/quiz/lang/en/quiz.php Line 521

$string['nomoreattempts'] = 'No more attempts are allowed';

Which I have changed to:

$string['nomoreattempts'] = 'You Have Failed The Quiz. If You Are Able Then Review Your Module And Try Again.';

and saved the file but it does not change the text I see. I still see "No more attempts are allowed".

Any ideas as to where I would change the text to be something different please?