diff --git a/application/controllers/api/frontend/v1/Noten.php b/application/controllers/api/frontend/v1/Noten.php index 488288875..70788d54d 100644 --- a/application/controllers/api/frontend/v1/Noten.php +++ b/application/controllers/api/frontend/v1/Noten.php @@ -531,13 +531,33 @@ class Noten extends FHCAPI_Controller */ private function savePruefungstermin($typ, $student_uid, $lva_id, $stsem, $lehreinheit_id, $note, $punkte, $datum) { + + $status = []; + + // send $grades reference to moodle addon + Events::trigger( + 'getEntschuldigungsStatusForStudentOnDate', + function & () use (&$status) + { + return $status; + }, + [ + 'student_uid' => $student_uid, + 'datum' => $datum + ] + ); + + if(count($status) > 0 && $status[0] == true) { + $note = 17; //entschuldigt + } + $jetzt = date("Y-m-d H:i:s"); $pruefungenChanged = []; $this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel'); - if($typ == "Termin2") + if($typ == "Termin2" && defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN2') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN2) { // Wenn eine Nachprüfung angelegt wird, wird zuerst eine Pruefung mit 1. Termin angelegt welche für die ursprüngliche Note @@ -640,7 +660,7 @@ class Noten extends FHCAPI_Controller } } - } else if($typ == "Termin3") + } else if($typ == "Termin3" && defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN3') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN3) { $result3 = $this->LePruefungModel->getPruefungenByUidTypLvStudiensemester($student_uid, "Termin3", $lva_id, $stsem); diff --git a/public/css/Cis4/Cis.css b/public/css/Cis4/Cis.css index ff1b181dd..7237a4739 100644 --- a/public/css/Cis4/Cis.css +++ b/public/css/Cis4/Cis.css @@ -854,4 +854,21 @@ html { #cis-main .modal-footer { background-color: var(--fhc-secondary); +} + +/* styling for editable dropdown column of notenvorschläge in benotungstool*/ +#notentable .tabulator-tableholder .tabulator-editable { + position: relative; + background-color: rgba(255, 255, 157, 0.73); + cursor: pointer; +} + +#notentable .tabulator-tableholder .tabulator-editable::after { + content: "▾"; + position: absolute; + right: 6px; + color: rgba(176, 176, 106, 0.73);; + font-size: x-large; + bottom: 6px; + pointer-events: none; } \ No newline at end of file diff --git a/public/js/components/Cis/Benotungstool/Benotungstool.js b/public/js/components/Cis/Benotungstool/Benotungstool.js index e20f8166e..9581c7eda 100644 --- a/public/js/components/Cis/Benotungstool/Benotungstool.js +++ b/public/js/components/Cis/Benotungstool/Benotungstool.js @@ -423,6 +423,7 @@ export const Benotungstool = { }, getNotenTableOptions() { return { + rowHeight: 40, height: 700, index: 'uid', layout: 'fitDataStretch', @@ -488,8 +489,8 @@ export const Benotungstool = { {title: Vue.computed(() => this.$p.t('benotungstool/c4mail')), field: 'email', formatter: this.mailFormatter, tooltip: false, widthGrow: 1}, {title: Vue.computed(() => this.$p.t('benotungstool/c4antrittCount')), field: 'hoechsterAntritt', tooltip: false, widthGrow: 1}, {title: 'UID', field: 'uid', tooltip: false, widthGrow: 1, topCalc: this.sumCalcFunc}, - {title: Vue.computed(() => this.$p.t('benotungstool/c4vorname')), field: 'vorname', tooltip: false, widthGrow: 1}, - {title: Vue.computed(() => this.$p.t('benotungstool/c4nachname')), field: 'nachname', widthGrow: 1}, + {title: Vue.computed(() => this.$p.t('benotungstool/c4vorname')), field: 'vorname', headerFilter: true, tooltip: false, widthGrow: 1}, + {title: Vue.computed(() => this.$p.t('benotungstool/c4nachname')), field: 'nachname', headerFilter: true, widthGrow: 1}, {title: Vue.computed(() => this.$p.t('benotungstool/c4teilnoten')), field: 'teilnote', widthGrow: 1, formatter: this.teilnotenFormatter}, {title: Vue.computed(() => this.$p.t('benotungstool/c4note')), field: 'note_vorschlag', editor: 'list', @@ -608,7 +609,7 @@ export const Benotungstool = { }, terminCalcFormatter(cell) { const cellval = cell.getValue() - return this.$p.t('benotungstool/prueflingSelection')+': ' + cellval + return this.$p.t('benotungstool/prueflingSelectionv2')+': ' + cellval }, negativeNotenCalcFormatter(cell) { const cellval = cell.getValue() @@ -903,7 +904,7 @@ export const Benotungstool = { // can save a notenvorschlag -> colored return '
' + - '
' + '' }, mailFormatter(cell) { const val = cell.getValue() @@ -1215,10 +1216,10 @@ export const Benotungstool = { // const pOffset = this.pruefung === null && this.pruefungStudent.pruefungen.length === 0 ? 2 : 1 const typ = this.pruefung ? this.pruefung.pruefungstyp_kurzbz : this.getPruefungstypForStudentByAntritt(this.pruefungStudent) - + const note = this.selectedPruefungNote?.note ?? 9 // noch nicht eingetragen this.$api.call(ApiNoten.saveStudentPruefung( this.pruefungStudent.uid, - this.selectedPruefungNote.note, + note, this.pruefung?.punkte ?? '', dateStr, this.lv_id, @@ -1388,13 +1389,12 @@ export const Benotungstool = { // filter students that already have a pruefung on datum - // TODO: save new pruefungs entry for all selected students on selected date with default note "noch nicht eingetragen" aka 9 - const year = this.selectedPruefungDate.getFullYear(); const month = String(this.selectedPruefungDate.getMonth() + 1).padStart(2, '0'); // Months are 0-based const day = String(this.selectedPruefungDate.getDate()).padStart(2, '0'); - const dateStr = `${year}-${month}-${day}`; - + const dateStrDb = `${year}-${month}-${day}`; + const dateStrFront = `${day}.${month}.${year}`; + const uids = this.selectedUids.map(student => { return { uid: student.uid, @@ -1405,13 +1405,13 @@ export const Benotungstool = { this.loading = true; this.$api.call(ApiNoten.createPruefungen( - uids, - dateStr, + uids, + dateStrDb, this.lv_id, this.sem_kurzbz, )).then(res => { if(res.meta.status === "success") { - this.$fhcAlert.alertSuccess(this.$p.t('benotungstool/pruefungAngelegtAn', [dateStr])) + this.$fhcAlert.alertSuccess(this.$p.t('benotungstool/pruefungAngelegtAn', [dateStrFront])) this.handleAddNewPruefungenResponse(res, uids) @@ -1532,6 +1532,12 @@ export const Benotungstool = { }, []) : [] return cs }, + getNotenfreigabeHinweistext() { + return this.$p.t('benotungstool/notenfreigabeHinweistextv3') + }, + getNotenimportHinweistext() { + return this.$p.t('benotungstool/notenimportHinweistextv3') + } }, created() { this.setupCreated() @@ -1540,15 +1546,20 @@ export const Benotungstool = { this.setupMounted() }, unmounted() { - this.headerEl.removeEventlistener(this.handleSidebar) - this.headerEl.removeEventlistener(this.handleSidebar) + if(this.headerEl) { + this.headerEl.removeEventListener("shown.bs.collapse", this.handleSidebar) + this.headerEl.removeEventListener("hidden.bs.collapse", this.handleSidebar) + this.headerEl = null + } }, template: `