3 block append stylesheets
4 link(rel="stylesheet" href="/stylesheets/statements.css")
5 link(rel="stylesheet" href="/stylesheets/course.css")
12 form(@submit.prevent="addAssessment")
14 input#assessmentName(type="text" v-model="newAssessment.name" required)
15 label(for="assessmentName") Name
18 a.waves-effect.waves-light.btn(href="#!" @click="addAssessment()")
20 i.material-icons.right send
21 .row(v-show="mode=='view'")
33 input#active(type="checkbox" v-model="assessment.active")
34 label(for="active") Assessment is active
37 span(title="Exam mode, secured (class only): students cannot lose focus or exit fullscreen")
38 input#secure(name="status" type="radio" value="secure" v-model="assessment.mode")
39 label(for="secure") secure
40 span(title="Exam mode, watched (class only): teachers are notified when students lose focus or resize window")
41 input#watch(name="status" type="radio" value="watch" v-model="assessment.mode")
42 label(for="watch") watch
43 span(title="Exam mode, unwatched: students can browse the web freely")
44 input#exam(name="status" type="radio" value="exam" v-model="assessment.mode")
45 label(for="exam") exam
46 span(title="Questions list open to the world (useful mode after an exam, or for a 'questions bank'")
47 input#open(name="status" type="radio" value="open" v-model="assessment.mode")
48 label(for="open") open
50 input#fixed(type="checkbox" v-model="assessment.fixed")
51 label(for="fixed") Fixed questions order
54 span(title="Show only one question at a time (with potential sub-questions)")
55 input#displayOne(name="display" type="radio" value="one" v-model="assessment.display")
56 label(for="displayOne") one
57 span(title="Always show all questions (with an optional navigator)")
58 input#displayAll(name="display" type="radio" value="all" v-model="assessment.display")
59 label(for="displayAll") all
61 input#time(type="number" v-model.number="assessment.time")
62 label(for="time") Time (minutes)
64 textarea#introduction.materialize-textarea(v-model="assessment.introduction")
65 label(for="introduction") Introduction
67 textarea#assessmentEdition.materialize-textarea(v-model="assessmentText")
68 label(for="assessmentEdition") Assessment in text format
76 .col.s12.m10.offset-m1
78 h4.title(@click="toggleDisplay('students')") Students
79 .card(v-show="display=='students'")
81 input.hide#upload(type="file" @change="upload")
82 button.on-left.waves-effect.waves-light.btn(@click="uploadTrigger()") Import
90 tr.student(v-for="student in studentList(0)")
91 td {{ student.number }}
93 td {{ student.group }}
94 h4.title(@click="toggleDisplay('assessments')") Assessments
95 .card(v-show="display=='assessments'")
98 a.on-left.waves-effect.waves-light.btn.modal-trigger(href="#newAssessment") New assessment
99 input#password(type="password" v-model="monitorPwd" @keyup.enter="setPassword"
100 placeholder="Password" title="Monitoring password")
109 tr.assessment(v-for="(assessment,i) in assessmentArray" :class="{idle:!assessment.active}"
110 @click.left="actionAssessment(i)" @contextmenu.prevent="deleteAssessment(assessment)")
111 td {{ assessment.name }}
112 td {{ assessment.mode }}
113 td {{ assessment.questions.reduce( (a,b) => { return b.active ? a+1 : a; }, 0) }}
114 td {{ assessment.time }}
116 .row(v-show="mode=='edit'")
117 .col.s12.m10.offset-m1
122 // TODO: always edit mode, with a modal preview
126 h4 {{ assessment.name }}
129 button.waves-effect.waves-light.btn.on-left(@click="materialOpenModal('assessmentSettings')") Settings
130 button.waves-effect.waves-light.btn.on-left(@click="materialOpenModal('assessmentEdit')") Content
131 button.waves-effect.waves-light.btn(@click="redirect(assessment.name)") View
133 .introduction(v-html="assessment.introduction")
134 .question(v-for="(question,i) in assessment.questions" :class="{questionInactive:!question.active}")
135 .wording(v-html="question.wording")
136 .option(v-for="(option,j) in question.options" :class="{choiceCorrect:question.answer.includes(j)}" v-html="option")
138 input(:id="checkboxFixedId(i)" type="checkbox" v-model="question.fixed")
139 label.on-left(:for="checkboxFixedId(i)") Fixed
140 input(:id="checkboxActiveId(i)" type="checkbox" v-model="question.active")
141 label(:for="checkboxActiveId(i)") Active
142 input(time default 0 = untimed)
143 label Time for the question
145 button.waves-effect.waves-light.btn.on-left(@click="mode='view'") Cancel
146 button.waves-effect.waves-light.btn(@click="updateAssessment") Send
148 block append javascripts
149 script(src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.3.6/papaparse.min.js")
151 let assessmentArray = !{JSON.stringify(assessmentArray)};
152 const course = !{JSON.stringify(course)};
153 const initials = "#{initials}";
154 const admin = #{teacher};
155 script(src="/javascripts/utils/sha1.js")
156 script(src="/javascripts/utils/validation.js")
157 script(src="/javascripts/course.js")