Ajax for check?

Re: working on plug in to introduce ajax functionality for quiz attempt (was Re: Ajax for check?)

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

I think you should avoid anything that requires changes on a per-question-type basis if at all possible.

Or, at least, not require anything new to be done on a per question-type basis. There is already code in some question types to support the Mobile app. Is any of that reusable? (I must admit woeful ingnorance of how Quiz in Mobile app works. I really ought to make the time to learn.)

It is possible to write JavaScript using approaches like delegated event handlers, which when done well means that the same JavaScript will work even if the HTML content changes. (It is also good practice for other reasons.) If we have to make changes to the JavaScript of individual question types, would it be possible to actually make changes like that - which are generally good, not specifically for your application. Doing that would be uncontroversial, I think. (A lot of qtypes have old JavaScript that certainly does not follow best practices. Or, at least, today's best practices.)

Have you made a list of all the question types (that you are interested in), and how badly broken they are without changes? It would be interesting to see that.

In reply to Tim Hunt

Re: working on plug in to introduce ajax functionality for quiz attempt (was Re: Ajax for check?)

by Brendan Heywood -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

thanks heaps Tim,

Yes we are very keen to try and find an agnostic solution so we don't have to touch each question, but so far I can't see how that's possible. Some are yui, some are amd, they can bootstrap differently, and who knows about the plugins in the wild not in core. We haven't done an exhaustive audit of what questions we want (in core + plugins) vs which are broken, but drag and drop is definitely in the list, and is broken.

Anyway we are going still scoping the second stage and getting funding, we should know more in a month or so. At this point it looks like we will aim for the notifyFilterContentUpdated solution - which as you've said should hopefully be uncontroversial.

thanks again