Contents
On this page

Get Student Summary - Plugixa Exam

GET /plugixa-exam/v1/analytics/{exam}/students

Read one row per candidate for an exam: how many attempts they made, their best and average score, and how many attempts passed.

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. Guests are grouped by the name they gave, so a guest who sat the exam twice under the same name is one row. An unknown exam id answers 200 with an empty list.

Request

GET https://your-site.example/wp-json/plugixa-exam/v1/analytics/7/students?limit=50

Path parameters

Name Type Description
exam integer The exam’s id

Query parameters

Name Type Default Description
limit integer 200 How many rows, 1 to 1000. 0 or a missing value means 200.

This endpoint is not paged and takes no other list parameters.

Responses

200 OK. data is one row per candidate.

Sorted by best score, highest first.

{
  "success": true,
  "data": [
    {
      "user_id": 58,
      "name": "Jordan Lee",
      "attempts": 2,
      "best": 92.5,
      "average": 81.3,
      "passed": 2
    },
    {
      "user_id": 0,
      "name": "Sam Rivera",
      "attempts": 1,
      "best": 57,
      "average": 57,
      "passed": 0
    }
  ]
}
Field Type Meaning
data[].user_id integer The WordPress user id, 0 for a guest
data[].name string The display name, else the guest’s name, else Anonymous
data[].attempts integer Scored attempts
data[].best number Best score in percent, to 1 decimal
data[].average number Average score in percent, to 1 decimal
data[].passed integer How many of the attempts passed

Errors

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-exam/v1/analytics/7/students?limit=50" \
  -H "Authorization: Bearer $PLUGIXA_EXAM_TOKEN"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/analytics/7/students?limit=50');
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/students?limit=50', {
  headers: {
    'Authorization': `Bearer ${process.env.PLUGIXA_EXAM_TOKEN}`,
  },
});
const { data } = await response.json();

Quick Links

Share