Developer Platform (January 2020)

Quizzes

«  Release Conditions   ·  [   home  ·   reference  ·   community   |   search  ·   index   ·  routing table   ·  scopes table   ]   ·  Assessments and rubrics  »

Contents

Attributes

LATESUBMISSIONOPTION_T

Late submission allowances can be accommodated in several ways. We use the term LATESUBMISSIONOPTION_T to stand in for an appropriate integer type.

Late submission option

Value

AllowNormalSubmission

0

UseLateLimit

1

AutoSubmitAttempt

2

OverallGradeCalculation_T

The grade calculation for a quiz, where multiple attempts are allowed. We use the term OverallGradeCalculation_T to stand in for an appropriate integer type.

Overall Grade Calculation Option

Value

Highest Attempt

1

Lowest Attempt

2

Average of all Attempts

3

First Attempt

4

Last Attempt

5

QuizReadData

When the service sends you information about a quiz, it will send back a JSON structure like this:

{
    "QuizId": <number:D2LID>,
    "Name": <string>,
    "IsActive": <boolean>,
    "SortOrder": <number>,
    "AutoExportToGrades": <boolean>|null,
    "GradeItemId": <number:D2LID>|null,
    "IsAutoSetGraded": <boolean>,
    "Instructions": {
        "Text": { <composite:RichText> },
        "IsDisplayed": <boolean>
    },
    "Description": {
        "Text": { <composite:RichText> },
        "IsDisplayed": <boolean>
    },
    "StartDate": <string:UTCDateTime>|null,
    "EndDate": <string:UTCDateTime>|null,
    "DueDate": <string:UTCDateTime>|null,
    "DisplayInCalendar": <boolean>,
    "AttemptsAllowed": {
        "IsUnlimited": <boolean>,
        "NumberOfAttemptsAllowed": <number>|null
    },
    "LateSubmissionInfo": {
        "LateSubmissionOption": <number:LATESUBMISSIONOPTION_T>,
        "LateLimitMinutes": <number>|null
    },
    "SubmissionTimeLimit": {
        "IsEnforced": <boolean>,
        "ShowClock": <boolean>,
        "TimeLimitValue": <number>
    },
    "SubmissionGracePeriod": <number>|null,
    "Password": <string>,
    "Header": {  // Added with LE API v1.39
        "Text": { <composite:RichText> },
        "IsDisplayed": <boolean>
    },
    "Footer": {  // Added with LE API v1.39
        "Text": { <composite:RichText> },
        "IsDisplayed": <boolean>
    },
    "AllowHints": <boolean>,  // Added with LE API v1.39
    "DisableRightClick": <boolean>,  // Added with LE API v1.39
    "DisablePagerAndAlerts": <boolean>,  // Added with LE API v1.39
    "NotificationEmail": <string>,  // Added with LE API v1.39
    "CalcTypeId": <number:OverallGradeCalculation_T>,  // Added with LE API v1.39
    "RestrictIPAddressRange": [  // Added with LE API v1.39
        {
            "IPRangeStart": <string>,
            "IPRangeEnd": <string>|null
        }
    ],
    "CategoryId": <number>|null  // Added with LE API v1.40
}
AttemptsAllowed

If the IsUnlimited property is True, then the NumberOfAttemptsAllowed property will be null; if IsUnlimited is False, then NumberOfAttemptsAllowed will contain the number of attempts allowed (default value is 1).

Instructions and Description

These rich text properties can be displayed, or hidden, upon presentation of the quiz to those taking it (based on the value of the IsDisplayed property).

Password

If not null (and visible to the calling user context), the current password set for the quiz.

RestrictIpAddressRange

Null, or, if some IP address ranges are restricted, a list of start-end pairs that describe the restricted ranges. Within each range, both the range-start and range-end strings must be valid IPv4 addresses; if a range has range-start string, but null for the range-end, then this restricts all IP address after than the range-start address.

QuizData

When updating quiz data, use a JSON structure like this:

{
    "Name": <string>,
    "IsActive": <boolean>,
    "SortOrder": <number>,
    "AutoExportToGrades": <boolean>|null,
    "GradeItemId": <number:D2LID>|null,
    "IsAutoSetGraded": <boolean>,
    "Instructions": {
        "Text": { <composite:RichTextInput> },
        "IsDisplayed": <boolean>
    },
    "Description": {
        "Text": { <composite:RichTextInput> },
        "IsDisplayed": <boolean>
    },
    "StartDate": <string:UTCDateTime>|null,
    "EndDate": <string:UTCDateTime>|null,
    "DueDate": <string:UTCDateTime>|null,
    "DisplayInCalendar": <boolean>,
    "NumberOfAttemptsAllowed": <number>|null,  // Added with LE API v1.39
    "LateSubmissionInfo": {  // Added with LE API v1.39
        "LateSubmissionOption": <number:LATESUBMISSIONOPTION_T>,
        "LateLimitMinutes": <number>|null
    },
    "SubmissionTimeLimit": {  // Added with LE API v1.39
        "IsEnforced": <boolean>,
        "ShowClock": <boolean>,
        "TimeLimitValue": <number>
    },
    "SubmissionGracePeriod": <number>|null,  // Added with LE API v1.39
    "Password": <string>,  // Added with LE API v1.39
    "DisplayInCalendar": <boolean>,
    "Header": {  // Added with LE API v1.39
        "Text": { <composite:RichTextInput> },
        "IsDisplayed": <boolean>
    },
    "Footer": {  // Added with LE API v1.39
        "Text": { <composite:RichTextInput> },
        "IsDisplayed": <boolean>
    },
    "AllowHints": <boolean>,  // Added with LE API v1.39
    "DisableRightClick": <boolean>,  // Added with LE API v1.39
    "DisablePagerAndAlerts": <boolean>,  // Added with LE API v1.39
    "NotificationEmail": <string>,  // Added with LE API v1.39
    "CalcTypeId": <number:OverallGradeCalculation_T>,  // Added with LE API v1.39
    "RestrictIPAddressRange": null|[  // Added with LE API v1.39
        {
            "IPRangeStart": <string>,
            "IPRangeEnd": <string>|null
        }, ...
    ],
    "CategoryId": <number>|null  // Added with LE API v1.40
}
RestrictIpAddressRange

Null, or, if some IP address ranges are restricted, a list of start-end pairs that describe the restricted ranges. Within each range, both the range-start and range-end strings must be valid IPv4 addresses; if a range has range-start string, but null for the range-end, then this restricts all IP address after than the range-start address.

NumberOfAttemptsAllowed

Must be between 1 and 10 inclusive or null for unlimited.

TimeLimitValue

Represented in minutes.

SubmissionGracePeriod

Represented in minutes. Only allowed to be null when SubmissionTimeLimit.IsEnfored is false.

Password

Must not be an empty string or whitespace.

Quiz Categories

QuizCategoryData

When creating or updating a quiz category, use a structure like this:

{
    "Name": <string>,
    "SortOrder": <number>
}
QuizCategoryReadData

When the service sends you information about a quiz category, it will send back a JSON structure like this:

{
    "CategoryId": <number:D2LID>,
    "Name": <string>,
    "SortOrder": <number>
}

Questions

QUESTION_T

Quizzing supports questions that assess answers in a variety of ways. We use the term QUESTION_T to stand in for an appropriate integer type.

Question Type

Value

MultipleChoice

1

TrueFalse

2

FillInTheBlank

3

MultiSelect

4

Matching

5^

Ordering

6^

LongAnswer

7

ShortAnswer

8

Likert

9^

ImageInfo

10^

TextInfo

11^

Arithmetic

12^

SignificantFigures

13^

MultiShortAnswer

14

^ QuestionInfo will be null for the these question types.

EVALULATION_T

The questions have several evaluation types. We use the term EVALULATION_T to stand in for an appropriate integer type.

Evaluation Type

Value

CaseInsensitive

0

CaseSensitive

1

RegularExpression

2

ENUMERATION_T

The questions have several evaluation types. We use the term ENUMERATION_T to stand in for an appropriate integer type.

Enumeration

Value

Numbers

1

Roman Numerals

2

UpperCase Roman Numerals

3

Letters

4

UpperCase Letters

5

No Enumeration

6

GRADINGRULE_T

The questions have grading rules. We use the term GRADINGRULE_T to stand in for an appropriate integer type.

Grading Rule

Value

All or Nothing

0

Right minus wrong

1

Correct answers

2

Equally weighted

3

STYLE_T

The questions have style options. We use the term STYLE_T to stand in for an appropriate integer type.

Style

Value

Horizontal

1

Vertical

2

Dropdown

3

Question.QuestionData

When the service sends you information about a quiz question, it will send back a JSON structure like this:

{
   "QuestionId": <number:D2LID>,
   "QuestionTypeId": <number:QUESTION_T>,
   "Name": <string> | null,
   "QuestionText": {<composite:RichText>},
   "Points": <number>,
   "Difficulty": <number>,
   "Bonus": <boolean>,
   "Mandatory": <boolean>,
   "Hint": {<composite:RichText>},
   "Feedback": {<composite:RichText>},
   "Last Modified Date": <utcdatetime>,
   "Last Modified By": <number:D2LID> | null,
   "SectionId": <number:D2LID>,
   "QuestionTemplateId": <number:D2LID>,
   "QuestionTemplateVersionId": <number:D2LID>,
   "QuestionInfo": <composite:QuestionInfo>
}

Each question type adds its own set of QuestionInfo.

Question.QuestionInfo

Multiple Choice. Question info of the MultipleChoice type (1), have these properties:

{
   "Answers": [
       {
       "Answer": <string>,
       "AnswerFeedback": <string>,
       "Weight": <number>
       }, ...
   ],
   "Randomize": <boolean>,
   "Enumeration": <number:ENUMERATION_T>
}

True-False. Question info of the TrueFalse type (2) have these properties:

{
   "TrueWeight": <number>,
   "FalseWeight": <number>,
   "TrueFeedback": <string>,
   "FalseFeedback": <string>,
   "Enumeration": <number:ENUMERATION_T>
}

Fill In The Blank. Question info of the FillInTheBlank type (3) have these properties:

{
   "Texts": [
       {
       "Text": {<composite:RichText>}
       }, ...
   ],
   "Blanks": [
       {
       "Size": <number>,
       "Answer": [
          {
             "TextAnswer": <string>,
             "Weight": <number>,
             "EvaluationType": <number:EVALULATION_T>
          }, ...
       ]
       }, ...
   ]
}

Multi-Select. Question info of the MultiSelect type (4), add have these properties:

{
    "Answers": [
        {
           "Answer": <string>,
           "AnswerFeedback": {<composite:RichText>},
           "IsCorrect": <boolean>
        }, ...
    ],
    "Randomize": <boolean>,
    "Enumeration": <number:ENUMERATION_T>,
    "Style": <number:STYLE_T>,
    "GradingType": <number:GRADINGRULE_T>
}

Long Answer. Question info of the LongAnswer type (7) add have these properties:

{
   "EnableStudentEditor": <boolean>,
   "InitialText": {<composite:RichText>},
   "AnswerKey": {<composite:RichText>}
}

Short Answer. Question info of the ShortAnswer type (8) add have these properties:

{
   "Blanks":[
       {
       "Answers":[
            {
            "Text":<string>,
            "Weight":<number>
            }, ...
       ],
       "EvaluationType":<number:EVALULATION_T>
       }, ...
   ],
   "GradingType": <number:GRADINGRULE_T>
}

Multiple Short Answer. Question info of the MultipleShortAnswer type (14) add have these properties:

{
   "Boxes": <number>,
   "Rows": <number>,
   "Columns": <number>,
   "Answers": [
       {
       "AnswerText": <string>,
       "Weight": <number>,
       "EvaluationType": <number:EVALUATION_T>
       }, ...
   ]
}

Actions

Collections and Quizzes

DELETE /d2l/api/le/(version)/(orgUnitId)/quizzes/(quizId)

Delete a quiz.

Parameters
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • quizId (D2LID) – Quiz ID.

Oauth2 Scopes

quizzing:quizzes:delete

Status Codes
API Versions
  • 1.39+ – Route first appears in LMS v20.19.12.

GET /d2l/api/le/(version)/(orgUnitId)/quizzes/

Retrieve the quizzes belonging to an org unit.

Parameters
Oauth2 Scopes

quizzing:quizzes:read

Status Codes
API Versions
  • 1.34+ – Route first appears in LMS v20.19.5.

  • 1.28-1.33Deprecated as of LMS v20.20.1.

Return. This action returns an ObjectListPage JSON block containing a list of quizzes belonging to the org unit.

Note

This action only returns the quiz objects that the calling user context has permission to see. If the calling user has no permission to see any quiz objects, this action returns an empty result page.

GET /d2l/api/le/(version)/(orgUnitId)/quizzes/(quizId)

Retrieve a quiz.

Parameters
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • quizId (D2LID) – Quiz ID.

Oauth2 Scopes

quizzing:quizzes:read

Status Codes
API Versions
  • 1.34+ – Route first appears in LMS v20.19.5.

  • 1.28-1.33Deprecated as of LMS v20.20.1.

Return. This action returns a QuizReadData JSON block containing the properties of your identified quiz.

POST /d2l/api/le/(version)/(orgUnitId)/quizzes/

Create a new quiz.

Parameters
JSON Parameters
  • QuizData (QuizData) – Create quiz data.

Oauth2 Scopes

quizzing:quizzes:read quizzing:quizzes:create

Status Codes
API Versions
  • 1.39+ – Route first appears in LMS v20.19.12.

Return. This action returns a QuizReadData JSON block containing the properties of your quiz.

PUT /d2l/api/le/(version)/(orgUnitId)/quizzes/(quizId)

Update a quiz.

Parameters
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • quizId (D2LID) – Quiz ID.

JSON Parameters
  • QuizData (QuizData) – Updated quiz data.

Oauth2 Scopes

quizzing:quizzes:read quizzing:quizzes:write

Status Codes
API Versions
  • 1.34+ – Route first appears in LMS v20.19.5.

  • 1.33Deprecated as of LMS v20.20.1.

Input. Note that your provided block’s data replaces all the associated quiz’s properties on the service.

Return. This action returns a QuizReadData JSON block containing the updated properties of your quiz.

Quiz Categories

DELETE /d2l/api/le/(version)/(orgUnitId)/quizzes/categories/(categoryId)

Delete a quiz category.

Parameters
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • categoryId (D2LID) – Quiz Category ID.

Oauth2 Scopes

quizzing:quizzes:delete

Status Codes
API Versions
  • 1.39+ – Route first appears in LMS v20.19.12.

GET /d2l/api/le/(version)/(orgUnitId)/quizzes/categories/(categoryId)

Retrieve a quiz category.

Parameters
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • categoryId (D2LID) – Quiz Category ID.

Oauth2 Scopes

quizzing:quizzes:read

Status Codes
  • 200 OK – Action succeeded.

  • 403 Forbidden – No permission to view quizzes.

  • 404 Not Found – Org unit not found, or quiz category not found within Org unit.

API Versions
  • 1.39 – Route first appears in LMS v20.19.12

Return. This action returns a QuizCategoryReadData JSON block containing the properties of your identified quiz category.

GET /d2l/api/le/(version)/(orgUnitId)/quizzes/categories/

Retrieve the quiz categories belonging to an org unit.

Parameters
Oauth2 Scopes

quizzing:quizzes:read

Status Codes
API Versions
  • 1.39+ – Route first appears in LMS v20.19.12.

Return. This action returns an ObjectListPage JSON block containing a list of QuizCategoryReadData belonging to the org unit.

POST /d2l/api/le/(version)/(orgUnitId)/quizzes/categories/

Create a new quiz category.

Parameters
JSON Parameters
  • categoryData (QuizCategoryData) – Quiz category data for a new quiz category.

Oauth2 Scopes

quizzing:quizzes:read quizzing:quizzes:create

Status Codes
API Versions
  • 1.39+ – Route first appears in LMS v20.19.12.

Return. This action returns a QuizCategoryReadData JSON block containing the data for the newly created quiz category.

PUT /d2l/api/le/(version)/(orgUnitId)/quizzes/categories/(categoryId)

Update a quiz category.

Parameters
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • categoryId (D2LID) – Quiz Category ID.

JSON Parameters
Oauth2 Scopes

quizzing:quizzes:read quizzing:quizzes:write

Status Codes
API Versions
  • 1.39+ – Route first appears in LMS v20.19.12

Return. This action returns a QuizCategoryReadData JSON block containing the updated data for your quiz category.

Questions

GET /d2l/api/le/(version)/(orgUnitId)/quizzes/(quizId)/questions/

Retrieve all the questions in a quiz.

Parameters
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • quizId (D2LID) – Quiz ID.

Status Codes
API Versions
  • 1.40+ – Route first appears in LMS v20.20.1

Return. This action returns an ObjectListPage JSON block containing a list of QuestionData belonging to the quiz you specified, blocks for the segment following your bookmark parameter (or the first segment if that parameter is empty or missing).

«  Release Conditions   ·  [   home  ·   reference  ·   community   |   search  ·   index   ·  routing table   ·  scopes table   ]   ·  Assessments and rubrics  »