Bugs fixes
[qomet.git] / views / assessment.pug
index 9caa03d..5c573d7 100644 (file)
@@ -13,25 +13,20 @@ block content
        .container#assessment
                .row
                        #warning.modal
-                               .modal-content
-                                       p Your answer to the current question was sent to the server.
-                                       p To avoid future unpleasant surprises, please don't
-                                       ul
-                                               li resize the window, or
-                                               li lose window focus.
+                               .modal-content {{ warnMsg }}
                                .modal-footer
                                        .center-align
-                                               a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Got it!
+                                               a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Ok
                .row
                        .col.s12.m10.offset-m1.l8.offset-l2.xl6.offset-xl3
                                h4= assessment.name
-                               #stage0(v-if="stage==0")
+                               #stage0(v-show="stage==0")
                                        .card
                                                .input-field.inline.on-left
                                                        label(for="number") Number
                                                        input#number(type="text" v-model="student.number" @keyup.enter="getStudent()")
                                                button.waves-effect.waves-light.btn(@click="getStudent()") Send
-                               #stage1(v-if="stage==1")
+                               #stage1(v-show="stage==1")
                                        .card
                                                if assessment.mode != "open"
                                                        .input-field.inline.on-left
@@ -40,27 +35,34 @@ block content
                                                        .input-field.inline
                                                                label(for="name") Name
                                                                input#name(type="text" v-model="student.name" disabled)
-                                               p
+                                               p.center-align
                                                        if assessment.mode != "open"
                                                                button.waves-effect.waves-light.btn.on-left(@click="cancelStudent") Cancel
                                                        button.waves-effect.waves-light.btn(@click="startAssessment") Start!
-                               #stage1_2_4(v-if="stage==1 || stage==2 || stage == 4")
+                               #stage0_1_4(v-show="[0,1,4].includes(stage)")
                                        .card
                                                .introduction(v-html="assessment.introduction")
-                               #stage2_4(v-if="stage==2 || stage==4")
+                               #stage2_4(v-if="[2,4].includes(stage)")
                                        if assessment.time > 0
-                                               .card
-                                                       .timer.center(v-if="stage==2") {{ countdown }}
+                                               .card(v-show="stage==2")
+                                                       .timer.center {{ countdown }}
                                        .card
-                                               statements(:assessment="assessment" :student="student" :stage="stage" :inputs="inputs" @gameover="endAssessment")
-                               #stage3(v-if="stage==3")
+                                               button.sendAnswer.waves-effect.waves-light.btn(@click="sendAnswer") Send
+                                               statements(:questions="assessment.questions" :answers="answers")
+                                               if assessment.display == "all"
+                                                       button.sendAnswer.waves-effect.waves-light.btn(@click="sendAnswer") Send
+                               #stage3(v-show="stage==3")
                                        .card
                                                .finish Exam completed ☺ ...don't close the window!
-                               #stage3_4(v-if="stage==3 || stage==4")
+                               #stage3_4(v-show="[3,4].includes(stage)")
                                        .card
                                                .conclusion(v-html="assessment.conclusion")
 
 block append javascripts
        script.
                let assessment = !{JSON.stringify(assessment)};
+               const monitoring = false;
+       script(src="//cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js")
+       script(src="/javascripts/utils/libsRefresh.js")
+       script(src="/javascripts/components/statements.js")
        script(src="/javascripts/assessment.js")