I have the following problem for my course in Moodle 3.6.7.
I created a quiz with 20 random questions. To pass the test you need 16 questions correct. I have a service running which periodically asks the moodle API for the current progress of a user.
Therefore I need the quiz to be completed when either they got a pass grade or they used all (3) attempts.
When I go into the test activity, setup "Or all available attempts completed" together with "pass grade needed" everything works perfectly.
Wen I go into the test activty again and change something else like the name, the tick in "Or all available attempts completed" gets removed.
This breaks the completion of the activty.
If theres no real solution for first problem, I may consider to rewrite my service. So therefore it may be a better solution to get the states "COMPLETION_COMPLETE_PASS" and "COMPLETION_COMPLETE_FAIL" back through the api so I can check directly for the result. Which settings do I need to make for it to work?
"Problem 1. ... When I go into the test activity again and change something else like the name, the tick in "Or all available attempts completed" gets removed."
This is probably due to the fact that the activity has already been marked as completed for some participants. Changing completion options would erase their completion state and may cause confusion. Thus the completion options have been locked and should not be unlocked unless absolutely necessary.
In other words, although the tick in "Or all available attempts completed" is removed, the completion options have been locked and "Or all the available attempts completed" is still active.