3 block append stylesheets
4 link(rel="stylesheet" href="/stylesheets/course.css")
11 form(@submit.prevent="addAssessment")
13 input#assessmentName(type="text" v-model="newAssessment.name" required)
14 label(for="assessmentName") Name
17 a.waves-effect.waves-light.btn(href="#!" @click="addAssessment()")
19 i.material-icons.right send
20 #assessmentSettings.modal
24 input#active(type="checkbox" v-model="assessment.active")
25 label(for="active") Active
27 input#secure(name="status" type="radio" value="secure" v-model="assessment.mode")
28 label(for="secure") Exam mode, secured (class only)
30 input#exam(name="status" type="radio" value="exam" v-model="assessment.mode")
31 label(for="exam") Exam mode, free (class only)
33 input#open(name="status" type="radio" value="open" v-model="assessment.mode")
34 label(for="open") Open to everyone
36 input#fixed(type="checkbox" v-model="assessment.fixed")
37 label(for="fixed") Fixed questions order
39 input#displayOne(name="display" type="radio" value="one" v-model="assessment.display")
40 label(for="displayOne") One question at a time
42 input#displayAll(name="display" type="radio" value="all" v-model="assessment.display")
43 label(for="displayAll") Display all questions
45 input#time(type="number" v-model.number="assessment.time")
46 label(for="time") Time (minutes)
49 a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Done
54 textarea#introduction.materialize-textarea(v-model="assessment.introduction")
55 label(for="introduction") Introduction
57 textarea#assessmentEdition.materialize-textarea(v-model="assessmentText")
58 label(for="assessmentEdition") Assessment in text format
60 textarea#conclusion.materialize-textarea(v-model="assessment.conclusion")
61 label(for="conclusion") Conclusion
64 a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Done
67 form(@submit.prevent="computeGrades")
69 input#points(type="number" v-model.number="settings.totalPoints" required)
70 label(for="points") Total points
72 input#partial(type="checkbox" v-model="settings.halfPoint")
73 label(for="partial") Half point for partial answers? (≥ 50%)
75 input#malus(type="checkbox" v-model="settings.zeroSum")
76 label(for="malus") Lose points on wrong answers? ("Zero-sum" game)
79 a.modal-action.modal-close.waves-effect.waves-light.btn(href="#!" @click="computeGrades()")
81 i.material-icons.right send
88 th(v-for="assessment in assessmentArray") {{ assessment.name }}
90 tr.grade(v-for="student in studentList(group)")
91 td {{ student.number }}
92 td(v-for="(assessment,i) in assessmentArray" @click="togglePresence(student.number,i)")
93 {{ grade(i,student.number) }}
96 a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Close
97 .row(v-show="mode=='view'")
98 .col.s12.m10.offset-m1.l8.offset-l2.xl6.offset-xl3
100 h4.title(@click="toggleDisplay('students')") Students
101 .card(v-show="display=='students'")
103 input.hide#upload(type="file" @change="upload")
104 button.on-left.waves-effect.waves-light.btn(@click="uploadTrigger()") Import
112 tr.student(v-for="student in studentList(0)")
113 td {{ student.number }}
114 td {{ student.name }}
115 td {{ student.group }}
116 h4.title(@click="toggleDisplay('assessments')") Assessments
117 .card(v-show="display=='assessments'")
120 a.on-left.waves-effect.waves-light.btn.modal-trigger(href="#newAssessment") New assessment
121 input#password(type="password" v-model="monitorPwd" @keyup.enter="setPassword"
122 placeholder="Password" title="Monitoring password")
131 tr.assessment(v-for="(assessment,i) in assessmentArray" v-if="assessment.active"
132 @click.left="actionAssessment(i)" @contextmenu.prevent="deleteAssessment(assessment)")
133 td {{ assessment.name }}
134 td {{ assessment.mode }}
135 td {{ assessment.questions.reduce( (a,b) => { return b.active ? a+1 : a; }, 0) }}
136 td {{ assessment.time }}
138 h4.title(@click="toggleDisplay('grades')") Grades
139 .card(v-show="display=='grades'")
141 button.on-left.waves-effect.waves-light.btn(@click="gradeSettings()") Settings
142 a#download.hide(href="#" ref="download")
143 button.waves-effect.waves-light.btn(@click="download") Download
144 ul.tabs.tabs-fixed-width
146 a(href="#group0") All
147 li.tab(v-for="group in groupList()")
148 a(:href="groupId(group,'#')") G.{{ group }}
149 table.result(:id="groupId(group)" v-for="group in [0].concat(groupList())" @click="showDetails(group)")
156 tr.grade(v-for="student in studentList(group)")
157 td {{ student.number }}
158 td {{ student.name }}
160 //td {{ grades[student.number].final }}
162 td(colspan="4") Stats: range= stdev= mean=
164 .row(v-show="mode=='edit'")
165 .col.s12.m10.offset-m1.l8.offset-l2.xl6.offset-xl3
166 h4 {{ assessment.name }}
169 button.waves-effect.waves-light.btn.on-left(@click="materialOpenModal('assessmentSettings')") Settings
170 button.waves-effect.waves-light.btn.on-left(@click="materialOpenModal('assessmentEdit')") Content
171 button.waves-effect.waves-light.btn(@click="redirect(assessment.name)") View
173 .introduction(v-html="assessment.introduction")
174 .question(v-for="(question,i) in assessment.questions" :class="{questionInactive:!question.active}")
175 .wording(v-html="question.wording")
176 .option(v-for="(option,j) in question.options" :class="{choiceCorrect:question.answer.includes(j)}" v-html="option")
178 input(:id="checkBoxFixedId(i)" type="checkbox" v-model="question.fixed")
179 label.on-left(:for="checkBoxFixedId(i)") Fixed
180 input(:id="checkBoxActiveId(i)" type="checkbox" v-model="question.active")
181 label(:for="checkBoxActiveId(i)") Active
182 .conclusion(v-html="assessment.conclusion")
184 button.waves-effect.waves-light.btn.on-left(@click="mode='view'") Cancel
185 button.waves-effect.waves-light.btn(@click="updateAssessment") Send
187 block append javascripts
188 script(src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.3.6/papaparse.min.js")
189 script(src="/javascripts/utils/sha1.js")
190 script(src="/javascripts/utils/validation.js")
192 let assessmentArray = !{JSON.stringify(assessmentArray)};
193 const course = !{JSON.stringify(course)};
194 const initials = "#{initials}";
195 const admin = #{teacher};
196 script(src="/javascripts/course.js")