Pearson
Always Learning

API Group: 

This guide describes the API sequence to continue taking an exam once the exam was interrupted, for example if user stops then continues the exam or moves to another device. If the exam is timed, the duration must not have expired for this to work.

Important: An exam cannot be started using the LearningStudio user interface and then modified or completed using the Exam API. If the exam is started using the LearningStudio UI, it must be completed using the UI.


User Interface API Notes
User reopens exam. 1. (Optional) Get the system time from the LearningStudio server to coordinate durations.

GET /systemDateTime

 

2. Get the array of exam IDs from course items. If the specific exam ID is known, skip this step.

GET /users/{userId}/courses/{courseId}/items

3. Get the array of exam IDs associated with the user (the user's exam instance IDs) from course items. If the specific exam ID is known, skip this step.

GET /users/{userId}/courses/{courseId}/exams

  • If the specific exam ID is not in the list of returned exam IDs, user did not start the exam or the exam was reset (exam instance was deleted). If this true, this use case is completed.
  • If the specific exam ID is in the list of returned exam IDs, exam instance was created for user.
User continues exam. 4. Get user's attempts instance ID (where user's answers were stored) for exam ID.

GET /users/{userId}/courses/{courseId}/exams/{examId}/attempts

  • If there is no attempts ID for the exam ID, then the attempts instance was not created for the user ID. If this true, this use case is completed.
  • If there is an attempts ID for the exam ID, attempts instance was created for user.
5. Confirm that the exam attempt is still in progress.
  • If the isCompleted attribute is set true, the exam attempt is marked as completed and no further change to the attempts instance is allowed. If this is true, this use case is completed.
  • If the isCompleted attribute is set false, the exam attempt is still in progress and the user can continue the exam attempt.
  • The exam token is in the attempts instance response body and must be included in the request header for all changes to the attempts instance.
6. Get exam structure.

 

  a. Get array of sections within exam.

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections

 

  b. Get array of questions for each section. Repeat for each section in exam.

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/questions

Optionally, the question count, question types, and total number of possible points can be displayed to the user.
7. Get exam contents (data and choices for each question type). Repeat for each question of the same type within each section.

 

  a. Get True/False question and array of choices.

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/trueFalseQuestions/{questionId}

 

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/trueFalseQuestions/{questionId}/choices

 

  b. Get Multiple-Choice question and array of choices.

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/multipleChoiceQuestions/{questionId}

 

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/multipleChoiceQuestions/{questionId}/choices

 

  c. Get Many Multiple-Choice question and array of choices.

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/manyMultipleChoiceQuestions/{questionId}

 

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/manyMultipleChoiceQuestions/{questionId}/choices

 

  d. Get Matching question, array of premises, and array of choices.

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/matchingQuestions/{questionId}

 

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/matchingQuestions/{questionId}/premises

 

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/matchingQuestions/{questionId}/choices

 

  e. Get Short Answer question.

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/shortQuestions/{questionId}

 

  f. Get Essay question.

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/essayQuestions/{questionId}

 

  g. Get Fill-in-the-Blank question.

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/fillintheblankQuestions/{questionId}

 

Optionally, the sequence can be GET each question and then submit its answer instead of GET all questions and then submit each answer as it is completed. Be sure to repeat for all questions in a section and all sections in an exam.
User submits answers.

8. Add answer for each question.

POST /users/{userId}/courses/{courseId}/exams/{examId}/attempts/{attemptId}/answers/{answerId}

 

  • {answerId}={questionId} being answered.
  • POST each answer ID only once. Repeating the POST to an existing answer will return an error.
User changes previously submitted answer. 9. Get answer.

GET /users/{userId}/courses/{courseId}/exams/{examId}/attempts/{attemptId}/answers/{answerId}

 

10. Update answer.

PUT /users/{userId}/courses/{courseId}/exams/{examId}/attempts/{attemptId}/answers/{answerId}

If user manually completes exam...

11. Update attempt to completed status.

PUT /users/{userId}/courses/{courseId}/exams/{examId}/attempts/{attemptId}

  • Attempt instance is locked against any further changes.
  • Response body includes exam end time and links to user's exam instance and attempt instance.
  • Automatic processing occurs (for example, auto-grading if it had been enabled, notifications sent, etc.).
If exam duration is about to expire... 12. POST/PUT any saved answers before the exam duration expires (see steps 7 through 9).

 

13. Update attempt to completed status (see step 11).

  • Attempt instance is locked against any further changes once the Pearson_exam_token expires. The exam duration is calculated using the LearningStudio server time.
  • Any answers that are not POST/PUT to the attempt instance will be blocked once the Pearson_exam_token expires.
If exam duration expires... 14. Update attempt to completed status (see step 11).
  • Attempt instance is locked against any further changes.
  • Automatic processing occurs (for example, auto-grading if it had been enabled, notifications sent, etc.).
Optionally, display a summary of the grading results.

Review Exam Attempt

3101 reads
Always Learning
Pearson