]> git.parisson.com Git - teleforma.git/commitdiff
https://trackers.pilotsystems.net/prebarreau/0251 and https://trackers.pilotsystems...
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 8 Sep 2021 13:16:41 +0000 (15:16 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 8 Sep 2021 13:16:41 +0000 (15:16 +0200)
teleforma/exam/forms.py

index 278624bc45af894440331e4e1adb1ebc4c75bf9d..a6ea843631a2256fcb5fdf78196a5937ec230de8 100644 (file)
@@ -18,11 +18,12 @@ class ScriptForm(ModelForm):
     def __init__(self, *args, **kwargs):
         period = kwargs.pop('period')
         super(ScriptForm, self).__init__(*args, **kwargs)
-        self.fields['score'].localize = True
+        self.fields['score'].localize = False
         nb = period.nb_script or settings.TELEFORMA_EXAM_MAX_SESSIONS
         self.fields['session'] = forms.ChoiceField(choices=get_n_choices(nb + 1),
                                                    validators=[validate_session(nb)])
         self.fields['file'].required = True
+        self.fields['score'].widget.attrs['onkeydown'] = "return event.key != 'Enter';"
 
     class Meta:
         model = Script