Queries for Quizzes

Retrieve Specific Details about Knowledge Check Sessions

Problem

As an analyst, I want to retrieve a list of sessions related to quizzes that include the following:

  1. Start Date & Time (same as scenario start for now)

  2. End Date & Time (same as scenario end for now)

  3. Total Duration (HH:MM:SS)

  4. Questions asked in order (the exact question copy as the user read it)

  5. Question types (Multiple Choice, Multi Select, Multiple Choice 3D, Multi Select 3D)

  6. Correct answer(s) to each question (Multiple answers only apply to multi-response question types)

  7. Number of attempt(s) for each question (show the number of attempts taken out of the total allowed)

  8. User’s answer(s) to each question and whether it was correct There can be more than one set of answers for each attempt If more than one attempt is allowed for the question.)

  9. Time spent on each question (HH:MM:SS, but expecting most will be MM:SS)

  10. Time spent on each answer attempt

Solution

The following query will returns only scenario sessions that are related to scenarios that have quizzes. Within each eventData property should be a summary of the quiz as it was at that time. Results should be paginated:

query { scenarioSessions(first: 25, workInstructionTypes: [GRADED_ASSESSMENT]) { nodes { id databaseId duration endedAt externalData startedAt endedAt duration sessionType scenario { id name } events( first: 1000 eventTypes: [QUIZ_ITEM_COMPLETE] orderBy: { attribute: "startedAt", direction: DESC } ) { nodes { startedAt type value eventData scenarioStepItem { id type externalData } scenarioSessionStep { id completed duration completedItems { nodes { id } } scenarioStep { id name type orderIndex scenarioSequence { id name } items(first: 1000) { nodes { id description type } } } } } } } } }

 

Â