I want to reset a test result for a user over the rest API from Moodle 4.1 and don't find a solution. Is there a way to do this? I have the user id from the user from moodle and the course id and quiz id. Now I want to delete or reset the test of this user without login over the rest API.
I found the mod_quiz_start_attempt
function that looks like what I want to do, but there I can't say for which user I want a new attempt for the test. When I tested it, it always create a new attempt for the user of the Rest API.
Example:
/webservice/rest/server.php?wsfunction=mod_quiz_start_attempt&forcenew=1&wstoken=<token>&quizid=<courseId>&moodlewsrestformat=json
Is there a way to add an user here or is there any other possibility to solve this problem?