Contents
On this page
List Question Types - Plugixa Exam
GET /plugixa-exam/v1/questions/types
List every question type registered on the site, with how it is marked and whether it uses an option list.
Scope questions:read or lookups:read; the token’s user needs the questions:view permission.
Note. This is one of the three lookup lists
lookups:readopens, so a token holding only that scope can call it. The list is not paged.
Request
GET https://your-site.example/wp-json/plugixa-exam/v1/questions/types
Responses
200 OK. data is every registered type, in display order.
{
"success": true,
"data": [
{
"id": "mcq_single",
"label": "Multiple choice (single answer)",
"description": "One correct answer chosen from several options.",
"gradedBy": "auto",
"option_editor": "correct_single",
"options": "required"
},
{
"id": "true_false",
"label": "True / False",
"description": "A single true-or-false statement.",
"gradedBy": "auto",
"option_editor": "correct_single",
"options": "none"
},
{
"id": "essay",
"label": "Essay",
"description": "Long-form written response, graded manually.",
"gradedBy": "manual",
"option_editor": "correct_single",
"options": "none"
}
]
}
| Field | Type | Meaning |
|---|---|---|
data[].id |
string |
The type key to send as question_type |
data[].label |
string |
Display name, in the site’s language |
data[].description |
string |
One-line description |
data[].gradedBy |
string |
auto when the plugin marks it, manual when a marker does |
data[].option_editor |
string |
How the admin edits the option list. Defaults to correct_single |
data[].options |
string |
required when the type needs an option list, none when it has none. Module types may use other values |
The keys mix two spellings, gradedBy and option_editor: read them exactly as shown.
Errors
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-exam/v1/questions/types" \
-H "Authorization: Bearer $PLUGIXA_EXAM_TOKEN"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/questions/types');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('PLUGIXA_EXAM_TOKEN'),
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-exam/v1/questions/types', {
headers: {
'Authorization': `Bearer ${process.env.PLUGIXA_EXAM_TOKEN}`,
},
});
const { data } = await response.json();
Quick Links
Share