diff --git a/application/controllers/api/frontend/v1/Noten.php b/application/controllers/api/frontend/v1/Noten.php index 13f63a689..8ec5191ff 100644 --- a/application/controllers/api/frontend/v1/Noten.php +++ b/application/controllers/api/frontend/v1/Noten.php @@ -95,7 +95,8 @@ class Noten extends FHCAPI_Controller // '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) -// 'CIS_GESAMTNOTE_PRUEFUNG_TERMIN2' => CIS_GESAMTNOTE_PRUEFUNG_TERMIN2, + // send it anyway to use in maxAntritte calculation + 'CIS_GESAMTNOTE_PRUEFUNG_TERMIN2' => CIS_GESAMTNOTE_PRUEFUNG_TERMIN2, // TODO @@ -561,7 +562,7 @@ class Noten extends FHCAPI_Controller } - $result = $this->LvgesamtnoteModel->getLvGesamtNote($lva_id, $student_uid, $stsem); + $result = $this->LvgesamtnoteModel->getLvGesamtNoten($lva_id, $student_uid, $stsem); if(!isError($result) && !hasData($result)) { $id = $this->LvgesamtnoteModel->insert( @@ -670,8 +671,6 @@ class Noten extends FHCAPI_Controller $pruefungenChanged = []; - $this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel'); - if($typ == "Termin2" && defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN2') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN2) { @@ -726,9 +725,12 @@ class Noten extends FHCAPI_Controller $res = $this->LePruefungModel->load($id->retval); if(hasData($res)) $pruefungenChanged['extraPruefung'] = getData($res); } + + $this->logLib->logInfoDB(array('termin1 created',$res, getAuthUID(), getAuthPersonId())); + } - $this->logLib->logInfoDB(array('termin1 created',$res, getAuthUID(), getAuthPersonId())); + // Die Pruefung wird als Termin2 eingetragen diff --git a/public/js/components/Cis/Benotungstool/Benotungstool.js b/public/js/components/Cis/Benotungstool/Benotungstool.js index e832f5a09..9df7cf46f 100644 --- a/public/js/components/Cis/Benotungstool/Benotungstool.js +++ b/public/js/components/Cis/Benotungstool/Benotungstool.js @@ -231,14 +231,28 @@ export const Benotungstool = { } }, validatePruefungBulk(pruefungen) { + console.log('validatePruefungBulk') + // need to check pruefungen for validity in respect to the students nr of antritte // pruefungsdatum will be validated aswell so we dont get a termin 3 chronologically before // a termin 2 which is totally possible in the old tool const validatedPruefungen = [] pruefungen.forEach( p => { const student = this.studenten.find(s => s.uid === p.uid) + + // if a student doesnt have a lv_note entered definitely dont allow to create pruefung + if(!student.lv_note) { + this.$fhcAlert.alertWarning('Student ' + student.uid + ' hat noch keine LV-Note eingetragen! Es wird keine Prüfung angelegt.') + return + } + + if(!student.note) { + this.$fhcAlert.alertWarning('Student ' + student.uid + ' hat noch keine Zeugnis Note eingetragen! Es wird keine Prüfung angelegt.') + return + } + // check if student antrittCount is too high already - if(student.hoechsterAntritt >= 3) { + if(student.hoechsterAntritt >= this.maxAntrittCount) { this.$fhcAlert.alertWarning('Student ' + student.uid + ' hat bereits ' + student.hoechsterAntritt + ' Prüfungsantritte abgelegt. Die Zeile wurde übersprungen.') return } @@ -386,6 +400,7 @@ export const Benotungstool = { }) }, savePruefungBulk(pruefungenbulk) { + console.log('pruefungenbulk', pruefungenbulk) this.loading = true this.$api.call(ApiNoten.saveStudentPruefungBulk(this.lv_id, this.sem_kurzbz, pruefungenbulk)) .then((res)=> { @@ -467,7 +482,8 @@ export const Benotungstool = { widthGrow: 1, minWidth: 150, originalNote, - visible: true + visible: true, + tooltip: false }) }) @@ -476,6 +492,8 @@ export const Benotungstool = { this.loading = false + // TODO: find some solution so the tool does not appear "jumpy" after pruefung calls + this.$refs.notenTable.tabulator.clearSort() this.$refs.notenTable.tabulator.setColumns(cols) this.$refs.notenTable.tabulator.setData(this.studenten); @@ -548,7 +566,7 @@ export const Benotungstool = { const data = row.getData(); if(data['kommPruef']) return false - else if(data.hoechsterAntritt >= 3) return false // 3 pruefungen counted + else if(data.hoechsterAntritt >= this.maxAntrittCount) return false // 3 pruefungen counted return true; // student can be selected to add pruefung }, @@ -701,7 +719,8 @@ export const Benotungstool = { formatter: this.pruefungFormatter, topCalc: this.terminCalcFunc, topCalcFormatter: this.terminCalcFormatter, - hozAlign:"center", minWidth: 150, visible: false + hozAlign:"center", minWidth: 150, visible: false, + tooltip: false }) return columns @@ -742,7 +761,7 @@ export const Benotungstool = { const data = row.getData() - const notSelectable = data.pruefungen?.find(p => p.pruefungstyp_kurzbz == 'kommPruef') || data.hoechsterAntritt >= 3 + const notSelectable = data.pruefungen?.find(p => p.pruefungstyp_kurzbz == 'kommPruef') || data.hoechsterAntritt >= this.maxAntrittCount if(notSelectable) { row.getElement().children[0]?.children[0]?.remove() } @@ -898,10 +917,12 @@ export const Benotungstool = { return '