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 { ...@@ -16,17 +16,15 @@ export default {
return return
} }
console.log("removing personal note of person", personID); console.log("removing personal note of person", personID);
this.personalNotes.forEach(item => { this.editedPersonID = personID;
if (item.person.id === personID) { this.editedTardiness = 0;
item.tardiness = 0; this.editedAbsent = false;
item.absent = false; this.editedExcused = false;
item.excused = false; this.editedExcuseType = null;
item.excuseType = null; this.editedExtraMarks = [];
item.extraMarks = []; this.editedRemarks = "";
item.remarks = "";
} this.savePersonalNote();
});
this.$emit('change', this.personalNotes)
}, },
editPersonalNote(personID) { editPersonalNote(personID) {
console.log("editing personal note of person", personID); console.log("editing personal note of person", personID);
...@@ -36,7 +34,7 @@ export default { ...@@ -36,7 +34,7 @@ export default {
}, },
updatePersonalNote() { updatePersonalNote() {
let personalNote = this.personalNoteByStudentID(this.editedPersonID); let personalNote = this.personalNoteByStudentID(this.editedPersonID);
this.editedTardiness = personalNote.tardiness || 0; this.editedTardiness = personalNote.late || 0;
this.editedAbsent = personalNote.absent || false; this.editedAbsent = personalNote.absent || false;
this.editedExcused = personalNote.excused || false; this.editedExcused = personalNote.excused || false;
this.editedExcuseType = personalNote.excuseType || null; this.editedExcuseType = personalNote.excuseType || null;
...@@ -174,8 +172,8 @@ export default { ...@@ -174,8 +172,8 @@ export default {
}, },
personalNoteString(personalNote) { personalNoteString(personalNote) {
let personalNoteString = ""; let personalNoteString = "";
if (personalNote.tardiness > 0) { if (personalNote.late > 0) {
personalNoteString += personalNote.tardiness + " min. "; personalNoteString += personalNote.late + " min. ";
} }
if (personalNote.absent) { if (personalNote.absent) {
personalNoteString += "abwesend "; 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