{% extends 'base.html' %} {% load static %} {% block title %}Add Questions - {{ assignment.title }} - LXP {% endblock %} {% block content %}

Add Questions to: {{ assignment.title }}

{{ assignment.get_assignment_type_display }}

Description: {{ assignment.description }}

Due Date: {{ assignment.due_date|date:"M d, Y H:i" }}

Total Marks: {{ assignment.total_marks }}

Add New Question
{% csrf_token %}
{{ question_form.question_text }} {% if question_form.question_text.errors %}
{% for error in question_form.question_text.errors %} {{ error }} {% endfor %}
{% endif %}
{{ question_form.marks }} {% if question_form.marks.errors %}
{% for error in question_form.marks.errors %} {{ error }} {% endfor %}
{% endif %}
{{ question_form.order }} {% if question_form.order.errors %}
{% for error in question_form.order.errors %} {{ error }} {% endfor %}
{% endif %}
{% if assignment.assignment_type == 'multiple_choice' %}
Option Text
Correct Answer

{% for form in choice_formset %}
{{ form.choice_text }} {{ form.id }} {% if form.choice_text.errors %}
{{ form.choice_text.errors }}
{% endif %}
{{ form.is_correct }} {% if form.is_correct.errors %}
{{ form.is_correct.errors }}
{% endif %}
{% endfor %} {{ choice_formset.management_form }}
{% endif %}
Current Questions ({{ questions.count }})
{% if questions %}
{% for question in questions %}
Q{{ question.order }}: {{ question.question_text|truncatewords:10 }}
{{ question.marks }} marks {% if assignment.assignment_type == 'multiple_choice' %}
Options:
    {% for choice in question.choices.all %}
  • {{ choice.choice_text }} {% if choice.is_correct %} Correct {% endif %}
  • {% endfor %}
{% endif %}
{% endfor %}
Total Marks: {{ questions|length|add:0|default:0 }}
{{ questions|length|add:0|default:0 }}%
Assignment total: {{ assignment.total_marks }} marks
{% else %}

No questions added yet. Start by adding your first question above.

{% endif %} {% if questions %} {% endif %} {% endblock %}
{% block scripts %} {% endblock %}