A quiz's questions can be written as one JSON document and pasted into a quiz in Courses. In the lesson editor of a quiz, Import questions… in the Questions section will replace every question in the quiz with the ones in the document. The quiz's settings, such as its pass mark and attempts, are not in the document and will not change.

Use Copy the prompt in the import box to copy these instructions for an assistant you use. The assistant will ask you for what it needs, then write the document.

Importing is all or nothing. Magpie will check the whole document before it saves anything, and will name a mistake by its place in the document, such as "questions[1].prompt" is required and cannot be empty. A field that is not in the format is refused, and so is a field for another kind of question, such as options on a "short" question.

Attempts students have already made will keep their scores and the questions they answered. Attempts started after the import will use the new questions.

The same questions can be part of a whole course: the course format holds each quiz's questions in this shape (see Create a course by pasting JSON). How a course and its quizzes are made is in Get started with Courses.

The document

{
  "schema": "magpie.course-quiz",
  "version": 1,
  "questions": [
    { "kind": "single", "prompt": "Which comes first when you work out a day rate?", "points": 1,
      "options": [ { "text": "Your yearly costs", "correct": true }, { "text": "Your competitors' rates", "correct": false } ],
      "explanation": "Your costs set the lowest price you can accept." },
    { "kind": "multiple", "prompt": "Which belong in a quote?", "points": 2,
      "options": [ { "text": "What you will deliver", "correct": true }, { "text": "The price", "correct": true }, { "text": "Your hourly rate for every task", "correct": false } ] },
    { "kind": "true_false", "prompt": "A quote with three options gives the client a choice of price.", "answer": true },
    { "kind": "short", "prompt": "What is the price for one day's work called?", "accepted": ["day rate", "daily rate"] }
  ]
}
Field Type Notes
schema string, optional "magpie.course-quiz".
version number, optional 1.
questions array, required The questions in order, 1 to 200.

Questions

Field Type Notes
kind string, optional "single" (one right answer), "multiple" (several right answers), "true_false" or "short" (a short typed answer). "single" if left out.
prompt string, required The question, in Markdown, up to 5,000 characters.
points number, optional 1 to 100. 1 if left out. A "multiple" question earns its points only when every right option and no wrong one is chosen.
options array Required for "single" and "multiple": 2 to 10 options, each { "text", "correct" } and each with different text. text is required, up to 500 characters, and correct is true for a right answer. A "single" question has exactly one right option; a "multiple" question has at least one.
answer boolean Required for "true_false": the right answer, true or false.
accepted array of strings Required for "short": the answers that count as right, 1 to 20, each up to 200 characters. Capitals and extra spaces do not count when an answer is marked.
explanation string, optional Shown after the student submits, when the quiz shows explanations. Markdown, up to 5,000 characters.

A picture in a question's text is written as ![caption](/image/…) with the picture's address in your image library; an address that is not in your image library is refused, and the message names where it is. A question's own picture, chosen in the lesson editor, is not part of the document: add it in the lesson editor after the import.

If an import is rejected for a reason you cannot work out, Contact support.

Preguntar al soporte de Magpie

Envía al equipo de Magpie una pregunta sobre cualquier cosa que este artículo no responda.