Question
The Question object
The Question object looks like this in JSON:
{
"object": "question",
"id": 443,
"owner_type": "course",
"owner_id": 1064,
"type": "order",
"question": "What are the colors of the rainbow?",
"randomize_options": false,
"allow_partial_credit": false,
"case_sensitive": false,
"word_count": null,
"allowed_file_types": null,
"file_id": null,
"status": "active",
"added_time": "2010-06-07T23:08:12+00:00",
"import_id": null,
"essay_notes": null,
"description": null,
"added_by_id": 1257,
"sandbox": true
}
| Attribute | Required | Data Type |
|---|---|---|
| id | Yes | int |
| owner_type | Yes | enum (course) |
| owner_id | Yes | int |
| type | Yes | enum (short_answer, multiple_choice, order, essay, multiple_answer, true_false, matching, fill_in_the_blank, file_upload) |
| question | Yes | text |
| randomize_options | Yes | bool |
| allow_partial_credit | Yes | bool |
| case_sensitive | Yes | bool |
| word_count | No | int |
| allowed_file_types | No | json |
| file_id | Yes | int |
| status | Yes | enum (active, deleted) |
| added_time | Yes | datetime |
| import_id | No | int |
| essay_notes | No | text |
| description | No | text |
| added_by_id | No | int |
| sandbox | No | bool |
index
Example code to call this method:
curl "https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \
-X GET
require 'httparty'
response = HTTParty.get(
'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questions',
headers: {
'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
},
)
puts response.body
import requests
response = requests.get(
'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questions',
headers={
'Authorization': 'Bearer YOUR_POPULI_API_KEY'
},
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questions"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questions');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);
Example response:
{
"object": "list",
"count": 1,
"results": 1,
"results_per_page": null,
"pages": 1,
"page": 1,
"offset": 0,
"has_more": false,
"data": [
{
"object": "question",
"id": 500,
"owner_type": "course",
"owner_id": 576,
"type": "order",
"question": "What are the colors of the rainbow?",
"randomize_options": false,
"allow_partial_credit": false,
"case_sensitive": false,
"word_count": null,
"allowed_file_types": null,
"file_id": null,
"status": "active",
"added_time": "2022-06-07T23:08:12+00:00",
"import_id": null,
"essay_notes": null,
"description": null,
"added_by_id": 1257
}
],
"sandbox": true
}
Retrieves all Question objects tied to a specific Catalogcourse.
HTTP Request
GET /catalogcourses/(catalogcourse)/questions
Parameters
None
Permissions
One of the following roles is required to call this method:
- Academic Auditor
- Academic Admin
- Registrar
show
Example code to call this method:
curl "https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questions/(question)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \
-X GET
require 'httparty'
response = HTTParty.get(
'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questions/(question)',
headers: {
'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
},
)
puts response.body
import requests
response = requests.get(
'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questions/(question)',
headers={
'Authorization': 'Bearer YOUR_POPULI_API_KEY'
},
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questions/(question)"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questions/(question)');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);
Example response:
{
"object": "question",
"id": 500,
"owner_type": "course",
"owner_id": 576,
"type": "order",
"question": "What are the colors of the rainbow?",
"randomize_options": false,
"allow_partial_credit": false,
"case_sensitive": false,
"word_count": null,
"allowed_file_types": null,
"file_id": null,
"status": "active",
"added_time": "2022-06-07T23:08:12+00:00",
"import_id": null,
"essay_notes": null,
"description": null,
"added_by_id": 1257,
"sandbox": true
}
Retrieves a specific Question object.
HTTP Request
GET /catalogcourses/(catalogcourse)/questions/(question)
Parameters
No additional parameters are needed beyond the ID of the object being requested that appears in the URL.
Expandable Properties
- options
- categories
Permissions
One of the following roles is required to call this method:
- Academic Auditor
- Academic Admin
- Registrar