Contents
On this page

Get Attempt - Plugixa Exam

GET /plugixa-exam/v1/attempts/{id}

Read one attempt as a marker sees it: the attempt itself, the exam, and every question with the examinee’s response, the points and the correct options.

Scope attempts:read; the token’s user needs the attempts:view permission.

Note. This is the staff view. It is not held back until results are released, and it includes which options are correct. released tells you whether the examinee can see the result yet. Grading the attempt is not reachable by any token.

Request

GET https://your-site.example/wp-json/plugixa-exam/v1/attempts/318

Path parameters

Name Type Description
id integer The attempt’s id

Responses

200 OK. data is the marking paper.

{
  "success": true,
  "data": {
    "attempt": {
      "id": 318,
      "exam_id": 7,
      "user_id": 25,
      "guest_name": null,
      "guest_email": null,
      "attempt_number": 1,
      "status": "graded",
      "started": "2026-11-12 08:40:00",
      "expires_at": "2026-11-12 09:40:00",
      "submitted": "2026-11-12 09:22:00",
      "time_spent": 2520,
      "score": 3,
      "max_score": 4,
      "percent": 75,
      "passed": true,
      "is_graded": true,
      "grader_comment": null,
      "last_graded_by": 1,
      "last_graded_at": "2026-11-12 09:30:00",
      "created_at": "2026-11-12 08:40:00",
      "modified_at": "2026-11-12 09:30:00",
      "seconds_remaining": null,
      "examinee": "Lucas Bernard",
      "integrity_signals": null
    },
    "exam": {
      "id": 7,
      "title": "Algebra midterm",
      "pass_mark": 60
    },
    "released": true,
    "review": [
      {
        "id": 12,
        "type": "mcq_single",
        "title": "Capital of France",
        "stem": "<p>What is the capital of France?</p>",
        "explanation": "<p>Paris is the capital of France.</p>",
        "points_possible": 1,
        "points_awarded": 1,
        "is_correct": 1,
        "response": 41,
        "grader_comment": null,
        "auto_graded": true,
        "options": [
          { "id": 41, "text": "Paris", "is_correct": true },
          { "id": 42, "text": "Lyon", "is_correct": false }
        ],
        "points_minimum": 0
      }
    ]
  }
}

The attempt object above is shortened: it carries the same fields as a row of List Attempts, apart from exam_title, plus the three added below.

Field Type Meaning
data.attempt object The attempt, as in List Attempts
data.attempt.seconds_remaining integer|null Time left on a running attempt
data.attempt.examinee string The user’s display name, else the guest name, else Guest
data.attempt.integrity_signals object|null What was recorded while the attempt ran, null when nothing was
data.exam.id integer The exam
data.exam.title string The exam’s title
data.exam.pass_mark number The exam’s pass mark
data.released boolean Whether the examinee can see the result now
data.review[].id integer The question’s id
data.review[].type string The question type
data.review[].stem string The question text, HTML
data.review[].points_possible number Points the question is worth in this attempt
data.review[].points_awarded number|null Points given, null until marked
data.review[].points_minimum number The lowest mark possible: below 0 only with negative marking
data.review[].is_correct integer|null 1 correct, 0 not, null until marked
data.review[].response any|null The examinee’s answer. Its shape depends on the question type. null when unanswered
data.review[].grader_comment string|null The marker’s comment on this answer
data.review[].auto_graded boolean Whether the plugin marked this answer
data.review[].options object[] Each option’s id, text (HTML) and is_correct

Apps can add their own keys to each review item.

Errors

Status Code When
404 plugixa_exam_not_found No attempt with that id (Attempt not found.), or its exam is missing or in the trash (Exam not found.).

Plus the errors every endpoint can return.

Examples

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

Quick Links

Share