Skip to content
Snippets Groups Projects
Verified Commit c1c1e394 authored by Hangzhi Yu's avatar Hangzhi Yu Committed by magicfelix
Browse files

Fix updating of tardiness value and removal of personal notes

parent 1d96753c
No related branches found
No related tags found
1 merge request!284Draft: Redesign entering of lesson documentation
......@@ -16,17 +16,15 @@ export default {
return
}
console.log("removing personal note of person", personID);
this.personalNotes.forEach(item => {
if (item.person.id === personID) {
item.tardiness = 0;
item.absent = false;
item.excused = false;
item.excuseType = null;
item.extraMarks = [];
item.remarks = "";
}
});
this.$emit('change', this.personalNotes)
this.editedPersonID = personID;
this.editedTardiness = 0;
this.editedAbsent = false;
this.editedExcused = false;
this.editedExcuseType = null;
this.editedExtraMarks = [];
this.editedRemarks = "";
this.savePersonalNote();
},
editPersonalNote(personID) {
console.log("editing personal note of person", personID);
......@@ -36,7 +34,7 @@ export default {
},
updatePersonalNote() {
let personalNote = this.personalNoteByStudentID(this.editedPersonID);
this.editedTardiness = personalNote.tardiness || 0;
this.editedTardiness = personalNote.late || 0;
this.editedAbsent = personalNote.absent || false;
this.editedExcused = personalNote.excused || false;
this.editedExcuseType = personalNote.excuseType || null;
......@@ -174,8 +172,8 @@ export default {
},
personalNoteString(personalNote) {
let personalNoteString = "";
if (personalNote.tardiness > 0) {
personalNoteString += personalNote.tardiness + " min. ";
if (personalNote.late > 0) {
personalNoteString += personalNote.late + " min. ";
}
if (personalNote.absent) {
personalNoteString += "abwesend ";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment