Pearson
Always Learning

API Group: 

Use this API to get the answer premises for a Matching Question. The premises are the text to which the user will match the answer choices. During the exam, you save the the premise ID and choice ID for the user's selected answer (along with the 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}/premises
  • Retrieves all available answer premises for a question.
GET /users/{userId}/courses/{courseId}/exams/{examId}/sections/{sectionId}/matchingQuestions/{questionId}/premises/{premiseId}
  • Retrieves a specific answer premise.

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
{premiseId} LearningStudio Premise 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

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

Property Descriptions

Name Description
{premiseId} LearningStudio Premise ID.
{premiseText} Text of the answer premise.
{questionTextHref} Link to the related question's text.

Example

Request

Endpoint

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

HTTP Headers

Pearson-Exam-Token: XVNQEQIXDRYATw4JBFZJAkFYUVEOBBdeW14ICVxBClwBXVBACQYOXAYJRFAH==

Response

Body

{
  "premises" : [{
    "id" : 1,
    "text" : "Colorado",
    "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" : "New Jersey",
    "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" : "Michigan",
    "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" : "Ontario",
    "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"
    }]
  }]
}
2928 reads
Always Learning
Pearson