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

{{ assignment.title }}

{{ assignment.get_assignment_type_display }}
Description

{{ assignment.description }}

Created by: {{ assignment.created_by.get_full_name|default:assignment.created_by.username }}

Created on: {{ assignment.created_at|date:"M d, Y" }}

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

Total Marks: {{ assignment.total_marks }}

Assignment Status
{% if now > assignment.due_date %} Closed

The due date has passed

{% else %} Open

Due in {{ assignment.due_date|timeuntil:now }}

{% endif %}

Questions: {{ assignment.questions.count }}

Status: {% if assignment.is_published %}Published{% else %}Draft{% endif %}

Back to Assignments {% if is_trainer %} Add Questions View Submissions ({{ assignment.submissions.count }}) {% if is_trainer %}
{% endif %} {% else %} {% if student_submission %} {% if student_submission.is_graded %} Graded: {{ student_submission.total_marks_obtained }}/{{ assignment.total_marks }} {% else %} Awaiting Grading {% endif %} {% elif now <= assignment.due_date %} Take Assignment {% else %} {% endif %} {% endif %}

Questions ({{ assignment.questions.count }})

{% if assignment.questions.all %}
{% for question in assignment.questions.all %}

Question:

{{ question.question_text }}

{% if assignment.assignment_type == 'multiple_choice' and question.choices.all %}
Options:
{% for choice in question.choices.all %}
{{ choice.choice_text }} {% if choice.is_correct %} Correct {% endif %}
{% endfor %}
{% endif %}
Marks: {{ question.marks }}
{% endfor %}
Total Questions: {{ assignment.questions.count }}
Total Marks: {{ assignment.total_marks }}
Complete
Assignment structure is complete
{% else %}
No Questions Added Yet

{% if is_trainer %} This assignment doesn't have any questions yet. Click "Add Questions" to get started. {% else %} The instructor hasn't added questions to this assignment yet. {% endif %}

{% if is_trainer %} Add Questions {% endif %}
{% endif %}
{% if not is_trainer and student_submission %}
Your Submission

Submitted on: {{ student_submission.submitted_at|date:"M d, Y H:i" }}

Status: {% if student_submission.is_graded %}Graded{% else %}Pending Review{% endif %}

{% if student_submission.is_graded %}

Marks Obtained: {{ student_submission.total_marks_obtained }}/{{ assignment.total_marks }}

Feedback: {{ student_submission.feedback|default:"No feedback provided" }}

{% else %}

Your submission is being reviewed by the instructor.

{% endif %}
{% endif %} {% if is_trainer %}
Instructor Notes
Submissions

{{ assignment.submissions.count }}

Total submissions
Graded

{{ graded_submissions }}

Graded submissions
Pending

{{ pending_submissions }}

Pending grading
{% endif %} {% endblock %}
{% block scripts %} {% endblock %}