Parcourir la source

Update display of experience

Jérôme BUISINE il y a 4 ans
Parent
commit
32b50a11ee

+ 0 - 4
Makefile

@@ -1,7 +1,3 @@
-# get information about webexpeinstance
-WEBEXPE_RUN=$(docker ps | grep webexpeinstance)
-WEBEXPE_STOP=$(docker ps -a | grep webexpeinstance)
-
 build:
 	@echo "----------------------------------------------------------------"
 	@echo "Update of djangowebexpe image"

+ 7 - 5
expe/expes/run.py

@@ -23,14 +23,16 @@ def run_quest_one_image(request, model_filepath, output_file):
     expe_name = request.session.get('expe')
 
     # by default
-    iterations = 0
+    iteration = 0
+
+    # used to stop when necessary
+    if 'iteration' in request.GET:
+        iteration = int(request.GET.get('iteration'))
 
     # first time only init `quest`
     # if experience is started we can save data
     if request.session.get('expe_started'):
         answer = int(request.GET.get('answer'))
-        iterations = int(request.GET.get('iteration'))
-
         answer_time = time.time() - request.session['answer_time']
         print("Answer time is ", answer_time)
         previous_percentage = request.session.get('expe_percentage')
@@ -51,7 +53,7 @@ def run_quest_one_image(request, model_filepath, output_file):
         qp = pickle.load(filehandler)
     
     # construct image and update `quest` only if necessary
-    if iterations < cfg.expes_configuration[expe_name]['params']['iterations']:
+    if iteration < cfg.expes_configuration[expe_name]['params']['iterations']:
         # process `quest`
         next_stim = qp.next_contrast()
         print("Next quality ", next_stim)
@@ -72,7 +74,7 @@ def run_quest_one_image(request, model_filepath, output_file):
         # TODO : check `i` variable 
         # update of `quest`
         # qp.update(qualities[i], answer)
-        qp.update(qualities[iterations], answer) 
+        qp.update(qualities[iteration], answer) 
         entropy = qp.get_entropy()
 
         line = str(next_stim) 

+ 3 - 3
expe/templates/expe/expe_indications.html

@@ -9,10 +9,10 @@
 {% block content %}
     
     <h3>{{question}}</h3>
-    <p>{{indication}}</p>
-
     <br />
-    <p>Press enter to begin experience</p>
+    <h5>{{indication}}</h5>
+
+    <p id="expeIndication"><strong>Press enter to begin experience</strong></p>
     
     {% block javascripts %}
         <script src="{% static "js/indications.js" %}"></script>

+ 3 - 3
expe/templates/expe/expe_list.html

@@ -7,10 +7,10 @@
 {% endblock %}
 
 {% block content %}
-    <p>Choose you experience and dataset</p>
+    <h2>Choose you experience and dataset</h2>
 
     <div class="row">
-        <div class="col-md-4 col-md-offset-4">
+        <div class="col-md-4 offset-md-4">
             <form action="/indications" id="expeChoice">
 
                 <div class="form-group">
@@ -23,7 +23,7 @@
                 </div>
 
                 <div class="form-group">
-                    <label for="expe">Select experience:</label>
+                    <label for="expe" style="position:static">Select experience:</label>
                     <select class="form-control " name="expe">
                         {% for expe in expes %}
                             <option value="{{expe}}">{{expe}}</option>

+ 5 - 1
static/css/expe.css

@@ -1,5 +1,5 @@
 body {
-    background-color: grey;
+    background-color: lightgrey;
 }
 
 .container{
@@ -9,4 +9,8 @@ body {
 
 #expeImg{
     display: none;
+}
+
+#expeIndication{
+    margin-top: 30%;
 }