{% extends 'atlas/exams.html' %} {% block content %} {% include 'atlas/partials/_viewing_case_as_part_of_collection.html' with nav_link_view="atlas:collection_case_questions" %}

Case: {{casedetail.case.title}}

{% if casedetail.question_schema is not None and not casedetail.question_answers %} {% endif %}
Help

This form allows you to add questions to a case. A example of how the quesiton will be displayed is shown below.

If answers are supplied the question will be automarked

The question system is built using https://github.com/json-editor/json-editor, this allows for highly flexible forms / question design at a cost of some complexity. To help with this a number of preset questions are avalible to choose from (these can then be edited if needed). It is also possible to copy questions from other cases in the collection.

In most cases it is not necessary to edit the JSON schema directly as questions can be added / edited via the GUI.

To save the question schema you need to click the "Save Questions" button at the bottom of the page. The page will then refresh and you can see how questions will be displayed at the bottom of the page.

Import schema from:
Question Block Title

Title of the question block.

Modify Questions
Add/Edit Question
Question schemas
...
{% csrf_token %} {{ form.as_p }}
{% comment %}

Blank form

{{ blank_form}}
{% endcomment %} {% if casedetail.question_schema %}

Question display

This shows the form as it will be displayed (with the correct answers). If you wish to edit a correct answer you can change it below.
{% csrf_token %} {# Show example_form non-field errors first #} {% if example_form.non_field_errors %}
Errors:
{% endif %} {# Render example_form fields explicitly so we can improve error UX for json_answer #} {% for field in example_form %} {% if field.name == 'json_answer' %}
{% if field.errors %} {% endif %} {{ field }} {# hidden/JS-bound field stays rendered #}
{% else %}
{{ field.label_tag }} {{ field }} {% if field.errors %} {% for err in field.errors %}
{{ err }}
{% endfor %} {% endif %} {% if field.help_text %} {{ field.help_text }} {% endif %}
{% endif %} {% endfor %} {# Debug: list all example_form.errors (field -> [errors]) in a collapsed block so nothing is missed #} {% if example_form.errors %}
All example form errors (debug)
{% endif %}
{% endif %} {% endblock %} {% block js %} {% comment %} {{ example_form.media }} {% endcomment %} {% endblock %}