Commit f2ba6525 authored by raida's avatar raida

Redirection from formulaire to 1a

parent f565c305
......@@ -8,7 +8,7 @@
<li role="presentation"><a href="{{ NOTE_ROOT_URL }}wei/1a/">{% trans "Retour" %}</a></li>
{% endblock %}
{% block content %}*
{% block content %}
<h1>{% trans "Questionnaire d'ambiance" %}</h1>
<p>
......
......@@ -10,16 +10,13 @@
import django
# Modules standard utiles
import random
import random
import json
import base64
import subprocess
import os
import shutil
import urllib
import algo1a
import re
from django.shortcuts import redirect
from datetime import datetime
from tempfile import mkdtemp
......@@ -1713,6 +1710,8 @@ def WEI1Aalgo(request, sock, kwargs):
if request.method == "GET":
variables["form"] = forms.WEI1AForm(label_suffix=_(u" :"))
variables["type"] = '1a'
if not request.session.has_key("wei1A2019"):
return redirect('note/wei_1a.html')
variables["liste"] = algo1a.test(True, [], request.session["wei1A2019"]["nom"] + request.session["wei1A2019"]["prenom"])
variables["nb_quest"] = 0
request.session["nb_quest"] = 0
......@@ -1722,7 +1721,7 @@ def WEI1Aalgo(request, sock, kwargs):
request.session["quest"] += separator + request.POST.get("reponse")
variables["liste"] = algo1a.test(True, request.session["quest"].split("#"), request.session["wei1A2019"]["nom"] + request.session["wei1A2019"]["prenom"])
request.session["nb_quest"] += 1
variables["nb_quest"] = request.session["nb_quest"] *100 / 20
variables["nb_quest"] = request.session["nb_quest"] * 100 / 20
if variables["liste"] is None: # Fin du questionnaire
request.session["wei1A2019"]["quest"] = request.session["quest"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment