diff --git a/content/student/studentDBDML.php b/content/student/studentDBDML.php index 44e7310d4..f8936b0b3 100644 --- a/content/student/studentDBDML.php +++ b/content/student/studentDBDML.php @@ -2614,23 +2614,31 @@ if(!$error) } else { - $punkte=$_POST['punkte']; - $lehrveranstaltung_id=$_POST['lehrveranstaltung_id']; - $studiensemester_kurzbz=$semester_aktuell; - - $notenschluessel = new notenschluessel(); - if(($note = $notenschluessel->getNote($punkte, $lehrveranstaltung_id, $studiensemester_kurzbz))!==false) + if(is_numeric($punkte)) { - $return = true; - $error = false; - $data = $note; + $lehrveranstaltung_id=$_POST['lehrveranstaltung_id']; + $studiensemester_kurzbz=$semester_aktuell; + + $notenschluessel = new notenschluessel(); + if(($note = $notenschluessel->getNote($punkte, $lehrveranstaltung_id, $studiensemester_kurzbz))!==false) + { + $return = true; + $error = false; + $data = $note; + } + else + { + $return = false; + $error = true; + $errormsg=$notenschluessel->errormsg; + } } else { - $return = false; - $error = true; - $errormsg=$notenschluessel->errormsg; + $return = true; + $error = false; + $data = ''; } } } @@ -2717,7 +2725,7 @@ if(!$error) $noten->benotungsdatum = date('Y-m-d H:i:s'); $noten->note = $_POST['note']; if(isset($_POST['punkte'])) - $noten->punkte=$_POST['punkte']; + $noten->punkte=str_replace(',','.',$_POST['punkte']); if($noten->save()) { diff --git a/include/zeugnisnote.class.php b/include/zeugnisnote.class.php index 8ee364330..90cb8e3a4 100644 --- a/include/zeugnisnote.class.php +++ b/include/zeugnisnote.class.php @@ -149,6 +149,11 @@ class zeugnisnote extends basis_db $this->errormsg = 'Note ist ungueltig'; return false; } + if($this->punkte!='' && !is_numeric($this->punkte)) + { + $this->errormsg = 'Punkte sind ungueltig'; + return false; + } if($this->uebernahmedatum!='' && !mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$this->uebernahmedatum)) { $this->errormsg = 'Uebernahmedatum ist ungueltig';