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:
Start Date & Time (same as scenario start for now)
End Date & Time (same as scenario end for now)
Total Duration (HH:MM:SS)
Questions asked in order (the exact question copy as the user read it)
Question types (Multiple Choice, Multi Select, Multiple Choice 3D, Multi Select 3D)
Correct answer(s) to each question (Multiple answers only apply to multi-response question types)
Number of attempt(s) for each question (show the number of attempts taken out of the total allowed)
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.)
Time spent on each question (HH:MM:SS, but expecting most will be MM:SS)
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
}
}
}
}
}
}
}
}
}
Â
Â