abgaben bei kreuzerllisten

This commit is contained in:
Gerald Raab
2007-09-24 08:30:38 +00:00
parent 6373f23518
commit 752df70ddf
5 changed files with 101 additions and 18 deletions
@@ -74,6 +74,20 @@ else
$lehreinheit_obj = new lehreinheit($conn, $lehreinheit_id);
}
}
//Abgabedatei ausliefern
if (isset($_GET["download_abgabe"])){
$file=$_GET["download_abgabe"];
$uebung_id = $_GET["uebung_id"];
$ueb = new uebung($conn);
$ueb->load_studentuebung($uid, $uebung_id);
$ueb->load_abgabe($ueb->abgabe_id);
$filename = BENOTUNGSTOOL_PATH."abgabe/".$ueb->abgabedatei;
header('Content-Type: application/octet-stream');
header('Content-disposition: attachment; filename="'.$file.'"');
readfile($filename);
exit;
}
$qry = "SELECT * FROM lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id) WHERE
tbl_lehreinheit.lehreinheit_id='$lehreinheit_obj->lehreinheit_id' AND
@@ -688,7 +702,7 @@ function addUser(student_uid)
echo "<input type='hidden' name='update_ids' value=''>";
echo "<table border='1'>
<tr>
<td colspan='".($anzahl+2)."' width='100%'>
<td colspan='".($anzahl+3)."' width='100%'>
<table width='100%'>
<tr>
<td><font class='headline'>$lehrveranstaltung_obj->semester.Semester</font></td>
@@ -709,12 +723,22 @@ function addUser(student_uid)
echo "<td>$row->bezeichnung</td>";
}
}
echo "<td align='center' width='200'><b>Unterschrift</b></td></tr>\n";
echo "<td align='center' width='200'><b>Unterschrift</b></td><td></td></tr>\n";
if($result = pg_query($conn, $qry_stud))
{
while($row_stud = pg_fetch_object($result))
{
$uebung_obj->load_studentuebung($row_stud->uid, $uebung_id);
if ($uebung_obj->abgabe_id)
{
$uebung_obj->load_abgabe($uebung_obj->abgabe_id);
$filename = $uebung_obj->abgabedatei;
}
else
$filename='';
echo "<tr onMouseOver=\"this.style.backgroundColor='#c7dfe8'\" onMouseOut=\"this.style.backgroundColor='#ffffff'\">
<td nowrap><input type='checkbox' name='update_$row_stud->uid' disabled>&nbsp;<b>$row_stud->nachname</b>&nbsp;$row_stud->vorname $row_stud->uid</td>";
if (!$uebung_obj->beispiele)
@@ -732,8 +756,15 @@ function addUser(student_uid)
$studentbeispiel_obj->load_studentbeispiel($row_stud->uid, $row_bsp->beispiel_id);
echo "<td align='center'><input type='checkbox' name='update_".$row_stud->uid."_".$row_bsp->beispiel_id."' onClick=\"addUser('$row_stud->uid');\" ".($studentbeispiel_obj->vorbereitet?'checked':'').">".($studentbeispiel_obj->probleme?'<i><small>P</small></i>':'')."</td>\n";
}
}
echo "<td>&nbsp;</td>\n</tr>\n";
}
echo "<td>&nbsp;</td>";
if ($filename != "")
echo "<td><a href='anwesenheitsliste.php?uid=$row_stud->uid&output=html&uebung_id=$uebung_id&lehreinheit_id=$lehreinheit_id&stsem=$stsem&download_abgabe=$filename'>Abgabe</a></td>\n";
else if ($uebung_obj->abgabe)
echo "<td><span style='color:red;'>Fehlt!</span></td>";
else
echo "<td></td>";
echo "</tr>\n";
}
}
@@ -150,14 +150,14 @@ if (isset($_REQUEST["deleteabgabe"]))
echo $ueb->errormsg;
}
//echo $_FILES["abgabedatei"];
if (isset($_FILES["abgabedatei"]))
{
$abgabedatei_up = $_FILES["abgabedatei"]["tmp_name"];
if ($abgabedatei_up)
{
//echo $abgabedatei_up;
$datum = date('Y-m-d H:i:s');
$datumstr = ereg_replace(" ","_",$datum);
$name_up = pathinfo($_FILES["abgabedatei"]["name"]);
@@ -208,7 +208,6 @@ if (isset($_FILES["abgabedatei"]))
$uebung_obj->studentuebung_save(false);
//Abgabedatei ablegen
move_uploaded_file($_FILES['abgabedatei']['tmp_name'], $abgabepfad);
}
}
else
@@ -668,11 +667,40 @@ if (!isset($_GET["notenuebersicht"]))
//Speichern button nur Anzeigen wenn die Uebung Freigegeben ist
if($datum_obj->mktime_fromtimestamp($uebung_obj->freigabevon)<time() && $datum_obj->mktime_fromtimestamp($uebung_obj->freigabebis)>time())
echo "<tr><td align='right' colspan=5><input type='submit' value='Speichern' name='submit'></td></tr>";
echo "<tr><td align='right' colspan=5><input type='submit' value='Speichern' name='submit'></td></form></tr>";
echo "</table>";
echo "
</td><td valign='top' algin='right'>";
echo "</table>";
if ($uebung_obj->abgabe)
{
echo "<br><table>\n";
$uebung_obj->load_studentuebung($user, $uebung_id);
if ($uebung_obj->abgabe_id)
{
$uebung_obj->load_abgabe($uebung_obj->abgabe_id);
echo " <tr>";
echo" <td>Abgabedatei: <a href='studentenansicht.php?uid=$user&lvid=$lvid&lehreinheit_id=$lehreinheit_id&uebung_id=$uebung_id&stsem=$stsem&download_abgabe=".$uebung_obj->abgabedatei."'>".$uebung_obj->abgabedatei."</a>";
if($datum_obj->mktime_fromtimestamp($uebung_obj->freigabevon)<time() && $datum_obj->mktime_fromtimestamp($uebung_obj->freigabebis)>time())
echo " <a href='studentenansicht.php?uid=$user&lvid=$lvid&lehreinheit_id=$lehreinheit_id&uebung_id=$uebung_id&stsem=$stsem&deleteabgabe=1'>[del]</a></td>";
echo "</tr>";
}
if($datum_obj->mktime_fromtimestamp($uebung_obj->freigabevon)<time() && $datum_obj->mktime_fromtimestamp($uebung_obj->freigabebis)>time())
{
echo " <tr>\n";
echo " <form method='POST' action='studentenansicht.php?uid=$user&lvid=$lvid&lehreinheit_id=$lehreinheit_id&uebung_id=$uebung_id&stsem=$stsem' enctype='multipart/form-data' name='kl_angabe'>\n";
echo " <td>\n";
echo " <input type='file' name='abgabedatei'> <input type='submit' name='abgabe' value='Abgeben'>";
echo " </td>\n";
echo " </form>\n";
echo "</tr>\n";
}
echo "</table>";
}
echo "</td><td valign='top' algin='right'>";
//Gesamtpunkte diese Kreuzerlliste
$qry = "SELECT sum(punkte) as punktegesamt FROM campus.tbl_beispiel WHERE uebung_id='$uebung_id'";
@@ -883,6 +911,7 @@ if (!isset($_GET["notenuebersicht"]))
echo " <input type='file' name='abgabedatei'> <input type='submit' name='abgabe' value='Abgeben'>";
echo " </td>\n";
echo " </form>\n";
echo "</tr>\n";
}
echo "</table>\n";
@@ -514,7 +514,23 @@ if(isset($_GET['uid']) && $_GET['uid']!='')
}
echo "</table>";
$ueb_obj->load_studentuebung($uid, $uebung_id);
if ($ueb_obj->abgabe_id)
{
$ueb_obj->load_abgabe($ueb_obj->abgabe_id);
$filename = $ueb_obj->abgabedatei;
}
else
$filename='';
if ($filename != '')
echo "<br>Abgabedatei: <a href='studentenpunkteverwalten.php?lvid=$lvid&stsem=$stsem&lehreinheit_id=$lehreinheit_id&uebung_id=$uebung_id&uid=$uid&download_abgabe=$filename'>".$filename."</a><br><br>";
echo "
</td><td valign='top' algin='right'>";
@@ -748,6 +764,8 @@ else
$downloadname = str_replace($uebung_id, ereg_replace(" ","_",$abgabe_obj->bezeichnung), $downloadname);
echo "<a href='zipdownload_benotungstool.php?lvid=$lvid&stsem=$stsem&lehreinheit_id=$lehreinheit_id&uebung_id=$uebung_id&downloadname=$downloadname'> [Abgaben downloaden]</a>";
}
else
echo "[Keine Abgaben verfügbar]";
echo '</td></tr></table>';
}
@@ -468,7 +468,10 @@ if(isset($_POST['uebung_neu']) || isset($_POST['abgabe_neu']))
$uebung_obj->freigabebis = date('Y-m-d H:i',$freigabebis_sav);
if (isset($_POST["uebung_neu"]))
{
$uebung_obj->abgabe=false;
if (isset($_POST["kl_abgabe"]))
$uebung_obj->abgabe=true;
else
$uebung_obj->abgabe=false;
$uebung_obj->beispiele=true;
}
else
@@ -691,7 +694,8 @@ if(isset($_POST['uebung_edit']))
$uebung_obj->angabedatei=$angabedatei_neu;
$uebung_obj->freigabevon = date('Y-m-d H:i',$freigabevon_sav);
$uebung_obj->freigabebis = date('Y-m-d H:i',$freigabebis_sav);
//$uebung_obj->abgabe=false;
if ($uebung_obj->beispiele)
$uebung_obj->abgabe = (isset($_POST['kl_abgabe'])?true:false);
//$uebung_obj->beispiele=true;
$uebung_obj->bezeichnung=$thema;
$uebung_obj->positiv=(isset($_POST['positiv'])?true:false);
@@ -851,13 +855,14 @@ if(isset($_GET["uebung_id"]) && $_GET["uebung_id"]!='')
if ($uebung_obj->beispiele){
echo "<tr><td>Max. Studenten/Beispiel</td><td align='right'><input type='text' name='maxstd' value='$uebung_obj->maxstd'></td><td>$error_maxstd</td></tr>
<tr><td>Max. Beispiele/Student</td><td align='right'><input type='text' name='maxbsp' value='$uebung_obj->maxbsp'></td><td>$error_maxbsp</td></tr>";
<tr><td>Max. Beispiele/Student</td><td align='right'><input type='text' name='maxbsp' value='$uebung_obj->maxbsp'></td><td>$error_maxbsp</td></tr>";
echo"<tr><td>Abgabe </td><td><input type='checkbox' name='kl_abgabe' ".($uebung_obj->abgabe?'checked':'')."></td></tr>";
echo "<input type='hidden' size='16' name='gewicht' value='0'>";
}
else if ($uebung_obj->abgabe)
{
echo "<tr><td>Gewicht</td><td align='right'><input type='text' size='16' name='gewicht' value='$uebung_obj->gewicht'></td><td>$error_gewicht</td></tr>";
echo"<tr><td>Positiv </td><td><input type='checkbox' name='positiv' ".($uebung_obj->positiv?'checked':'')."></td></tr>";
echo "<tr><td>Positiv </td><td><input type='checkbox' name='positiv' ".($uebung_obj->positiv?'checked':'')."></td></tr>";
}
if ($uebung_obj->beispiele)
echo"<tr><td>Statistik f&uuml;r Studenten anzeigen </td><td><input type='checkbox' name='statistik' ".($uebung_obj->statistik?'checked':'')."></td></tr>";
@@ -1178,7 +1183,7 @@ else
<tr><td>Freigabe</td><td align='right'>von <input type='text' size='16' name='freigabevon' value='$freigabevon'></td><td>$error_freigabevon</td></tr>
<tr><td>(Format: 31.12.2007 14:30)</td><td align='right'>bis <input type='text' size='16' name='freigabebis' value='$freigabebis'></td><td>$error_freigabebis</td></tr>
<input type='hidden' size='16' name='gewicht' value='0'>
<!--<tr><td>Positiv </td><td><input type='checkbox' name='positiv'></td></tr>-->
<tr><td>Abgabe </td><td><input type='checkbox' name='kl_abgabe'></td></tr>
<tr><td>Statistik f&uuml;r Studenten anzeigen </td><td><input type='checkbox' name='statistik'></td></tr>
<tr><td>Angabedatei</td><td><input type='file' name='angabedatei'></td></tr>
<tr><td colspan=2 align='right'><input type='submit' name='uebung_neu' value='Anlegen'></td></tr>
+1 -1
View File
@@ -132,7 +132,7 @@ class studentnote
foreach ($ueb_obj->uebungen as $ueb)
{
if ($ueb->abgabe)
if ($ueb->abgabe && !$ueb->beispiele)
{
if ($this->calc_note($ueb->uebung_id, $student_uid))
{