Changing the quiz 'restricted access' message

Changing the quiz 'restricted access' message

על ידי Margot Soreli בתאריך
מספר תגובות: 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.

ממוצע דרוגים: -
בתגובה ל: Margot Soreli

Re: Changing the quiz 'restricted access' message

על ידי Emma Richardson בתאריך
תמונה של Documentation writers תמונה של Particularly helpful Moodlers תמונה של 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.

בתגובה ל: Emma Richardson

Re: Changing the quiz 'restricted access' message

על ידי Margot Soreli בתאריך

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

בתגובה ל: Margot Soreli

Re: Changing the quiz 'restricted access' message

על ידי Emma Richardson בתאריך
תמונה של Documentation writers תמונה של Particularly helpful Moodlers תמונה של Plugin developers

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

בתגובה ל: Emma Richardson

Re: Changing the quiz 'restricted access' message

על ידי Margot Soreli בתאריך
I finally found it in availability/condition/grade/lang. Thanks for your help!
בתגובה ל: Margot Soreli

Re: Changing the quiz 'restricted access' message

על ידי John Provasnik בתאריך
תמונה של Particularly helpful Moodlers תמונה של 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).
בתגובה ל: John Provasnik

Re: Changing the quiz 'restricted access' message

על ידי 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.