Pearson
Always Learning

API Group: 

Use this API to get the answer choices for a Matching Question. The choices are the predefined possible answers for a question. During the exam, you save the the choice ID for the user's selected answer, along with the premise ID and question ID. There must be an active attempt in order to use this API with a user's OAuth 2 Access Token.



Supported Roles and Authentication Protocols

Type Supported Values
Authentication Protocols OAuth 1.0a, OAuth 2.0
Valid for Roles (OAuth 2): Professor, Teaching Assistant, Student, Administrator

API Request

API Endpoints

HTTP Verbs and URIs

GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/matchingQuestions/{questionId}/choices
  • Retrieves all available answer choices for a question.
GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/matchingQuestions/{questionId}/choices/{choiceId}
  • Retrieves a specific answer choice.

Parameters

Parameter Description Valid Values
{userId} LearningStudio User ID or relevant user overload.
  • Numeric ID issued by LearningStudio
  • loginid={clientString}|{username}
  • or replace /users/{userId} with /me
    (OAuth 2 only)
{courseId} LearningStudio Course ID or relevant course overload.
  • Numeric ID issued by LearningStudio
  • ccn={callNumber}
{examId} LearningStudio Exam ID. Numeric ID issued by LearningStudio
{sectionId} LearningStudio Exam Section ID. Numeric ID issued by LearningStudio
{questionId} LearningStudio Question ID. Note that answer IDs are the same value as question IDs. Numeric ID issued by LearningStudio
{choiceId} LearningStudio Choice ID. Numeric ID issued by LearningStudio
{.format} Desired format of response data. See Response Formats. .json , .xml , or Blank

Request HTTP Headers

In addition to the standard Authentication headers, you will need headers that regulate Exam Security. See Exam Security.

Format

Pearson-Exam-Password: {examPassword}
Pearson-Exam-Token: {examToken}

Parameter Descriptions

Name Description Valid Values Required
{examPassword} A password provided by the teacher. This is not retrievable by API. Exam Security Plain text string Only if set by teacher, for all verbs
{examToken} The Pearson Exam Token provided by a POST or GET to this API Plain text string Always for PUT

Query String Parameters

No Query String Parameters are supported.

Request Body

None.

API Response

Response Header

This API returns the standard HTTP Status Codes used by the LearningStudio APIs. There are no special headers returned by the API.

Response Body

Format

{
  "choices" : [{
    "id" : {choiceId},
    "text" : "{choiceText}",
    "links" : [{
      "href" : "{questionTextHref}",
      "rel" : "http://api.learningstudio.com/rels/user/course/exam/section/matchingQuestion"
    }]
  },{
    "id" : {choiceId},
    "text" : "{choiceText}",
    "links" : [{
      "href" : "{questionTextHref}",
      "rel" : "http://api.learningstudio.com/rels/user/course/exam/section/matchingQuestion"
    }]
  },{
    "id" : {choiceId},
    "text" : "{choiceText}",
    "links" : [{
      "href" : "{questionTextHref}",
      "rel" : "http://api.learningstudio.com/rels/user/course/exam/section/matchingQuestion"
    }]
  }]
}

Property Descriptions

Name Description
{choiceId} LearningStudio Choice ID.
{choiceText} Text of the answer option.
{questionTextHref} Link to the related question's text.

Example

Request

Endpoint

GET /users/88888/courses/123456/exams/419663/sections/67890/matchingQuestions/11111/choices

HTTP Headers

Pearson-Exam-Token: XVNQEQIXDRYATw4JBFZJAkFYUVEOBBdeW14ICVxBClwBXVBACQYOXAYJRFAH==

Response

Body

{
  "choices" : [{
    "id" : 1,
    "text" : "Red",
    "links" : [{
      "href" : "https://api.learningstudio.com/users/88888/courses/123456/exams/419663/sections/67890/matchingQuestions/11111",
      "rel" : "https://api.learningstudio.com/rels/user/course/exam/section/matchingQuestion"
    }]
  },{
    "id" : 2,
    "text" : "Blue",
    "links" : [{
      "href" : "https://api.learningstudio.com/users/88888/courses/123456/exams/419663/sections/67890/matchingQuestions/11111",
      "rel" : "https://api.learningstudio.com/rels/user/course/exam/section/matchingQuestion"
    }]
  },{
    "id" : 3,
    "text" : "Green",
    "links" : [{
      "href" : "https://api.learningstudio.com/users/88888/courses/123456/exams/419663/sections/67890/matchingQuestions/11111",
      "rel" : "https://api.learningstudio.com/rels/user/course/exam/section/matchingQuestion"
    }]
  },{
    "id" : 4,
    "text" : "Fuschia",
    "links" : [{
      "href" : "https://api.learningstudio.com/users/88888/courses/123456/exams/419663/sections/67890/matchingQuestions/11111",
      "rel" : "https://api.learningstudio.com/rels/user/course/exam/section/matchingQuestion"
    }]
  }]
}
3084 reads
Always Learning
Pearson