Some modifications

This commit is contained in:
Thomas FORGIONE
2015-09-04 16:31:21 +02:00
parent 3ea3f5494b
commit 1c885d9c6d
4 changed files with 70 additions and 35 deletions

View File

@@ -1,5 +1,10 @@
extends ../../../views/base.jade
mixin message
span(style={'margin-bottom':'10px', 'margin-right': '10px'})
block
br
mixin question(id, qu, info)
label(for="#{id}", style={'margin-right':'10px'}) #{qu}
if (info !== undefined)
@@ -7,16 +12,30 @@ mixin question(id, qu, info)
input.form-control(name="answer#{id}", type="text", placeholder="Answer")
mixin rate(id, qu, info)
label(for="anwser#{id}", style={'margin-right':'10px'}) #{qu}
if (info !== undefined)
span.glyphicon.glyphicon-question-sign(type='button', data-toggle='tooltip', data-placement='top', title='#{info}')
input.rating(id="answer#{id}", name="answer#{id}", type="number", min='0', max='5', step='1', default='3')
div
label(for="anwser#{id}", style={'margin-right':'10px'}) #{qu}
if (info !== undefined)
span.glyphicon.glyphicon-question-sign(type='button', data-toggle='tooltip', data-placement='top', title='#{info}')
//-input.rating(id="answer#{id}", name="answer#{id}", type="number", min='0', max='5', step='1', default='3')
br
input(type='radio', name='answerItem#{id}', value='1', style={'margin-right':'10px'})
+message Very easy
input(type='radio', name='answerItem#{id}', value='2', style={'margin-right':'10px'})
+message Easy
input(type='radio', name='answerItem#{id}', value='3', style={'margin-right':'10px'})
+message Medium
input(type='radio', name='answerItem#{id}', value='4', style={'margin-right':'10px'})
+message Hard
input(type='radio', name='answerItem#{id}', value='5', style={'margin-right':'10px'})
+message Very hard
div(style={'margin-bottom':'10px'})
block extrahead
link(rel="stylesheet", href="/static/css/feedback.css")
link(rel="stylesheet", href="/static/css/star-rating.min.css")
block extrajs
//-block extrajs
script(src="/static/js/star-rating.min.js")
script $(function () { $('[data-toggle="tooltip"]').tooltip() })
script.
@@ -30,8 +49,8 @@ block content
form.form-signin(method="POST", action='/feedback-target')
h2 Please give us your feedback
+rate(1, "What was the difficulty level without recommendation ?", "1 star if it was very easy, 5 stars if it was very difficult")
+rate(2, "What was the difficulty level with recommendation ?", "1 star if it was very easy, 5 stars if it was very difficult")
+rate(1, "What was the difficulty level without recommendation ?")
+rate(2, "What was the difficulty level with recommendation ?")
+question(3, "Did the recommendations help you to find the coins ?")
+question(4, "Did the recommendations help you to browse the scene ?")
+question(5, "Do you think recommendations can be helpful ?")

View File

@@ -24,7 +24,18 @@ block extrabody
<strong>Error</strong> : this id is already used !
block content
form.form-signin(method="POST", action='/identification')
script.
function validateForm() {
if (document.getElementById('sel1').selectedIndex === -1) {
alert('Select a correct age please');
return false;
}
if (document.getElementById('sel2').selectedIndex === -1) {
alert('Select a correct date for the last time you played please');
return false;
}
}
form.form-signin(method="POST", action='/identification', onsubmit='return validateForm()')
h2 Please sign in
label(for='inputId').sr-only Id
input#inputId.form-control(name="inputId", type="text", placeholder='Id', required, autofocus)
@@ -53,6 +64,9 @@ block content
option(value='50-55') Between 50 and 55
option(value='55-60') Between 55 and 60
option(value='60-') More than 60
script.
document.getElementById('sel1').selectedIndex = -1;
.form-group
label(for='se21', style={'margin-right':'10px'}) When is the last time you played a 3D video game ?
@@ -62,6 +76,8 @@ block content
option(value='2') This month
option(value='1') This year
option(value='0') I never played a 3D video game
script.
document.getElementById('sel2').selectedIndex = -1;
label(for='3dgames', style={'margin-right':'10px'}) Rate your 3D game skills