mod_quiz_get_user_attempts returns empty array

mod_quiz_get_user_attempts returns empty array

by ahmet tark -
Number of replies: 0

I am trying to get the attempt id for a user taking a quiz. How can I get an attempt id, before the user finishes the quiz?

I started an attempt via mod_quiz_start_attempt, it works, correctly and gives

{'errorcode': 'attemptstillinprogress',
 'exception': 'moodle_quiz_exception',
 'message': 'Attempt still in progress'}
However, when I try to get the attemptid via

       mod_quiz_get_user_attempts

it gives empty arrays as :

       'attempts': [], 'warnings': []
Do I need to wait until user finishes the attempt?

Average of ratings: -