Contents
On this page
List Exams with Attempts - Plugixa Exam
GET /plugixa-exam/v1/analytics/exams
List every exam that is not in the trash, with how many finished, scored attempts it has. Use the ids with the per-exam reports.
Scope reports:read; the token’s user needs the reports:view permission. Needs Plugixa Exam Pro with the Analytics app on in Plugixa Exam -> App Manager (it also needs the Notifications app); with it off, this route answers 404.
Request
GET https://your-site.example/wp-json/plugixa-exam/v1/analytics/exams
Responses
200 OK. data is the list of exams.
Sorted by title, published or not, including exams nobody has sat. Not paged.
{
"success": true,
"data": [
{ "id": 5, "title": "Algebra Basics", "attempts": 0 },
{ "id": 7, "title": "Algebra Midterm", "attempts": 38 },
{ "id": 6, "title": "Fractions Quiz", "attempts": 112 }
]
}
| Field | Type | Meaning |
|---|---|---|
data[].id |
integer |
The exam’s id, for the per-exam reports |
data[].title |
string |
The exam’s title |
data[].attempts |
integer |
Attempts that are no longer in progress and have a score |
Errors
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-exam/v1/analytics/exams" \
-H "Authorization: Bearer $PLUGIXA_EXAM_TOKEN"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/analytics/exams');
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/analytics/exams', {
headers: {
'Authorization': `Bearer ${process.env.PLUGIXA_EXAM_TOKEN}`,
},
});
const { data } = await response.json();
Quick Links
Share