Changing the quiz 'restricted access' message

Changing the quiz 'restricted access' message

by Margot Soreli -
Number of replies: 6

Hello,


I would like the users to not be able to take a test unless they achieved the previous one with a certain grade (e.g. 50%). When I set this up in Moodle, the following message appears next to the quiz: 'Not available unless: You achieve a required score in Quiz: The alphabet'.


I would like to change the "You achieve a required score in" and reflect the score requested but I can't find where I should update it. However, I could found that "Not available unless" is in "lang/en/availability.php". Any idea what file the "You achieve a required score in" is in?


Thanks.

Average of ratings: -
In reply to Margot Soreli

Re: Changing the quiz 'restricted access' message

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

I believe that you cannot change this in the language strings and would have to hack the code as currently it is just a generic string but you are wanting it to pull a number from the restriction itself.

In reply to Emma Richardson

Re: Changing the quiz 'restricted access' message

by Margot Soreli -

Thanks Emma for your prompt reply. Would you know where in the code this sentence is generated?

In reply to Margot Soreli

Re: Changing the quiz 'restricted access' message

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

Not off hand but I would look at the mod files in the course folder..

In reply to Emma Richardson

Re: Changing the quiz 'restricted access' message

by Margot Soreli -
I finally found it in availability/condition/grade/lang. Thanks for your help!
Average of ratings: Useful (1)
In reply to Margot Soreli

Re: Changing the quiz 'restricted access' message

by John Provasnik -
Picture of Particularly helpful Moodlers Picture of Testers
Could you share what you did to make this change? We'd like to be able to have more specific restrictions as well (displaying the actual points and such).
In reply to John Provasnik

Re: Changing the quiz 'restricted access' message

by Margot Soreli -

Here is what I did:

  • in Moodle, go to: Administration > Site administration > Language > Language customisation.
  • In the "Show strings of these components" box, select "availability_grade.php" under the availability and pressed the "Show strings" button.
  • Then in the list of standard text below, I looked for "You achieve a required score in" and in the box next to it add the statement you'd like to replace the current one with.

I hope this helps.

Average of ratings: Useful (3)