Commit | Line | Data |
---|---|---|
e99c53fb BA |
1 | extends withQuestions |
2 | ||
3 | block append stylesheets | |
43828378 | 4 | link(rel="stylesheet" href="/stylesheets/statements.css") |
e99c53fb BA |
5 | link(rel="stylesheet" href="/stylesheets/course.css") |
6 | ||
7 | block content | |
8 | .container#course | |
9 | if teacher | |
cb39647a | 10 | #newEvaluation.modal |
e99c53fb | 11 | .modal-content |
cb39647a | 12 | form(@submit.prevent="addEvaluation") |
e99c53fb | 13 | .input-field |
a3080c33 BA |
14 | input#evaluationName(type="text" v-model="newEvaluation.name" required) |
15 | label(for="evaluationName") Name | |
e99c53fb BA |
16 | .modal-footer |
17 | .center-align | |
a3080c33 | 18 | a.waves-effect.waves-light.btn(href="#!" @click="addEvaluation()") |
e99c53fb BA |
19 | span Submit |
20 | i.material-icons.right send | |
c8f68697 | 21 | .row(style="margin-bottom:0") |
a3080c33 | 22 | .col.s12.m10.offset-m1 |
e99c53fb BA |
23 | h4.title(@click="toggleDisplay('students')") Students |
24 | .card(v-show="display=='students'") | |
25 | .center-align | |
26 | input.hide#upload(type="file" @change="upload") | |
27 | button.on-left.waves-effect.waves-light.btn(@click="uploadTrigger()") Import | |
28 | table | |
29 | thead | |
30 | tr | |
31 | th Number | |
e99c53fb BA |
32 | th Name |
33 | th Group | |
34 | tbody | |
35 | tr.student(v-for="student in studentList(0)") | |
36 | td {{ student.number }} | |
e99c53fb BA |
37 | td {{ student.name }} |
38 | td {{ student.group }} | |
c8f68697 | 39 | .row(style="margin-bottom:0") |
a3080c33 | 40 | .col.s12.m10.offset-m1 |
cb39647a | 41 | h4.title(@click="toggleDisplay('evaluations')") Evaluations |
a3080c33 | 42 | .card(v-show="display=='evaluations'") |
e99c53fb BA |
43 | if teacher |
44 | .center-align | |
cb39647a | 45 | a.on-left.waves-effect.waves-light.btn.modal-trigger(href="#newEvaluation") New evaluation |
b3540dbb BA |
46 | input#password(type="password" v-model="monitorPwd" @keyup.enter="setPassword" |
47 | placeholder="Password" title="Monitoring password") | |
e99c53fb BA |
48 | table |
49 | thead | |
50 | tr | |
51 | th Name | |
0b57a78b | 52 | th Mode |
e99c53fb | 53 | th #Questions |
e99c53fb | 54 | tbody |
a3080c33 | 55 | tr.evaluation(v-for="(evaluation,i) in evaluationArray" :class="{idle:!evaluation.active}" |
cb39647a | 56 | @click.left="actionEvaluation(i)" @contextmenu.prevent="deleteEvaluation(evaluation)") |
a3080c33 BA |
57 | td {{ evaluation.name }} |
58 | td {{ evaluation.mode }} | |
59 | td {{ evaluation.questions.length }} | |
c8f68697 BA |
60 | if teacher |
61 | div(v-show="evaluationIndex >= 0") | |
62 | h4 {{ evaluation.name }} | |
63 | .card(v-show="mode=='view'") | |
64 | .center-align | |
65 | button.waves-effect.waves-light.btn.on-left(@click="mode='edit'") Edit | |
66 | button.waves-effect.waves-light.btn(@click="redirect(evaluation.name)") View | |
67 | div | |
68 | .introduction(v-html="evaluation.introduction") | |
92a6f830 | 69 | statements(:questions="evaluation.questions" :answers="evaluation.answers" :display="'solution'") |
c8f68697 BA |
70 | .card(v-show="mode=='edit'") |
71 | form(@submit.prevent) | |
72 | p | |
73 | input#active(type="checkbox" v-model="evaluation.active") | |
74 | label(for="active") evaluation is active | |
75 | div | |
76 | h4 Questions mode: | |
77 | span(title="Exam mode, secured (class only): students cannot lose focus or exit fullscreen") | |
78 | input#secure(name="status" type="radio" value="secure" v-model="evaluation.mode") | |
79 | label(for="secure") secure | |
80 | span(title="Exam mode, watched (class only): teachers are notified when students lose focus or resize window") | |
81 | input#watch(name="status" type="radio" value="watch" v-model="evaluation.mode") | |
82 | label(for="watch") watch | |
83 | span(title="Exam mode, unwatched: students can browse the web freely") | |
84 | input#exam(name="status" type="radio" value="exam" v-model="evaluation.mode") | |
85 | label(for="exam") exam | |
86 | span(title="Questions list open to the world (useful mode after an exam, or for a 'questions bank'") | |
87 | input#open(name="status" type="radio" value="open" v-model="evaluation.mode") | |
88 | label(for="open") open | |
89 | p | |
90 | input#fixed(type="checkbox" v-model="evaluation.fixed") | |
91 | label(for="fixed") Fixed questions order | |
92 | div | |
93 | h4 Display type: | |
94 | span(title="Show only one question at a time (with potential sub-questions)") | |
95 | input#displayOne(name="display" type="radio" value="one" v-model="evaluation.display") | |
96 | label(for="displayOne") one | |
97 | span(title="Always show all questions (with an optional navigator)") | |
98 | input#displayAll(name="display" type="radio" value="all" v-model="evaluation.display") | |
99 | label(for="displayAll") all | |
100 | .input-field | |
101 | input#time(type="number" v-model.number="evaluation.time") | |
102 | label(for="time") Time (minutes) | |
103 | .input-field | |
104 | textarea#introduction.materialize-textarea(v-model="evaluation.introduction") | |
105 | label(for="introduction") Introduction | |
106 | .input-field | |
107 | textarea#evaluationEdition.materialize-textarea(v-model="questionsText") | |
108 | label(for="evaluationEdition") evaluation in text format | |
109 | .center-align | |
110 | button.waves-effect.waves-light.btn.on-left(@click="updateEvaluation()") Send | |
111 | button.waves-effect.waves-light.btn(@click="mode='view'") Cancel | |
e99c53fb BA |
112 | |
113 | block append javascripts | |
114 | script(src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.3.6/papaparse.min.js") | |
e99c53fb | 115 | script. |
a3080c33 | 116 | let evaluationArray = !{JSON.stringify(evaluationArray)}; |
e99c53fb BA |
117 | const course = !{JSON.stringify(course)}; |
118 | const initials = "#{initials}"; | |
119 | const admin = #{teacher}; | |
9872823d BA |
120 | script(src="/javascripts/utils/sha1.js") |
121 | script(src="/javascripts/utils/validation.js") | |
c8f68697 | 122 | script(src="/javascripts/utils/libsRefresh.js") |
a3080c33 | 123 | script(src="/javascripts/components/statements.js") |
e99c53fb | 124 | script(src="/javascripts/course.js") |