{% extends 'base.html' %} {% block title %}Take Assignment - {{ assignment.title }} - LXP{% endblock %} {% block content %}

{{ assignment.title }}

{{ assignment.description }}

Instructions: {% if assignment.assignment_type == 'multiple_choice' %} Select the correct answer for each question. {% else %} Type your answer in the text boxes provided. {% endif %} Total questions: {{ question_forms|length }}
{% csrf_token %} {% for question, form in question_forms %}
Question {{ forloop.counter }} ({{ question.marks }} marks)

{{ question.question_text }}

{% if assignment.assignment_type == 'multiple_choice' %} {% if form.selected_choice %} {% for choice in form.selected_choice.field.queryset %}
{% endfor %} {% else %}

No choices available for this question.

{% endif %} {% else %} {% if form.answer_text %} {% else %}

Answer field not available.

{% endif %} {% endif %} {% if form.non_field_errors %}
{% for error in form.non_field_errors %} {{ error }} {% endfor %}
{% endif %}
{% endfor %}
Cancel
{% endblock %}