3d-interface/controllers/feedback/views/index.jade

86 lines
3.5 KiB
Plaintext
Raw Normal View History

2015-07-29 10:04:38 +01:00
extends ../../../views/base.jade
2015-09-04 15:31:21 +01:00
mixin message
span(style={'margin-bottom':'10px', 'margin-right': '10px'})
block
br
2015-08-01 10:44:49 +01:00
mixin question(id, qu, info)
label(for="#{id}", style={'margin-right':'10px'}) #{qu}
if (info !== undefined)
span.glyphicon.glyphicon-question-sign(type='button', data-toggle='tooltip', data-placement='top', title='#{info}')
2015-07-29 10:04:38 +01:00
input.form-control(name="answer#{id}", type="text", placeholder="Answer")
2015-08-01 10:44:49 +01:00
mixin rate(id, qu, info)
2015-09-04 15:31:21 +01:00
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'})
2015-08-01 10:44:49 +01:00
2015-07-29 10:04:38 +01:00
block extrahead
link(rel="stylesheet", href="/static/css/feedback.css")
2015-08-01 10:44:49 +01:00
link(rel="stylesheet", href="/static/css/star-rating.min.css")
2015-09-04 15:31:21 +01:00
//-block extrajs
2015-08-01 10:44:49 +01:00
script(src="/static/js/star-rating.min.js")
script $(function () { $('[data-toggle="tooltip"]').tooltip() })
script.
var liste = [1,2];
for (var i = 0; i < liste.length; i++) {
$("#answer" + liste[i]).rating({showClear: false, showCaption: false, size:'xs'});
$("#answer" + liste[i]).rating('update', 3);
}
2015-07-29 10:04:38 +01:00
block content
2015-09-04 15:50:29 +01:00
script.
function checkForm() {
var allAnswered = true;
$("input:radio").each(function(){
var name = $(this).attr("name");
if($("input:radio[name="+name+"]:checked").length == 0)
{
allAnswered = false;
}
});
2015-10-02 15:04:47 +01:00
$("input:text").each(function(){
if ($(this).val().length === 0) {
allAnswered = false;
}
});
2015-09-04 15:50:29 +01:00
if (!allAnswered) {
alert('You did not answer all the questions');
return false;
}
}
form.form-signin(method="POST", action='/feedback-target', onsubmit='return checkForm()')
2015-07-29 10:04:38 +01:00
h2 Please give us your feedback
2015-09-11 07:15:28 +01:00
+rate(1, "What was the difficulty level WITHOUT recommendation ?")
+rate(2, "What was the difficulty level WITH recommendation ?")
2015-08-01 10:44:49 +01:00
+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 ?")
+question(6, "Which recommendation style do you prefer and why ?")
2015-08-28 10:13:27 +01:00
+question(7, "Did you enjoy this ?")
2015-07-29 10:04:38 +01:00
//-label(for='input1') Did you have trouble to find the coins during the first step ?
//-input#input1.form-control(name="input1", type="text", placeholder='Id')
button.btn.btn-lg.btn-primary.btn-block(type='submit') Submit