2c5c03e63b49738152928a215ff069dc5b6a1d61
[qomet.git] / views / grade.pug
1 extends withQuestions
2
3 block append stylesheets
4 link(rel="stylesheet" href="/stylesheets/statements.css")
5 link(rel="stylesheet" href="/stylesheets/grade.css")
6
7 block rightMenu
8 a#rightButton.btn-floating.btn-large.grey(href="grade")
9 i.material-icons mode_edit
10
11
12 #gradeSettings.modal
13 .modal-content
14 form(@submit.prevent="computeGrades")
15 .input-field
16 input#points(type="number" v-model.number="settings.totalPoints" required)
17 label(for="points") Total points
18 p
19 input#partial(type="checkbox" v-model="settings.halfPoint")
20 label(for="partial") Half point for partial answers? (≥ 50%)
21 p
22 input#malus(type="checkbox" v-model="settings.zeroSum")
23 label(for="malus") Lose points on wrong answers? ("Zero-sum" game)
24 .modal-footer
25 .center-align
26 a.modal-action.modal-close.waves-effect.waves-light.btn(href="#!" @click="computeGrades()")
27 span Compute
28 i.material-icons.right send
29 #detailedGrades.modal
30 .modal-content
31 table
32 thead
33 tr
34 th Number
35 th(v-for="evaluation in evaluationArray") {{ evaluation.name }}
36 tbody
37 tr.grade(v-for="student in studentList(group)")
38 td {{ student.number }}
39 td(v-for="(evaluation,i) in evaluationArray" @click="togglePresence(student.number,i)")
40 | {{ grade(i,student.number) }}
41 .modal-footer
42 .center-align
43 a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Close
44
45
46 block content
47 .container#grading
48 .row
49 .col.s12.m10.offset-m1
50 h4 #{courseCode} grading
51 // TODO: Allow grading per student, per question or sub-question
52 .card
53 ul.tabs.tabs-fixed-width
54 li.tab
55 a(href="#group0") All
56 li.tab(v-for="group in groupList()")
57 a(:href="groupId(group,'#')") G.{{ group }}
58 table(:id="groupId(group)" v-for="group in [0].concat(groupList())")
59 thead
60 tr
61 th Name
62 th(v-for="(q,i) in evaluation.questions") Q.{{ (i+1) }}
63 tbody
64 tr.evaluation(v-for="s in studentList(group)")
65 td {{ s.name }}
66 td(v-for="(q,i) in evaluation.questions" :style="{background-color: getColor(number,i)}" @click="seeDetails(number,i)")  
67 h4.title(@click="toggleDisplay('evaluation')") evaluation
68 div(v-show="display=='evaluation'")
69 .card
70 .introduction(v-html="evaluation.introduction")
71 .card
72 statements(:questions="evaluation.questions" :answers:"answers")
73
74
75
76 if teacher
77 h4.title(@click="toggleDisplay('grades')") Grades
78 .card(v-show="display=='grades'")
79 .center-align
80 button.on-left.waves-effect.waves-light.btn(@click="gradeSettings()") Settings
81 a#download.hide(href="#" ref="download")
82 button.waves-effect.waves-light.btn(@click="download") Download
83 ul.tabs.tabs-fixed-width
84 li.tab
85 a(href="#group0") All
86 li.tab(v-for="group in groupList()")
87 a(:href="groupId(group,'#')") G.{{ group }}
88 table.result(:id="groupId(group)" v-for="group in [0].concat(groupList())" @click="showDetails(group)")
89 thead
90 tr
91 th Number
92 th Name
93 th Final
94 tbody
95 tr.grade(v-for="student in studentList(group)")
96 td {{ student.number }}
97 td {{ student.name }}
98 td grade...
99 //td {{ grades[student.number].final }}
100 tr.stats
101 td(colspan="4") Stats: range= stdev= mean=
102
103
104
105
106 block append javascripts
107 script.
108 const initials = "#{initials}";
109 const courseCode = "#{courseName}";
110 script(src="/javascripts/utils/sha1.js")
111 script(src="/javascripts/grade.js")