From: Guillaume Pellerin Date: Thu, 3 Dec 2015 22:43:23 +0000 (+0100) Subject: add quiz views X-Git-Tag: 2.8.1-pro~273 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=dd6502ead41455d1657a7db4b0de11138da03fdd;p=teleforma.git add quiz views --- diff --git a/teleforma/templates/teleforma/inc/quiz_list.html b/teleforma/templates/teleforma/inc/quiz_list.html new file mode 100644 index 00000000..68152d32 --- /dev/null +++ b/teleforma/templates/teleforma/inc/quiz_list.html @@ -0,0 +1,30 @@ +{% load teleforma_tags %} +{% load i18n %} + + + + + + + + + {% endfor %} + +
+ {{ quiz.title }} + {% if question|submitted:user and not question|validated:user %} + {% trans "submitted on" %} {{ question|submitted:user }} + {% elif question|saved:user and not question|submitted:user %} + {% trans "saved on" %} {{ question|saved:user }} + {% elif question|submitted:user and question|validated:user %} + {% trans "validated on" %} {{ question|validated:user }} + {% endif %} + + {% if question|submitted:user and not question|validated:user %} + + {% elif question|saved:user and not question|submitted:user %} + + {% elif question|submitted:user and question|validated:user %} + + {% endif %} +
diff --git a/teleforma/templates/teleforma/quiz_form.html b/teleforma/templates/teleforma/quiz_form.html new file mode 100644 index 00000000..614042eb --- /dev/null +++ b/teleforma/templates/teleforma/quiz_form.html @@ -0,0 +1,21 @@ +{% extends "teleforma/answer_form.html" %} +{% load teleforma_tags %} +{% load i18n %} + +{% block extra_javascript %} +{% endblock extra_javascript %} + +{% block extra_stylesheets %}{% endblock %} + +{% block course_content %} + +
+
+

{% trans "Step" %} 2bis : {% trans "answer to this quiz" %}

+
+
+ {% include quiz/quiz/quiz_detail.html %} +
+
+ +{% endblock course_content %} diff --git a/teleforma/templates/teleforma/seminar_detail.html b/teleforma/templates/teleforma/seminar_detail.html index c5371f1f..dcf80c9e 100644 --- a/teleforma/templates/teleforma/seminar_detail.html +++ b/teleforma/templates/teleforma/seminar_detail.html @@ -156,6 +156,12 @@ $(window).ready(function( ){ {% endwith %} +
+
+

{% trans "Step" %} 2bis : {% trans "Quiz" %}

+
+ {% include "teleforma/inc/quiz_list.html" %} +
{% with seminar.docs_2 as docs %}
diff --git a/teleforma/urls.py b/teleforma/urls.py index aa043225..bcf3317c 100644 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@ -42,6 +42,7 @@ from telemeta.views import * import forms_builder.forms.urls from jsonrpc import jsonrpc_site from longerusername.forms import AuthenticationForm +from quiz.views import * htdocs_forma = os.path.dirname(__file__) + '/static/teleforma/' user_export = UsersXLSExport() @@ -103,6 +104,7 @@ urlpatterns = patterns('', # Evaluations url(r'^forms/', include('forms_builder.forms.urls')), url(r'^desk/seminars/(?P.*)/form/$', evaluation_form_detail, name="teleforma-seminar-form"), + url(r'^desk/seminars/(?P.*)/quiz/$', QuizTake.as_view(), name="teleforma-quiz"), # Testimonial url(r'^desk/seminars/(?P.*)/testimonial/$', TestimonialView.as_view(),