diff --git a/application/config/noten.php b/application/config/noten.php new file mode 100644 index 000000000..0eedde2ae --- /dev/null +++ b/application/config/noten.php @@ -0,0 +1,6 @@ + wirken sich nicht auf Antritte aus +$config['NOTEN_OHNE_ANTRITT'] = [9, 17]; // tbl_note pk \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/Noten.php b/application/controllers/api/frontend/v1/Noten.php index 8ec5191ff..0d385a5d2 100644 --- a/application/controllers/api/frontend/v1/Noten.php +++ b/application/controllers/api/frontend/v1/Noten.php @@ -78,11 +78,14 @@ class Noten extends FHCAPI_Controller $this->load->model('codex/Mobilitaet_model', 'MobilitaetModel'); $this->load->model('organisation/Erhalter_model', 'ErhalterModel'); + $this->load->config('noten'); $this->load->helper('hlp_sancho_helper'); } public function getCisConfig() { + $NOTEN_OHNE_ANTRITT = $this->config->item('NOTEN_OHNE_ANTRITT'); + $this->terminateWithSuccess( array( // Punkte bei der Noteneingabe anzeigen @@ -92,33 +95,33 @@ class Noten extends FHCAPI_Controller 'CIS_GESAMTNOTE_UEBERSCHREIBEN' => CIS_GESAMTNOTE_UEBERSCHREIBEN, // only relevant in punkte calculation in backend -// 'CIS_GESAMTNOTE_GEWICHTUNG' => CIS_GESAMTNOTE_GEWICHTUNG, + // 'CIS_GESAMTNOTE_GEWICHTUNG' => CIS_GESAMTNOTE_GEWICHTUNG, // this one should always be set true since fh prüfungsordnung requires at least 3 antritte (t1+t2+kP) // send it anyway to use in maxAntritte calculation 'CIS_GESAMTNOTE_PRUEFUNG_TERMIN2' => CIS_GESAMTNOTE_PRUEFUNG_TERMIN2, - - - // TODO + // should in 99% of cases be kept true to enable 4 antritte in total, but if a certain - // fh still works with 3 antritte per note this can limit the max number of pruefungen accordingly + // fh still works with 3 antritte per note this can limit the max number of antritte accordingly 'CIS_GESAMTNOTE_PRUEFUNG_TERMIN3' => CIS_GESAMTNOTE_PRUEFUNG_TERMIN3, // used to toggle availability of kommPruef type pruefungen 'CIS_GESAMTNOTE_PRUEFUNG_KOMMPRUEF' => CIS_GESAMTNOTE_PRUEFUNG_KOMMPRUEF, //technically exists but is never used, could be LE pendant to next flag -// 'CIS_GESAMTNOTE_PRUEFUNG_MOODLE_NOTE' => CIS_GESAMTNOTE_PRUEFUNG_MOODLE_NOTE, + // 'CIS_GESAMTNOTE_PRUEFUNG_MOODLE_NOTE' => CIS_GESAMTNOTE_PRUEFUNG_MOODLE_NOTE, // basically a toggle for "use teilnoten" and the source is always moodle // setting this to false breaks legacy tool and if that was fixed it wouldnt render any table at all // anyway so not sure why this even is a config at all. placebo at best - // TODO: do we really need this? + // toggles availability of the teilnoten column... existas but do we really need this? 'CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE' => CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE, // send a mail when approving grades - 'CIS_GESAMTNOTE_FREIGABEMAIL_NOTE' => CIS_GESAMTNOTE_FREIGABEMAIL_NOTE + 'CIS_GESAMTNOTE_FREIGABEMAIL_NOTE' => CIS_GESAMTNOTE_FREIGABEMAIL_NOTE, + + 'NOTEN_OHNE_ANTRITT' => $NOTEN_OHNE_ANTRITT ) ); } diff --git a/public/js/components/Cis/Benotungstool/Benotungstool.js b/public/js/components/Cis/Benotungstool/Benotungstool.js index 25b7868a2..849f58678 100644 --- a/public/js/components/Cis/Benotungstool/Benotungstool.js +++ b/public/js/components/Cis/Benotungstool/Benotungstool.js @@ -377,8 +377,7 @@ export const Benotungstool = { student = this.studenten.find(s => s.uid?.trim() === idTrimmed) } if(!student) { - // TODO: phrase - this.$fhcAlert.alertWarning('Kein Student gefunden für ID ' + rowParts[0] + ' in Zeile Nr. ' + rowNum + ' Die Zeile wurde übersprungen.') + this.$fhcAlert.alertWarning(this.$p.t('benotungstool/c4importNoStudentFoundForIdInRow', [rowParts[0], rowNum])) return } @@ -392,8 +391,7 @@ export const Benotungstool = { // find notenoption and check if its allowed to use in lehre const notenOption = this.notenOptions.find(n => n.note == note) if(!notenOption.lehre) { - // TODO: phrasen - this.$fhcAlert.alertWarning('Keine gültige Note gefunden für ID ' + rowParts[0] + ' in Zeile Nr. ' + rowNum + ' Die Zeile wurde übersprungen.') + this.$fhcAlert.alertWarning(this.$p.t('benotungstool/c4importNoGradeFoundForIdInRow', [rowParts[0], rowNum])) return } } @@ -410,15 +408,13 @@ export const Benotungstool = { student = this.studenten.find(s => s.uid?.trim() === idTrimmed) } if(!student) { - // TODO: phrase - this.$fhcAlert.alertWarning('Kein Student gefunden für ID ' + rowParts[0] + ' in Zeile Nr. ' + rowNum + ' Die Zeile wurde übersprungen.') + this.$fhcAlert.alertWarning(this.$p.t('benotungstool/c4importNoStudentFoundForIdInRow', [rowParts[0], rowNum])) return } const datum = rowParts[1] // should be in 'dd.MM.yyyy' if(!this.isValidDate_ddmmyyyy(datum)) { - // TODO: phrase - this.$fhcAlert.alertWarning('Ungültiges Datumformat für ID ' + rowParts[0] + ' in Zeile Nr. ' + rowNum + '. Bitte verwenden Sie das Format "DD.MM.YYYY". Die Zeile wurde übersprungen.') + this.$fhcAlert.alertWarning(this.$p.t('benotungstool/c4importInvalidDateFoundForIdInRow', [rowParts[0], rowNum])) return } const datumParts = datum.split('.') @@ -443,8 +439,7 @@ export const Benotungstool = { // find notenoption and check if its allowed to use in lehre const notenOption = this.notenOptions.find(n => n.note == note) if(!notenOption.lehre) { - // TODO: phrasen - this.$fhcAlert.alertWarning('Keine gültige Note gefunden für ID ' + rowParts[0] + ' in Zeile Nr. ' + rowNum + ' Die Zeile wurde übersprungen.') + this.$fhcAlert.alertWarning(this.$p.t('benotungstool/c4importNoGradeFoundForIdInRow', [rowParts[0], rowNum])) return } } @@ -632,8 +627,7 @@ export const Benotungstool = { } this.loading = false - - // TODO: find some solution so the tool does not appear "jumpy" after pruefung calls + const colsFinal = colsUsed ?? cols this.$refs.notenTable.tabulator.setColumns(colsFinal) this.$refs.notenTable.tabulator.setData(this.studenten); @@ -1694,9 +1688,7 @@ export const Benotungstool = { this.reformatStudentRow(s) } - this.$refs.notenTable.tabulator.redraw(true) - Vue.nextTick(()=> { const table = this.$refs.notenTable.tabulator.element.querySelector('.tabulator-tableholder') if(table) { @@ -2006,9 +1998,9 @@ export const Benotungstool = { const pLen = student.pruefungen.length for(let i = 0; i < pLen; i++) { const p = student.pruefungen[i] - - // TODO: CHECK AGAINST NOTEN OPTIONS - if(p.note != 9 && p.note != 17) pruefungsAntrittCount++ + + const isDefinedAsAntrittsloseNote = this.config.NOTEN_OHNE_ANTRITT.find(n_pk => n_pk == p.note) + if(!isDefinedAsAntrittsloseNote) pruefungsAntrittCount++ } // when student never had to take an exam beyond the original benotung diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index f48163e89..87ab2572e 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -54774,6 +54774,66 @@ and represent the current state of research on the topic. The prescribed citatio ) ) ), + array( + 'app' => 'core', + 'category' => 'benotungstool', + 'phrase' => 'c4importNoStudentFoundForIdInRow', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Keine StudentIn gefunden für ID {0} in Zeile Nr. {1}. Die Zeile wurde übersprungen.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'No student found for ID {0} in row no. {1}. The row has been skipped.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'benotungstool', + 'phrase' => 'c4importNoGradeFoundForIdInRow', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Keine Note gefunden für ID {0} in Zeile Nr. {1}. Die Zeile wurde übersprungen.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'No grade found for ID {0} in row no. {1}. The row has been skipped.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'benotungstool', + 'phrase' => 'c4importInvalidDateFoundForIdInRow', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ungültiges Datumformat für ID {0} in Zeile Nr. {1}. Bitte verwenden Sie das Format "DD.MM.YYYY". Die Zeile wurde übersprungen.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Invalid date found for ID {0} in row no. {1}. Please use the format "DD.MM.YYYY". The row has been skipped.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), // CIS4 GESAMTNOTENEINGABE ENDE ------------------------------------------------------------------------------------ array( 'app' => 'core',