fix(lms): template rendering for IN_PROGRESS submissions and needs_start logic
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||||
<h3 class="text-xl font-semibold mb-4">Ваш ответ</h3>
|
<h3 class="text-xl font-semibold mb-4">Ваш ответ</h3>
|
||||||
|
|
||||||
{% if submission %}
|
{% if submission and submission.status != 'IN_PROGRESS' %}
|
||||||
<div class="mb-6 p-4 rounded-lg border {% if submission.status == 'GRADED' %}bg-green-50 text-green-800 border-green-200{% else %}bg-yellow-50 text-yellow-800 border-yellow-200{% endif %}">
|
<div class="mb-6 p-4 rounded-lg border {% if submission.status == 'GRADED' %}bg-green-50 text-green-800 border-green-200{% else %}bg-yellow-50 text-yellow-800 border-yellow-200{% endif %}">
|
||||||
{% if submission.status == 'GRADED' %}
|
{% if submission.status == 'GRADED' %}
|
||||||
<h4 class="font-bold mb-2">Оценка: {{ submission.grade|default:"Не выставлена" }}</h4>
|
<h4 class="font-bold mb-2">Оценка: {{ submission.grade|default:"Не выставлена" }}</h4>
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ def assignment_detail(request, pk):
|
|||||||
|
|
||||||
if assignment.time_limit:
|
if assignment.time_limit:
|
||||||
if not submission:
|
if not submission:
|
||||||
|
if can_submit:
|
||||||
needs_start = True
|
needs_start = True
|
||||||
can_submit = False # Can't submit until started
|
can_submit = False # Can't submit until started
|
||||||
elif submission.status == 'IN_PROGRESS':
|
elif submission.status == 'IN_PROGRESS':
|
||||||
|
|||||||
Reference in New Issue
Block a user