def level(self):
if self.value:
if self.value != 0:
- return 100*self.corrector.scripts.filter(Q(status=2) | Q(status=3)).count()/self.value
+ level = 100*self.corrector.scripts.filter(Q(status=2) | Q(status=3) | Q(status=4)).count()/self.value
+ print level
+ return level
else:
return 0
else:
#notify_user(mess, 'acceptance')
def reject(self):
+ self.date_marked = datetime.datetime.now()
self.date_rejected = datetime.datetime.now()
context = {}
text = render_to_string('exam/messages/script_rejected.txt', context)
<td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{{ script.session }}</a></td>
<td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{{ script.type }}</a></td>
<td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{{ script.date_submitted }}</a></td>
- <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{{ script.date_marked }}</a></td>
- <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{{ script.score }}</a></td>
+ <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{% if script.date_marked %}{{ script.date_marked }}{% endif %}</a></td>
+ <td><a href="{% url teleforma-exam-script-detail period.id script.id %}">{% if script.score %}{{ script.score }}{% endif %}</a></td>
</tr>
{% endfor %}
</tbody>
{% trans "New script" %}
</div>
-<div class="course_content" id="media_infos">
+<div class="course_content" id="media_infos" style="font-size: 115%;">
<form method="post" id="_ScriptForm" action="">{% csrf_token %}
<table>
<tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
professor = user.professor.get()
periods = Period.objects.all()
+ corrector = user.correctors.all()
+ if corrector:
+ corrector = user.correctors.get()
+ periods = Period.objects.all()
+
return periods
def get_default_period(periods):
professor = user.professor.all()
student = user.student.all()
+ corrector = user.correctors.all()
if professor:
professor = user.professor.get()
courses = format_courses(courses, queryset=professor.courses.all(),
types=CourseType.objects.all())
+ if corrector:
+ corrector = user.correctors.get()
+ #FIXME
+ courses = format_courses(courses, queryset=Course.objects.all(),
+ types=CourseType.objects)
elif student:
student = user.student.get()
for training in student.trainings.all():