Skip to content
Snippets Groups Projects
Commit 16091561 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Fix updating of tardiness value and removal of personal notes

parent a2cc67ab
No related branches found
No related tags found
No related merge requests found
Pipeline #81541 failed
......@@ -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