X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=views%2Fcourse.pug;h=34bf4623c6ed5b671f29bd3f164aaf1aefdf3f6a;hb=87d1063bdac629eca89c7ec0192fbc17e069a197;hp=16552ceeecf188ebd05fa26944b1fbe15d3ce55f;hpb=e99c53fb3be56eb4c685dd061eef0e5b5bf22b73;p=qomet.git diff --git a/views/course.pug b/views/course.pug index 16552ce..34bf462 100644 --- a/views/course.pug +++ b/views/course.pug @@ -1,6 +1,7 @@ extends withQuestions block append stylesheets + link(rel="stylesheet" href="/stylesheets/statements.css") link(rel="stylesheet" href="/stylesheets/course.css") block content @@ -17,84 +18,62 @@ block content a.waves-effect.waves-light.btn(href="#!" @click="addAssessment()") span Submit i.material-icons.right send - #assessmentSettings.modal - .modal-content - form - p - input#active(type="checkbox" v-model="assessment.active") - label(for="active") Active - p + .row(v-show="mode=='view'") + + + + + + + + + #assessmentEdit + form + p + input#active(type="checkbox" v-model="assessment.active") + label(for="active") Assessment is active + div + h4 Questions mode: + span(title="Exam mode, secured (class only): students cannot lose focus or exit fullscreen") input#secure(name="status" type="radio" value="secure" v-model="assessment.mode") - label(for="secure") Exam mode, secured (class only) - p + label(for="secure") secure + span(title="Exam mode, watched (class only): teachers are notified when students lose focus or resize window") + input#watch(name="status" type="radio" value="watch" v-model="assessment.mode") + label(for="watch") watch + span(title="Exam mode, unwatched: students can browse the web freely") input#exam(name="status" type="radio" value="exam" v-model="assessment.mode") - label(for="exam") Exam mode, free (class only) - p + label(for="exam") exam + span(title="Questions list open to the world (useful mode after an exam, or for a 'questions bank'") input#open(name="status" type="radio" value="open" v-model="assessment.mode") - label(for="open") Open to everyone - p - input#fixed(type="checkbox" v-model="assessment.fixed") - label(for="fixed") Fixed questions order - p + label(for="open") open + p + input#fixed(type="checkbox" v-model="assessment.fixed") + label(for="fixed") Fixed questions order + div + h4 Display type: + span(title="Show only one question at a time (with potential sub-questions)") input#displayOne(name="display" type="radio" value="one" v-model="assessment.display") - label(for="displayOne") One question at a time - p + label(for="displayOne") one + span(title="Always show all questions (with an optional navigator)") input#displayAll(name="display" type="radio" value="all" v-model="assessment.display") - label(for="displayAll") Display all questions - .input-field - input#time(type="number" v-model.number="assessment.time") - label(for="time") Time (minutes) - .modal-footer - .center-align - a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Done - #assessmentEdit.modal - .modal-content - form - .input-field - textarea#introduction.materialize-textarea(v-model="assessment.introduction") - label(for="introduction") Introduction - .input-field - textarea#assessmentEdition.materialize-textarea(v-model="assessmentText") - label(for="assessmentEdition") Assessment in text format - .input-field - textarea#conclusion.materialize-textarea(v-model="assessment.conclusion") - label(for="conclusion") Conclusion - .modal-footer - .center-align - a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Done - #gradeSettings.modal - .modal-content - form(@submit.prevent="computeGrades") - .input-field - input#points(type="number" v-model.number="settings.totalPoints" required) - label(for="points") Total points - p - input#partial(type="checkbox" v-model="settings.halfPoint") - label(for="partial") Half point for partial answers? (≥ 50%) - p - input#malus(type="checkbox" v-model="settings.zeroSum") - label(for="malus") Lose points on wrong answers? ("Zero-sum" game) - .modal-footer - .center-align - a.modal-action.modal-close.waves-effect.waves-light.btn(href="#!" @click="computeGrades()") - span Compute - i.material-icons.right send - #detailedGrades.modal - .modal-content - table - thead - tr - th Number - th(v-for="assessment in assessmentArray") {{ assessment.name }} - tbody - tr.grade(v-for="student in studentList(group)") - td {{ student.number }} - td(v-for="(assessment,i) in assessmentArray" @click="togglePresence(student.number,i)") {{ grade(i,student.number) }} - .modal-footer - .center-align - a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Close - .row(v-show="mode=='view'") - .col.s12.m10.offset-m1.l8.offset-l2.xl6.offset-xl3 + label(for="displayAll") all + .input-field + input#time(type="number" v-model.number="assessment.time") + label(for="time") Time (minutes) + .input-field + textarea#introduction.materialize-textarea(v-model="assessment.introduction") + label(for="introduction") Introduction + .input-field + textarea#assessmentEdition.materialize-textarea(v-model="assessmentText") + label(for="assessmentEdition") Assessment in text format + + + + + + + + .col.s12.m10.offset-m1 if teacher h4.title(@click="toggleDisplay('students')") Students .card(v-show="display=='students'") @@ -105,13 +84,11 @@ block content thead tr th Number - th Forename th Name th Group tbody tr.student(v-for="student in studentList(0)") td {{ student.number }} - td {{ student.forename }} td {{ student.name }} td {{ student.group }} h4.title(@click="toggleDisplay('assessments')") Assessments @@ -119,51 +96,33 @@ block content if teacher .center-align a.on-left.waves-effect.waves-light.btn.modal-trigger(href="#newAssessment") New assessment - input#password(type="password" v-model="monitorPwd" @keyup.enter="setPassword" placeholder="Password" title="Monitoring password") + input#password(type="password" v-model="monitorPwd" @keyup.enter="setPassword" + placeholder="Password" title="Monitoring password") table thead tr th Name - th Coefficient + th Mode th #Questions th Time tbody - tr.assessment(v-for="(assessment,i) in assessmentArray" @click.left="actionAssessment(i)" @contextmenu.prevent="deleteAssessment(assessment)") + tr.assessment(v-for="(assessment,i) in assessmentArray" :class="{idle:!assessment.active}" + @click.left="actionAssessment(i)" @contextmenu.prevent="deleteAssessment(assessment)") td {{ assessment.name }} - td {{ assessment.coefficient }} + td {{ assessment.mode }} td {{ assessment.questions.reduce( (a,b) => { return b.active ? a+1 : a; }, 0) }} td {{ assessment.time }} - if teacher - h4.title(@click="toggleDisplay('grades')") Grades - .card(v-show="display=='grades'") - .center-align - button.on-left.waves-effect.waves-light.btn(@click="gradeSettings()") Settings - a#download.hide(href="#" ref="download") - button.waves-effect.waves-light.btn(@click="download") Download - ul.tabs.tabs-fixed-width - li.tab - a(href="#group0") All - li.tab(v-for="group in groupList()") - a(:href="groupId(group,'hash')") G.{{ group }} - table.result(:id="groupId(group)" v-for="group in [0].concat(groupList())" @click="showDetails(group)") - thead - tr - th Number - th Forename - th Name - th Final - tbody - tr.grade(v-for="student in studentList(group)") - td {{ student.number }} - td {{ student.forename }} - td {{ student.name }} - td grade... - //td {{ grades[student.number].final }} - tr.stats - td(colspan="4") Stats: range= stdev= mean= if teacher .row(v-show="mode=='edit'") - .col.s12.m10.offset-m1.l8.offset-l2.xl6.offset-xl3 + .col.s12.m10.offset-m1 + + + + + // TODO: always edit mode, with a modal preview + + + h4 {{ assessment.name }} .card .center-align @@ -176,22 +135,23 @@ block content .wording(v-html="question.wording") .option(v-for="(option,j) in question.options" :class="{choiceCorrect:question.answer.includes(j)}" v-html="option") p - input(:id="checkBoxFixedId(i)" type="checkbox" v-model="question.fixed") - label.on-left(:for="checkBoxFixedId(i)") Fixed - input(:id="checkBoxActiveId(i)" type="checkbox" v-model="question.active") - label(:for="checkBoxActiveId(i)") Active - .conclusion(v-html="assessment.conclusion") + input(:id="checkboxFixedId(i)" type="checkbox" v-model="question.fixed") + label.on-left(:for="checkboxFixedId(i)") Fixed + input(:id="checkboxActiveId(i)" type="checkbox" v-model="question.active") + label(:for="checkboxActiveId(i)") Active + input(time default 0 = untimed) + label Time for the question .center-align button.waves-effect.waves-light.btn.on-left(@click="mode='view'") Cancel button.waves-effect.waves-light.btn(@click="updateAssessment") Send block append javascripts script(src="//cdnjs.cloudflare.com/ajax/libs/PapaParse/4.3.6/papaparse.min.js") - script(src="/javascripts/utils/sha1.js") - script(src="/javascripts/utils/validation.js") script. let assessmentArray = !{JSON.stringify(assessmentArray)}; const course = !{JSON.stringify(course)}; const initials = "#{initials}"; const admin = #{teacher}; + script(src="/javascripts/utils/sha1.js") + script(src="/javascripts/utils/validation.js") script(src="/javascripts/course.js")