Questions API Methods
dynamic
Methods for working with Items that contain dynamic content.
You would want to use this object and its methods to interact with dynamic content and "Try Again" functionality.
Note This object and its dynamic content methods won't appear if there is no dynamic content set for the Item.
Values
Type object
Properties
-
nextAttempt function
Load the next data row from the dynamic content table in the Item and displays it for the learner.
Note This method will load the very first dynamic content entry if it has reached the last index.
itemsApp.question('my_response_id').dynamic.nextAttempt();
-
previousAttempt function
Load the previous data row from the dynamic content table in the Item and displays it for the learner.
Note This method will load the very last dynamic content entry if it has reached the beginning (index 0).
itemsApp.question('my_response_id').dynamic.previousAttempt();
-
currentAttemptIndex function
Returns the index of the current attempt in the dynamic content table.
itemsApp.question('my_response_id').dynamic.currentAttemptIndex();
-
totalAttempts function
Counts the total number of dynamic content attempts for the current Item.
Used with the "Try Again" functionality, this is the number of times the learner has clicked "Try Again".
itemsApp.question('my_response_id').dynamic.totalAttempts();