$sql="select max(schnitt) from LESSON_ORDER LO join (select LESSON_ID, round(sum(time)/count(LESSON_ID),1) as schnitt from (select LESSON_ID, STUD_ID, max(datum) - min(datum) as time from (select stud_ID, datum, LESSON_ID from ERror_log union select stud_ID, datum, LESSON_ID from Logon) group by (LESSON_ID, STUD_ID)) group by LESSON_ID)tmp on LO.LESSON_ID=tmp.LESSON_ID order by LO.NR";
$stmt = dbconnect($sql);
OCIExecute($stmt);
$nrows = OCIFetchStatement($stmt,$results);
if ( $nrows == 1 )
{
OCIExecute($stmt);
while(OCIFetch($stmt))
{
$tagmax = OCIResult($stmt, $results); // Anzahl der zu lösenden Aufgaben
}
}
$sql="select LO.NR, schnitt as \"benötigte Zeit\" from LESSON_ORDER LO join (select LESSON_ID, round(sum(time)/count(LESSON_ID),1) as schnitt from (select LESSON_ID, STUD_ID, max(datum) - min(datum) as time from (select stud_ID, datum, LESSON_ID from ERror_log union select stud_ID, datum, LESSON_ID from Logon) group by (LESSON_ID, STUD_ID)) group by LESSON_ID)tmp on LO.LESSON_ID=tmp.LESSON_ID order by LO.NR";// benötigte Zeit ermitteln...
$stmt = dbconnect($sql);
OCIExecute($stmt);
$nrows = OCIFetchStatement($stmt,$results);
if ( $nrows > 0 )
{
print "
\n";
print "\n";
while ( list( $key, $val ) = each( $results ) )
{
print "$key | \n";
}
print " \n";
for ( $i = 0; $i < $nrows; $i++ )
{
$col=0;
reset($results);
print "\n";
while ( $column = each($results) )
{
$data = $column['value'];
if ($col==1)
{
$wert = (float)(ereg_replace(",", ".", $data[$i])); // umwandeln in float
$percent = $wert * 100/$tagmax; //wieviel Prozent der aufgaben hat der Student gelöst
$width = $percent * 4;
if ($percent >= 0 and $percent <= 25)
print " $wert Tage | ";
if ($percent > 25 and $percent < 50)
print " $wert Tage | ";
if ($percent >= 50)
print " $wert Tage | ";
/*if ($percent == 0)
print " $wert Tage | ";
if ($percent > 0 and $percent < 1)
print " $wert Tage | ";*/
}
else
print "$data[$i] | \n"; // Name und vorname ausgeben....
$col++;
}
print " \n";
}
}
else
{
if (isset($_GET['ID']))
{
$message = "Es sind noch keine Aufgaben gelöst worden....";
}
print "" . $message . "
| ";
}
?>
include("../footer.php");
?> |