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'")
30 #assessmentSettings.modal
34 input#active(type="checkbox" v-model="assessment.active")
35 label(for="active") Active
37 input#secure(name="status" type="radio" value="secure" v-model="assessment.mode")
38 label(for="secure") Exam mode, secured (class only)
40 input#watch(name="status" type="radio" value="watch" v-model="assessment.mode")
41 label(for="watch") Exam mode, watched (class only)
43 input#exam(name="status" type="radio" value="exam" v-model="assessment.mode")
44 label(for="exam") Exam mode, free (class only)
46 input#open(name="status" type="radio" value="open" v-model="assessment.mode")
47 label(for="open") Open to everyone
49 input#fixed(type="checkbox" v-model="assessment.fixed")
50 label(for="fixed") Fixed questions order
52 input#displayOne(name="display" type="radio" value="one" v-model="assessment.display")
53 label(for="displayOne") One question at a time
55 input#displayAll(name="display" type="radio" value="all" v-model="assessment.display")
56 label(for="displayAll") Display all questions
58 input#time(type="number" v-model.number="assessment.time")
59 label(for="time") Time (minutes)
62 a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Done
67 textarea#introduction.materialize-textarea(v-model="assessment.introduction")
68 label(for="introduction") Introduction
70 textarea#assessmentEdition.materialize-textarea(v-model="assessmentText")
71 label(for="assessmentEdition") Assessment in text format
74 a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Done
82 .col.s12.m10.offset-m1
84 h4.title(@click="toggleDisplay('students')") Students
85 .card(v-show="display=='students'")
87 input.hide#upload(type="file" @change="upload")
88 button.on-left.waves-effect.waves-light.btn(@click="uploadTrigger()") Import
96 tr.student(v-for="student in studentList(0)")
97 td {{ student.number }}
99 td {{ student.group }}
100 h4.title(@click="toggleDisplay('assessments')") Assessments
101 .card(v-show="display=='assessments'")
104 a.on-left.waves-effect.waves-light.btn.modal-trigger(href="#newAssessment") New assessment
105 input#password(type="password" v-model="monitorPwd" @keyup.enter="setPassword"
106 placeholder="Password" title="Monitoring password")
115 tr.assessment(v-for="(assessment,i) in assessmentArray" :class="{idle:!assessment.active}"
116 @click.left="actionAssessment(i)" @contextmenu.prevent="deleteAssessment(assessment)")
117 td {{ assessment.name }}
118 td {{ assessment.mode }}
119 td {{ assessment.questions.reduce( (a,b) => { return b.active ? a+1 : a; }, 0) }}
120 td {{ assessment.time }}
122 .row(v-show="mode=='edit'")
123 .col.s12.m10.offset-m1
124 h4 {{ assessment.name }}
127 button.waves-effect.waves-light.btn.on-left(@click="materialOpenModal('assessmentSettings')") Settings
128 button.waves-effect.waves-light.btn.on-left(@click="materialOpenModal('assessmentEdit')") Content
129 button.waves-effect.waves-light.btn(@click="redirect(assessment.name)") View
131 .introduction(v-html="assessment.introduction")
132 .question(v-for="(question,i) in assessment.questions" :class="{questionInactive:!question.active}")
133 .wording(v-html="question.wording")
134 .option(v-for="(option,j) in question.options" :class="{choiceCorrect:question.answer.includes(j)}" v-html="option")
136 input(:id="checkboxFixedId(i)" type="checkbox" v-model="question.fixed")
137 label.on-left(:for="checkboxFixedId(i)") Fixed
138 input(:id="checkboxActiveId(i)" type="checkbox" v-model="question.active")
139 label(:for="checkboxActiveId(i)") Active
140 input(time default 0 = untimed)
141 label Time for the question
143 button.waves-effect.waves-light.btn.on-left(@click="mode='view'") Cancel
144 button.waves-effect.waves-light.btn(@click="updateAssessment") Send
146 block append javascripts
147 script(src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.3.6/papaparse.min.js")
149 let assessmentArray = !{JSON.stringify(assessmentArray)};
150 const course = !{JSON.stringify(course)};
151 const initials = "#{initials}";
152 const admin = #{teacher};
153 script(src="/javascripts/utils/sha1.js")
154 script(src="/javascripts/utils/validation.js")
155 script(src="/javascripts/course.js")