diff --git a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php index c32fa43e6..6dce2b6ae 100644 --- a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php +++ b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php @@ -341,6 +341,9 @@ foreach ($noten_obj->result as $row) } ?> + + const CIS_GESAMTNOTE_PUNKTE = ; + function getOffset(pos) { var x,y; @@ -799,33 +802,48 @@ foreach ($noten_obj->result as $row) } ?> + var linenumber = 0; for(row in rows) { - zeile = rows[row].split(" "); - - - - if (zeile[0]!='' && zeile[1]!='') + linenumber++; + if( rows[row] == '' ) { - gradedata['matrikelnr_'+i]=zeile[0]; - - - i++; + //skip empty lines + continue; } + zeile = rows[row].split(" "); + + if( zeile.length < 2 ) + { + alertMsg = alertMsg + "Zeile " + linenumber + ': ' + + 'Zu wenig Paramter - 2 erforderlich. ' + + 'Die Zeile wurde uebersprungen.' + "\n\n"; + continue; + } + + if (CIS_GESAMTNOTE_PUNKTE == false) + { + // check for valid grades + if (validGrades.indexOf(zeile[1]) === -1) + { + alertMsg = alertMsg + "Zeile " + linenumber + ': ' + + "Die Note "+zeile[1]+" ist nicht zulaessig. " + + "Die Zeile wurde uebersprungen. \n\n"; + continue; + } + } + + gradedata['matrikelnr_'+i]=zeile[0]; + if (CIS_GESAMTNOTE_PUNKTE) + { + gradedata['punkte_'+i]= zeile[1]; + } + else + { + gradedata['note_'+i]= zeile[1]; + } + + i++; } if (alertMsg != "") @@ -895,35 +913,70 @@ foreach ($noten_obj->result as $row) } ?> - + var linenumber = 0; for(row in rows) { - zeile = rows[row].split(" "); - - - - if (zeile[0]!='' && zeile[1]!='' && zeile[2]!='') + linenumber++; + if( rows[row] == '' ) { - gradedata['student_uid_'+i]=zeile[0]; - gradedata['datumNachp_'+i]=zeile[1]; - - - i++; + //skip empty lines + continue; } + zeile = rows[row].split(" "); + + if( zeile.length < 3 ) + { + alertMsg = alertMsg + "Zeile " + linenumber + ': ' + + 'Zu wenig Paramter - 3 erforderlich. ' + + 'Die Zeile wurde uebersprungen.' + "\n\n"; + continue; + } + + if( zeile[1] == '' && zeile[2] == '' ) + { + // ignore lines just copied from excel + continue; + } + + if( zeile[2] == '' ) + { + alertMsg = alertMsg + "Zeile " + linenumber + ': ' + + "Die Note oder Punkte fehlen. " + + "Die Zeile wurde uebersprungen. \n\n"; + continue; + } + + if (CIS_GESAMTNOTE_PUNKTE == false) + { + // check for valid grades + if (validGrades.indexOf(zeile[2]) === -1) + { + alertMsg = alertMsg + "Zeile " + linenumber + ': ' + + "Die Note "+zeile[2]+" ist nicht zulaessig. " + + "Die Zeile wurde uebersprungen. \n\n"; + continue; + } + } + + if( !zeile[1].match(/[0-9]{2}\.[0-9]{2}\.[0-9]{4}/) ) + { + alertMsg = alertMsg + "Zeile " + linenumber + ': ' + + "Das Datum "+zeile[1]+" fehlt oder ist nicht zulaessig. " + + "Die Zeile wurde uebersprungen. \n\n"; + continue; + } + + gradedata['student_uid_'+i]=zeile[0]; + gradedata['datumNachp_'+i]=zeile[1]; + if (CIS_GESAMTNOTE_PUNKTE) + { + gradedata['punkte_'+i]= zeile[2]; + } + else + { + gradedata['note_'+i]= zeile[2]; + } + i++; } diff --git a/cis/private/lehre/benotungstool/nachpruefungeintragen.php b/cis/private/lehre/benotungstool/nachpruefungeintragen.php index 804ab34fb..873c0f173 100644 --- a/cis/private/lehre/benotungstool/nachpruefungeintragen.php +++ b/cis/private/lehre/benotungstool/nachpruefungeintragen.php @@ -130,6 +130,17 @@ if (isset($_REQUEST['sammel']) && $_REQUEST["sammel"] == 1) continue; } $punkte=str_replace(',', '.', $punkte); + if($punkte!='') + { + // Bei Punkteeingabe wird die Note nochmals geprueft und ggf korrigiert + $notenschluessel = new notenschluessel(); + $note_pruef = $notenschluessel->getNote($punkte, $lvid, $stsem); + if($note_pruef!=$note) + { + $note = $note_pruef; + $note_dirty=true; + } + } $datum = $_POST['datumNachp_'.$id]; //check Datumsformat @@ -172,6 +183,10 @@ if (isset($_REQUEST['sammel']) && $_REQUEST["sammel"] == 1) $note = $noten_anmerkung[$note]; } $response = savePruefung($lvid, $student_uid, $stsem, $lehreinheit_id, $datum, $typ, $note, $punkte); + if($response!='neu' && $response!='update' && $response!='update_f') + { + echo $response; + } } else { diff --git a/cis/private/lehre/notenliste.xls.php b/cis/private/lehre/notenliste.xls.php index 2e0403139..63cf45d29 100644 --- a/cis/private/lehre/notenliste.xls.php +++ b/cis/private/lehre/notenliste.xls.php @@ -226,7 +226,7 @@ else if (defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN2') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN2) { - $worksheet->write($lines,8,$p->t('global/uid'),$format_border_bottom); + $worksheet->write($lines,8,$p->t('global/personenkennzeichen'),$format_border_bottom); $worksheet->write($lines,9,$p->t('global/datum'),$format_border_bottom); if(defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE) $worksheet->write($lines,10,$p->t('benotungstool/punkte'),$format_border_bottom); @@ -236,7 +236,7 @@ else if (defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN3') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN3) { - $worksheet->write($lines,12,$p->t('global/uid'),$format_border_bottom); + $worksheet->write($lines,12,$p->t('global/personenkennzeichen'),$format_border_bottom); $worksheet->write($lines,13,$p->t('global/datum'),$format_border_bottom); if(defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE) $worksheet->write($lines,14,$p->t('benotungstool/punkte'),$format_border_bottom); @@ -328,7 +328,7 @@ else // Nachprüfung if (defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN2') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN2) { - $worksheet->write($lines,8, $elem->uid, $format_highlightright); + $worksheet->write($lines,8, '="'.trim($elem->matrikelnr).'"', $format_highlight); $pr = new Pruefung(); $pr->getPruefungen($elem->uid, "Termin2", $lvid, $sem); $output2 = $pr->result; @@ -349,7 +349,7 @@ else // Nachprüfung if (defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN3') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN3) { - $worksheet->write($lines,12, $elem->uid, $format_highlightright); + $worksheet->write($lines,12, '="'.trim($elem->matrikelnr).'"', $format_highlight); $pr = new Pruefung(); $pr->getPruefungen($elem->uid, "Termin3", $lvid, $sem); $output3 = $pr->result; @@ -420,5 +420,17 @@ else $worksheet->setColumn(0, 3, 25); $worksheet->setColumn(0, 4, 7); $worksheet->setColumn(0, 5, 21); + + if (defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN2') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN2) + { + $worksheet->setColumn(8, 8, 15); + $worksheet->setColumn(9, 9, 10); + } + if (defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN3') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN3) + { + $worksheet->setColumn(12, 12, 15); + $worksheet->setColumn(13, 13, 10); + } + $workbook->close(); ?>