]> git.parisson.com Git - teleforma.git/commitdiff
add quiz views
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 3 Dec 2015 22:43:23 +0000 (23:43 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 3 Dec 2015 22:43:23 +0000 (23:43 +0100)
teleforma/templates/teleforma/inc/quiz_list.html [new file with mode: 0644]
teleforma/templates/teleforma/quiz_form.html [new file with mode: 0644]
teleforma/templates/teleforma/seminar_detail.html
teleforma/urls.py

diff --git a/teleforma/templates/teleforma/inc/quiz_list.html b/teleforma/templates/teleforma/inc/quiz_list.html
new file mode 100644 (file)
index 0000000..68152d3
--- /dev/null
@@ -0,0 +1,30 @@
+{% load teleforma_tags %}
+{% load i18n %}
+
+<table class="listing" width="100%">
+    <tbody>
+            <tr>
+            <td class="border-top" width="35%">
+               <a href="{% url teleforma-quiz seminar.id quiz.id %}">{{ quiz.title }}</a></td>
+            <td class="border-top" width="60%">
+               {% 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 %}
+            </td>
+            <td class="border-top" width="5%" align="center">
+               {% if question|submitted:user and not question|validated:user %}
+                       <img src="{{ STATIC_URL }}teleforma/images/chronometer.png" style="vertical-align:middle" alt="" title="{% trans "Waiting for validation" %}" />
+               {% elif question|saved:user and not question|submitted:user %}
+                       <img src="{{ STATIC_URL }}telemeta/images/media-record.png" style="vertical-align:middle" alt="" title="{% trans "Saved" %}" />
+               {% elif question|submitted:user and question|validated:user %}
+                       <img src="{{ STATIC_URL }}telemeta/images/ok.png" style="vertical-align:middle" alt="" title="{% trans "Validated" %}" />
+               {% endif %}
+            </td>
+            </tr>
+        {% endfor %}
+    </tbody>
+</table>
diff --git a/teleforma/templates/teleforma/quiz_form.html b/teleforma/templates/teleforma/quiz_form.html
new file mode 100644 (file)
index 0000000..614042e
--- /dev/null
@@ -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 %}
+
+<div class="course_content">
+  <div class="course_subtitle">
+   <h3><img src="{{ STATIC_URL }}telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 2bis : {% trans "answer to this quiz" %}</h3>
+  </div>
+  <div style="text-align: justify; width: 100%; padding-bottom: 0.5em;">
+    {% include quiz/quiz/quiz_detail.html %}
+  </div>
+</div>
+
+{% endblock course_content %}
index c5371f1fc0bd7b1a21cf7a9566f3a24621522d41..dcf80c9e6f29f5de3e092f96ca04c126159a0079 100644 (file)
@@ -156,6 +156,12 @@ $(window).ready(function( ){
        </div>
       {% endwith %}
 
+      <div class="course_content">
+       <div class="course_subtitle">
+         <h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 2bis : {% trans "Quiz" %}</h3>
+       </div>
+       {% include "teleforma/inc/quiz_list.html" %}
+      </div>
 
      {% with seminar.docs_2 as docs %}
        <div class="course_content">
index aa04322527b5ef47f3ec05862d9d46ce89acc1a4..bcf3317cb694551c588fc909e210b959c1ea440d 100644 (file)
@@ -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<pk>.*)/form/$', evaluation_form_detail, name="teleforma-seminar-form"),
+    url(r'^desk/seminars/(?P<pk>.*)/quiz/$', QuizTake.as_view(), name="teleforma-quiz"),
 
     # Testimonial
     url(r'^desk/seminars/(?P<pk>.*)/testimonial/$', TestimonialView.as_view(),