]> git.parisson.com Git - teleforma.git/commitdiff
Add global exam param
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 4 Jul 2017 22:46:59 +0000 (00:46 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 4 Jul 2017 22:46:59 +0000 (00:46 +0200)
teleforma/exam/views.py

index 8abb8dda3f81ecdc7118cd2800cdcdee13425367..f2512c73b4885d4ff13aef6850a4ac2a49464c13 100644 (file)
@@ -346,7 +346,10 @@ class ScoreCreateView(ScriptCreateView):
         context = super(ScriptCreateView, self).get_context_data(**kwargs)
         period = Period.objects.get(id=self.kwargs['period_id'])
         context['period'] = period
-        context['upload'] = datetime.datetime.now() <= period.date_exam_end
+        if getattr(settings, 'TELEFORMA_EXAM_SCRIPT_UPLOAD', True):
+            context['upload'] = datetime.datetime.now() <= period.date_exam_end
+        else:
+            context['upload'] = False
         context['create_fields'] = ['course', 'session', 'type', 'score' ]
         course_pk_list = [c['course'].id for c in get_courses(self.request.user)]
         context['form'].fields['course'].queryset = Course.objects.filter(pk__in=course_pk_list)