Posts made by Tim Hunt

Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I don't know the answer to your qustion, but this web service is used by the Moodle moodle app, and it works there, so one way to solve this would be to attempt the quiz in the mobile app in a way that lets you inspect the network traffic, to see what the right request is.
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If that is what is going on, then this quiz design technique would help: https://docs.moodle.org/404/en/Effective_quiz_practices#Robust_testing_with_random_variants. That is also a good way to make oneline quizzes for many other reasons than just this one threat.
Average of ratings: Useful (3)
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Note that M.util.set_user_preference is old and deprecated.

These days you should use the core_user/repository JS module:

import {setUserPreference} from 'core_user/repository';

setUserPreference('preference_name', status);

(Bear in mind that is an async function.)
Average of ratings: Useful (1)