Contents
Get Exam Score Overview - Plugixa Exam
GET /plugixa-exam/v1/analytics/{exam}/overview
Read the headline figures of one exam: how many attempts were scored, the pass rate, the score spread, the average time and a score histogram.
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.
Only attempts that are no longer in progress and have a score are counted.
Note. An unknown exam id is not an error: it answers
200with every figure at zero.
Request
GET https://your-site.example/wp-json/plugixa-exam/v1/analytics/7/overview
Path parameters
| Name | Type | Description |
|---|---|---|
exam |
integer |
The exam’s id |
Responses
200 OK. data holds the figures.
{
"success": true,
"data": {
"attempts": 38,
"pass_count": 27,
"pass_rate": 71.1,
"mean": 68.4,
"median": 70,
"min": 22.5,
"max": 100,
"stddev": 15.2,
"avg_seconds": 1934,
"histogram": [
{ "bucket": "0-10", "count": 0 },
{ "bucket": "10-20", "count": 0 },
{ "bucket": "20-30", "count": 1 },
{ "bucket": "30-40", "count": 1 },
{ "bucket": "40-50", "count": 3 },
{ "bucket": "50-60", "count": 6 },
{ "bucket": "60-70", "count": 8 },
{ "bucket": "70-80", "count": 10 },
{ "bucket": "80-90", "count": 6 },
{ "bucket": "90-100", "count": 3 }
]
}
}
| Field | Type | Meaning |
|---|---|---|
data.attempts |
integer |
Scored attempts counted |
data.pass_count |
integer |
How many of them passed |
data.pass_rate |
number |
Percent that passed, to 1 decimal |
data.mean |
number |
Average score in percent, to 1 decimal |
data.median |
number |
Middle score in percent, to 1 decimal |
data.min |
number |
Lowest score in percent |
data.max |
number |
Highest score in percent |
data.stddev |
number |
Standard deviation of the scores, over everyone counted (population). 0 with fewer than two attempts |
data.avg_seconds |
integer |
Average time spent, in seconds. Attempts without a recorded time are left out |
data.histogram |
object[] |
Always ten buckets of 10 percentage points. A score of 100 falls in 90-100 |
Errors
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-exam/v1/analytics/7/overview" \
-H "Authorization: Bearer $PLUGIXA_EXAM_TOKEN"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/analytics/7/overview');
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/7/overview', {
headers: {
'Authorization': `Bearer ${process.env.PLUGIXA_EXAM_TOKEN}`,
},
});
const { data } = await response.json();
Quick Links
Share