Skip to main content

UpdateAssessmentAttempt

Updates an assessment attempt for the current user. This is used to record user's selected choice(s) for the active question, or to record when user finishes the assessment. The results of this mutation can be affected by providing an authToken header to set a user for the operation.

UpdateAssessmentAttempt(
activeQuestion: QuestionInput
assessmentAttempt: AssessmentAttemptInput
): AssessmentAttempt!

Directives

authAccess

This requires the current user to be in STUDENT role.

Arguments

UpdateAssessmentAttempt.activeQuestion ● QuestionInput input

The active question with user's selected choice(s).

UpdateAssessmentAttempt.assessmentAttempt ● AssessmentAttemptInput input

The assessment attempt to be updated.

Type

AssessmentAttempt object

Examples

Run in Postman

Query:

UpdateAssessmentAttempt(
$activeQuestion: QuestionInput,
$assessmentAttempt: AssessmentAttemptInput
) {
UpdateAssessmentAttempt(
activeQuestion: $activeQuestion,
assessmentAttempt: $assessmentAttempt
) {
id
assessment {
...AssessmentFragment
}
answers {
...AssessmentAnswerFragment
}
course {
...CourseFragment
}
courseId
user {
...UserFragment
}
createdAt
updatedAt
timeElapsedInSeconds
status
grade
originalGrade
passed
assignmentSubmissionId
questions {
...QuizQuestionFragment
}
topicType
forgiven
topic {
...TopicFragment
}
topicId
correctQuestionsCount
answeredQuestionsCount
unansweredQuestionsCount
questionsWithChoicesCount
poolLabelByQuestionId
linkedWorkbook
adminUpdatedGrade
}
}

Variables:

{
"activeQuestion": "QuestionInput",
"assessmentAttempt": "AssessmentAttemptInput"
}

Response:

{
"data": {
"UpdateAssessmentAttempt": {
"id": "58ccb96c-8e90-4464-86e0-f284442981df",
"assessment": "Assessment",
"answers": [
"AssessmentAnswer"
],
"course": "course-1",
"courseId": "course-1",
"user": "User",
"createdAt": "2024-06-20T16:58:58.782Z",
"updatedAt": "2024-06-20T16:58:58.782Z",
"timeElapsedInSeconds": 678,
"status": "started",
"grade": 678,
"originalGrade": 678,
"passed": true,
"assignmentSubmissionId": "58ccb96c-8e90-4464-86e0-f284442981df",
"questions": [
"QuizQuestion"
],
"topicType": "ad",
"forgiven": true,
"topic": "Topic",
"topicId": "58ccb96c-8e90-4464-86e0-f284442981df",
"correctQuestionsCount": 678,
"answeredQuestionsCount": 678,
"unansweredQuestionsCount": 678,
"questionsWithChoicesCount": 678,
"poolLabelByQuestionId": "{}",
"linkedWorkbook": "58ccb96c-8e90-4464-86e0-f284442981df",
"adminUpdatedGrade": false
}
}
}