Add a HTML Block to all quiz attempt pages

Add a HTML Block to all quiz attempt pages

by Advait Nandeshwar -
Number of replies: 2

Hi,

I'm sorry if this has already been discussed or if this is wrong forum for this question.

I have a custom JS code and I need that to run only on the quiz attempt page, for that I want to use the HTML block, but the problem is that, the HTML block has to be called upon manually each and every time the quiz is created. Is there any way I can have that particular HTML on the quiz attempt page (attempt.php) forever?

Thank you.

Average of ratings: -
In reply to Advait Nandeshwar

Re: Add a HTML Block to all quiz attempt pages

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

Yes, but to do it is a non-obvious two-step process:

  1. Go to the list of courses page (URL .../course/).
  2. Add the block there.
  3. Edit the block settings, and set it to appear on every page:


  4. Then go into a quiz, and start an attempt, then on that page, edit the block settings again. now you get an 'Attempt quiz page' option.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Add a HTML Block to all quiz attempt pages

by Advait Nandeshwar -
Thank you very much Tim,
I was going to spend $50 for this, glad I solved it on my own, all thanks to you! smile