Hello Bop,
Thanks for confirming that this little script works great. It may be useful to other people.
To do things in a more conventional way, creating a new type of question should be considered. In fact, it would simply be a modified Description question, which could be called "Timed description", to which the following features would be added:
- A timer is added while the content (photo, text, etc.) is displayed.
- The duration of the display is a setting of the question, i.e. it is set by the teacher.
- The display can be automatic, as soon as the question is loaded, or triggered by the student.
- The counter continues to run even if the student reloads the page or leaves and returns to the page.
- When the time is up, the content of the question is hidden and remains hidden even if the student reloads the page or leaves and returns to the page.
- Going to the next page is automatic or triggered by clicking on the Next page button.
- The content of the question must be displayed in the quiz review.
- There may be other things to consider.
There are obviously many variations of this sort of timed question. The actual questions, that is, other than Description, could also be timed.
The display of pages could also be timed. It would then be more of a new quiz settings, that is, a display time could be set by the teacher for any given page of the quiz. That would involve modifications to the quiz module itself.
Let's return to the proposed "Timed description" question. Based on Tim's advice in the thread you are referring to, if I understood correctly, it would be acceptable and fairly straightforward to just inject some JavaScript into the DOM of the quiz pages.
There is not too much of a problem for the JavaScript part, especially if the use of jQuery is tolerated, which makes programming a bit easier. As for the plugin itself, it would be the first one I would try to do. Maybe a little later.