From: Guillaume Pellerin Date: Tue, 4 Aug 2015 20:53:01 +0000 (+0200) Subject: add message when no scores X-Git-Tag: 1.1~188 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=274898773cadc10ad3f1de3b26bfe64baab13bc4;p=teleforma.git add message when no scores --- diff --git a/teleforma/exam/templates/exam/scores.html b/teleforma/exam/templates/exam/scores.html index bb7b1700..fd57d13f 100644 --- a/teleforma/exam/templates/exam/scores.html +++ b/teleforma/exam/templates/exam/scores.html @@ -49,6 +49,15 @@
+{% if messages %} +
+ {% for message in messages %} + {{ message }}
+ {% endfor %} + +{% endif %} +
+ {% include_container data.chartcontainer 500 '100%' %} {% endblock answers %} diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index 343d0aa9..ed872a9a 100644 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -213,6 +213,9 @@ class ScriptsScoreAllView(ScriptsTreatedView): template_name='exam/scores.html' def score_data_setup(self, x, y): + if not x['x']: + messages.warning(self.request, _("You must add one new score at least to access to the statistics.")) + chartdata = x i = 1 for data in y: diff --git a/teleforma/locale/en/LC_MESSAGES/django.mo b/teleforma/locale/en/LC_MESSAGES/django.mo index bf5e6021..216735be 100644 Binary files a/teleforma/locale/en/LC_MESSAGES/django.mo and b/teleforma/locale/en/LC_MESSAGES/django.mo differ diff --git a/teleforma/locale/en/LC_MESSAGES/django.po b/teleforma/locale/en/LC_MESSAGES/django.po index c1691756..14007208 100644 --- a/teleforma/locale/en/LC_MESSAGES/django.po +++ b/teleforma/locale/en/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-07-29 10:41+0200\n" +"POT-Creation-Date: 2015-08-04 22:52+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Guillaume Pellerin \n" "Language-Team: LANGUAGE \n" @@ -465,7 +465,11 @@ msgstr "" "Il y a une une erreur lors de votre soumission de copie. Merci de vérifier " "votre fichier ou de réessayer plus tard." -#: exam/views.py:279 +#: exam/views.py:217 +msgid "You must add one new score at least to access to the statistics." +msgstr "" + +#: exam/views.py:282 msgid "all courses" msgstr "toutes les matières" diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index 6b1b2cf8..9107513a 100644 Binary files a/teleforma/locale/fr/LC_MESSAGES/django.mo and b/teleforma/locale/fr/LC_MESSAGES/django.mo differ diff --git a/teleforma/locale/fr/LC_MESSAGES/django.po b/teleforma/locale/fr/LC_MESSAGES/django.po index 515ef143..1be26057 100644 --- a/teleforma/locale/fr/LC_MESSAGES/django.po +++ b/teleforma/locale/fr/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-07-29 10:41+0200\n" +"POT-Creation-Date: 2015-08-04 22:52+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Guillaume Pellerin \n" "Language-Team: LANGUAGE \n" @@ -467,7 +467,12 @@ msgstr "" "Il y a une une erreur lors de votre soumission de copie. Merci de vérifier " "votre fichier ou de réessayer plus tard." -#: exam/views.py:279 +#: exam/views.py:217 +msgid "You must add one new score at least to access to the statistics." +msgstr "" +"Vous devez ajouter au moins une nouvelle note pour accéder aux statistiques." + +#: exam/views.py:282 msgid "all courses" msgstr "toutes les matières"