Documentation

Overview

Teachers create game codes from selected classes, categories, standards, and difficulty levels. A game app can use that code to read the matching question set through the public API.

Students do not need accounts. Game apps should ask students for a teacher-provided code, then use the API response to run the game experience.

Teacher Workflow

Create a class first, then add questions manually or import them with the CSV template. Questions marked Available can be used in game codes and exports.

To create a game code, choose a title, class, optional categories, optional standards, difficulty levels, and an expiration date. Leaving category or standard blank includes all options.

After a code is created, teachers can copy the student/game code, export the question set, remove specific questions from that code, add more questions, rename the code, extend the expiration date, or regenerate the code.

Imports

The import screen previews a CSV before it is added to the question bank. The preview shows rows that are ready, rows that will be skipped, and possible duplicate questions.

Rows with missing required fields are skipped. Duplicate warnings do not stop an import, but they help teachers catch repeated questions before importing.

Exports

Game code pages can export question sets for Blooket, Kahoot, Gimkit, and Schoology. Answer choices are randomized where the export format supports it.

Schoology exports are limited to 200 questions. If a code contains more than 200 questions, remove questions from that game code before exporting for Schoology.

Game Code Cleanup

Expired game codes are automatically removed from the dashboard. This keeps old temporary codes from building up in the database.

API Endpoint

Use a GET request with the game code:

https://noctiprep.mydcts.org/api/question_set.php?code=CY94L5

Successful Response

{
  "valid": true,
  "code": "CY94L5",
  "title": "Safety",
  "class_name": "Web Development & Design",
  "teacher_name": "Teacher Name",
  "question_count": 1,
  "questions": [
    {
      "id": 12,
      "category": "100 Safety",
      "standard": "101 Don't stare at screens",
      "question": "How do you reduce blue light eye strain?",
      "answers": [
        { "text": "Not look at the screen", "is_correct": true },
        { "text": "Increase brightness", "is_correct": false },
        { "text": "Sit closer", "is_correct": false },
        { "text": "Ignore eye strain", "is_correct": false }
      ],
      "explanation": "Use healthy viewing habits to reduce eye strain.",
      "difficulty": "Easy"
    }
  ]
}

Question order and answer order are randomized by the API. Do not assume the first question is always the same or that the first answer is correct.

Error Responses

Status Meaning Example
400 No code was provided. {"valid":false,"error":"Missing question set code."}
404 The code does not exist or is inactive. {"valid":false,"error":"Question set not found or inactive."}
410 The code has expired. {"valid":false,"error":"Question set has expired."}

Game App Guidance

Game apps should store their own player names, matches, scores, boards, and turns. NOCTI Prep only provides the teacher-approved question set for a code.

If two students use different teacher codes in the same game app, each student should receive questions from their own code. The game app is responsible for keeping each player's code tied to that player.

External game apps should treat this API as read-only. They should not connect directly to the MySQL database.

JavaScript Example

async function loadQuestionSet(code) {
  const response = await fetch(
    `https://noctiprep.mydcts.org/api/question_set.php?code=${encodeURIComponent(code)}`
  );

  const data = await response.json();

  if (!data.valid) {
    throw new Error(data.error || "Invalid code");
  }

  return data.questions;
}