Fix monitoring presence (TODO: weird Vue syntax...)
[qomet.git] / views / monitor.pug
CommitLineData
e99c53fb
BA
1extends withQuestions
2
71d1ca9c
BA
3block append stylesheets
4 link(rel="stylesheet" href="/stylesheets/monitor.css")
e5ec7dea
BA
5
6block content
71d1ca9c 7 .container#monitor
e5ec7dea 8 .row
2bada710 9 .col.s12.m10.offset-m1
e5ec7dea
BA
10 h4= examName
11 #stage0(v-show="stage==0")
12 .card
13 .input-field.inline.on-left
14 label(for="password") Password
15 input#password(type="password" v-model="password" @keyup.enter="startMonitoring()")
16 button.waves-effect.waves-light.btn(@click="startMonitoring()") Send
f6648c37 17 #stage1(v-show="stage==1")
25cb8d53 18 button.waves-effect.waves-light.btn(@click="endMonitoring()" :disabled="!allFinished()") Send feedback
71d1ca9c
BA
19 h4.title(@click="toggleDisplay('answers')") Anwers
20 // TODO: aussi afficher stats, permettre tri par colonnes
21 .card(v-show="display=='answers'")
22 ul.tabs.tabs-fixed-width
23 li.tab
24 a(href="#group0") All
25 li.tab(v-for="group in groupList()")
26 a(:href="groupId(group,'#')") G.{{ group }}
27 table(:id="groupId(group)" v-for="group in [0].concat(groupList())")
28 thead
29 tr
71d1ca9c
BA
30 th Name
31 th(v-for="(q,i) in assessment.questions") Q.{{ (i+1) }}
32 tbody
f87ac54a 33 tr.assessment(v-for="s in studentList(group)" :class="{absent:!s.present}")
25cb8d53 34 td(:class="{blur:!!s.blur,resize:!!s.resize,disconnect:!!s.disco}" @click="togglePresence(s)") {{ s.name }}
71d1ca9c
BA
35 td(v-for="(q,i) in assessment.questions" :style="{backgroundColor: getColor(s.number,i)}" @click="seeDetails(s.number,i)")  
36 h4.title(@click="toggleDisplay('assessment')") Assessment
37 div(v-show="display=='assessment'")
38 .card
39 .introduction(v-html="assessment.introduction")
40 .card
41 statements(:questions="assessment.questions" :answers="answers")
e99c53fb
BA
42
43block append javascripts
435371c7 44 script.
71d1ca9c
BA
45 const examName = "#{examName}";
46 const courseCode = "#{courseCode}";
47 const initials = "#{initials}";
435371c7 48 const monitoring = true;
71d1ca9c 49 script(src="/javascripts/utils/libsRefresh.js")
435371c7 50 script(src="/javascripts/components/statements.js")
71d1ca9c
BA
51 script(src="//cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js")
52 script(src="/javascripts/utils/sha1.js")
e5ec7dea 53 script(src="/javascripts/monitor.js")