List

Resource: /api/v2/assessment_question_sections

HTTPS Request Method: GET

Description: A list of assessment question sections that match the specified parameters. If no optional parameters are specified, the full list of assessment question sections associated with the account is returned.

Results are limited to 5000 records.

Required Parameters:

  • api_key

Optional Parameters:

The following optional parameters must be within the a assessment_question_section key:

  • id
  • assessment_id
  • name
  • completions_min
  • assessments_questions_count
  • created_at
  • updated_at
  • single_timeline
  • mastery_score

Dates and datetimes should be in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format and can be given as ranges if separated by a comma.

The following optional parameters should be outside of the assessment_question_section key:

  • per_page (allows ability to set number of results per page)
  • page (page of paginated results you would like)

Note: the default number of results is 50 per page.

Example Requests and Responses:

Simple Request with No Optional Parameters:

curl -X GET -d '{"api_key": "123456"}' -H "Content-type: application/json" -H "Accept: application/json" http://your-subdomain.exceedlms.com/api/v2/assessment_question_sections

Example Response:

[
  {
    "id": 1,
    "position": null,
    "name": "Default",
    "completions_min": 0,
    "single_timeline": false,
    "mastery_score": null,
    "assessments": [
      {
        "id": 1,
        "assessment_type": "assessment",
        "pass_message": null,
        "fail_message": null,
        "is_random_choices": false,
        "instructions": null,
        "course": {
          "id": 14,
          "name": "Kshlerin, Schuster and Murazik 101"
        }
      }
    ]
  },
  {
    "id": 2,
    "position": null,
    "name": "Section Uno",
    "completions_min": 0,
    "single_timeline": false,
    "mastery_score": null,
    "assessments": [
      {
        "id": 1,
        "assessment_type": "assessment",
        "pass_message": null,
        "fail_message": null,
        "is_random_choices": false,
        "instructions": null,
        "course": {
          "id": 14,
          "name": "Kshlerin, Schuster and Murazik 101"
        }
      }
    ]
  }
]

Note: The "position" value will be null unless you provide the optional "assessment_id" parameter as shown in the next example.

Request with Optional Parameters Example:

You must include the assessment_id in order to get the position value since assessment question sections (pools) can be shared among assessments and might have a different position within each assessment.

curl -X GET -d '{"api_key": "123456", "assessment_question_section":{"assessment_id":"1"}}' -H "Content-type: application/json" -H "Accept: application/json" http://your-subdomain.exceedlms.com/api/v2/assessment_question_sections

Example Response:

[
  {
    "id": 1,
    "position": 1,
    "name": "Default",
    "completions_min": 0,
    "single_timeline": false,
    "mastery_score": null,
    "assessments": [
      {
        "id": 1,
        "assessment_type": "assessment",
        "pass_message": null,
        "fail_message": null,
        "is_random_choices": false,
        "instructions": null,
        "course": {
          "id": 14,
          "name": "Kshlerin, Schuster and Murazik 101"
        }
      }
    ]
  },
  {
    "id": 2,
    "position": 2,
    "name": "Section Uno",
    "completions_min": 0,
    "single_timeline": false,
    "mastery_score": null,
    "assessments": [
      {
        "id": 1,
        "assessment_type": "assessment",
        "pass_message": null,
        "fail_message": null,
        "is_random_choices": false,
        "instructions": null,
        "course": {
          "id": 14,
          "name": "Kshlerin, Schuster and Murazik 101"
        }
      }
    ]
  }
]

Request Using Pagination Example:

curl -X GET -d '{"api_key": "123456", "per_page":"3", "page":"1"}' -H "Content-type: application/json" -H "Accept: application/json" http://your-subdomain.exceedlms.com/api/v2/assessment_question_sections

Example Response:

[
  {
    "id": 1,
    "position": null,
    "name": "Default",
    "completions_min": 0,
    "single_timeline": false,
    "mastery_score": null,
    "assessments": [
      {
        "id": 1,
        "assessment_type": "assessment",
        "pass_message": null,
        "fail_message": null,
        "is_random_choices": false,
        "instructions": null,
        "course": {
          "id": 14,
          "name": "Kshlerin, Schuster and Murazik 101"
        }
      }
    ]
  },
  {
    "id": 42,
    "position": null,
    "name": "Default",
    "completions_min": 0,
    "single_timeline": false,
    "mastery_score": null,
    "assessments": [
      {
        "id": 30,
        "assessment_type": "assessment",
        "pass_message": null,
        "fail_message": null,
        "is_random_choices": false,
        "instructions": null,
        "course": {
          "id": 81,
          "name": "Another New Assessment from the API"
        }
      }
    ]
  },
  {
    "id": 23,
    "position": null,
    "name": "Default",
    "completions_min": 0,
    "single_timeline": false,
    "mastery_score": null,
    "assessments": [
      {
        "id": 13,
        "assessment_type": "assessment",
        "pass_message": null,
        "fail_message": null,
        "is_random_choices": false,
        "instructions": null,
        "course": {
          "id": 65,
          "name": "The final new name"
        }
      }
    ]
  }
]




Read

Resource: /api/v2/assessment_question_sections/id_of_resource

HTTPS Request Method: GET

Description: A single assessment question section that matches the id passed in.

Required Parameters:

  • api_key
  • id of resource at end of url

Example Request:

curl -X GET -d '{"api_key": "123456"}' -H "Content-type: application/json" -H "Accept: application/json" http://your-subdomain.exceedlms.com/api/v2/assessment_question_sections/1

Example Response:

{
  "id": 1,
  "position": null,
  "name": "Default",
  "completions_min": 0,
  "single_timeline": false,
  "mastery_score": null,
  "assessments": [
    {
      "id": 1,
      "assessment_type": "assessment",
      "pass_message": null,
      "fail_message": null,
      "is_random_choices": false,
      "instructions": null,
      "course": {
        "id": 14,
        "name": "Kshlerin, Schuster and Murazik 101"
      }
    }
  ]
}

Note: The "position" value will be null unless you provide the optional "assessment_id" parameter as shown in the next example.

Request with Optional Parameters Example:

You must include the "assessment_id" in order to get the "position" value since assessment question sections (pools) can be shared among assessments and might have a different position within each assessment.

Example Request:

curl -X GET -d '{"api_key": "123456", "assessment_question_section":{"assessment_id":"21"}}' -H "Content-type: application/json" -H "Accept: application/json" http://your-subdomain.exceedlms.com/api/v2/assessment_question_sections/36

Example Response:

{
  "id": 36,
  "name": "Pool 1",
  "completions_min": 0,
  "single_timeline": false,
  "mastery_score": null,
  "position": 2,
  "assessments": [
    {
      "id": 21,
      "name": "Another Test Assessment",
      "assessment_type": "assessment",
      "pass_message": null,
      "fail_message": null,
      "is_random_choices": false,
      "instructions": null,
      "course_assessment": {
        "id": 52,
        "name": "Another Test Assessment"
      }
    }
  ]
}




Create

Resource: /api/v2/assessment_question_sections

HTTPS Request Method: POST

Description: Creates a new assessment question section object.

Required Parameters:

  • api_key
  • Either course[code], course[id] or assessment[id]
  • assessment_question_section[name]

Optional Parameters:

The following optional parameters must be within the a assessment_question_section key:

  • completions_min
  • single_timeline
  • mastery_score

Note: The following parameters are limited to 255 characters:

assessment_question_section[name]

Example Request:

curl -X POST -d '{"api_key": "123456", "course":{"id":"14"}, "assessment_question_section":{"name":"This is a section created from the API"}}' -H "Content-type: application/json" -H "Accept: application/json" http://your-subdomain.exceedlms.com/api/v2/assessment_question_sections

Or

curl -X POST -d '{"api_key": "123456", "assessment":{"id":"1"}, "assessment_question_section":{"name":"This is a section created from the API"}}' -H "Content-type: application/json" -H "Accept: application/json" http://your-subdomain.exceedlms.com/api/v2/assessment_question_sections 

Example Response:

{
  "id": 44,
  "position": 3,
  "name": "This is a section created from the API",
  "completions_min": 0,
  "single_timeline": false,
  "mastery_score": null,
  "assessments": [
    {
      "id": 1,
      "assessment_type": "assessment",
      "pass_message": null,
      "fail_message": null,
      "is_random_choices": false,
      "instructions": null,
      "course": {
        "id": 14,
        "name": "Kshlerin, Schuster and Murazik 101"
      }
    }
  ]
}




Update

Resource: /api/v2/assessment_question_sections/id_of_resource

HTTPS Request Method: PATCH or PUT

Description: Updates an assessment question section object.

Required Parameters:

  • api_key
  • id of resource at end of url

Optional Parameters:

The following optional parameters must be within the assessment_question_section key:

  • name
  • completions_min
  • single_timeline
  • mastery_score

Example Request:

curl -X PATCH -d '{"api_key": "123456", "assessment_question_section":{"name":"This is a new name change created from the API"}}' -H "Content-type: application/json" -H "Accept: application/json" http://your-subdomain.exceedlms.com/api/v2/assessment_question_sections/51

Example Response:

{
  "id": 51,
  "position": null,
  "name": "This is a new name change created from the API",
  "completions_min": 0,
  "single_timeline": false,
  "mastery_score": 100,
  "assessments": [
    {
      "id": 37,
      "name": "A Whole Lotta Party and a Review copy",
      "assessment_type": "assessment",
      "pass_message": null,
      "fail_message": null,
      "is_random_choices": false,
      "instructions": "",
      "course_assessment": {
        "id": 106,
        "name": "A Whole Lotta Party and a Review copy"
      }
    }
  ]
}

Note: The "position" value will be null because the assessment question section (pool) can have a different position for each assessment so we can only return it in the context of a specific assessment.




Delete

Resource: /api/v2/assessment_question_sections/id_of_resource

HTTPS Request Method: DELETE

Description: Destroys an assessment question section object.

Required Parameters:

  • api_key
  • id of resource at end of url

**WARNING**: Deleting this object will also destroy all related:

  • assessment_questions
  • assessment_question_actions

Example Request:

curl -X DELETE -d '{"api_key": "123456"}' -H "Content-type: application/json" -H "Accept: application/json" http://your-subdomain.exceedlms.com/api/v2/assessment_question_sections/51

Example Response:

{
  "id": 51,
  "position": null,
  "name": "This is a new name change created from the API",
  "completions_min": 0,
  "single_timeline": false,
  "mastery_score": 100,
  "assessments": [
    {
      "id": 37,
      "name": "A Whole Lotta Party and a Review copy",
      "assessment_type": "assessment",
      "pass_message": null,
      "fail_message": null,
      "is_random_choices": false,
      "instructions": "",
      "course_assessment": {
        "id": 106,
        "name": "A Whole Lotta Party and a Review copy"
      }
    }
  ]
}

Note: Even though we respond with the object, rest assured it has been removed from our system. Subsequent calls to delete it will result in an error.



Update Question Order

Resource: /api/v2/assessment_question_sections/id_of_resource/update_question_order

HTTPS Request Method: PUT

Description: Updates the order of assessment questions belonging to the assessment question section.

Required Parameters:

  • api_key
  • id of resource at end of url
  • question_order (JSON array of question ids in order)

Example Request:

curl -X "PUT" "http://demo.exceedlms.test:3000/api/v2/assessment_question_sections/31/update_question_order?api_key=123456" -H 'Content-Type: application/json' -H 'Accept: application/json' -d $'{ "question_order": [202, 213 ]}'

Response:

  • on success: a 200 HTTP code
  • on failure: a 422 HTTP code with an array of the errors in the body