summaryrefslogtreecommitdiff
path: root/doc/nils-diplom/Dateistruktur/results/statistic.php
blob: 74e0fb86e4948f9627cdac436f5ffa14f63e360e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
	
	include("../header.php");

	$user = $_SESSION['user'];
	
	$sql = "select max(tmp.versuche) from ERROR_LOG join (SELECT LESSON_ID, count(lesson_ID) as VERSUCHE FROM error_log group by LESSon_ID)tmp on tmp.LESSON_ID=ERROR_LOG.LESSON_ID"; // wieviele Aufgabe sind derzeit aktiv
	
		$stmt = dbconnect($sql);

		OCIExecute($stmt);
				
		$nrows = OCIFetchStatement($stmt,$results);  	

		if ( $nrows == 1 ) 
			{
				OCIExecute($stmt);

				while(OCIFetch($stmt))
				{
					$max = OCIResult($stmt, $results); // Anzahl der zu lösenden Aufgaben
				}
			}


	$sql = "select LO.NR, VERSUCHE_insgesamt from LESSON_ORDER LO join (SELECT LESSON_ID, count(lesson_ID) as VERSUCHE_insgesamt FROM error_log group by LESSON_ID)tmp on LO.LESSON_ID=tmp.LESSON_ID order by LO.NR";

	$stmt = dbconnect($sql);

	OCIExecute($stmt);

?>

				<tr >
				<td><div class=titel_15>STATISTIK</div></td>						
				</tr>
				<tr>
				<td><br></td>
				</tr>
				<tr>
				<td bgcolor=#e99900 colspan=2><div class=text><b>Überblick über die Lösungsversuche pro Aufgabe:</b></div></td>
				</tr>
				<tr>
				<td>
								
<?


$nrows = OCIFetchStatement($stmt,$results);		//Ergebnisse in Array eintragen...

if ( $nrows > 0 ) 
	{
		   print "<BR><TABLE BORDER=\"1\"  class=text>\n";
		   print "<TR>\n";
		   while ( list( $key, $val ) = each( $results ) ) 
			   {
				print "<TH>$key</TH>\n";
			   }
   print "</TR>\n";
   
   for ( $i = 0; $i < $nrows; $i++ ) {
      $col=0;
	  reset($results);
      print "<TR>\n";
      while ( $column = each($results) ) 
			{
			 $data = $column['value'];
			
			 if ($col==1)
				{
				 $percent = $data[$i] * 100/$max;  //wieviel Prozent der aufgaben hat der Student gelöst 

				 $width = $percent * 400/100; // Darstellung per Balkendiagramm
				 
				 if ($percent <= 25) 
					print "<td width=500>&nbsp;<img src=\"/dipl/css/balken_gruen.gif\" width=$width height=10 > $data[$i] Anfragen</td>"; 
				 if ($percent > 25 and $percent < 50)
					print "<td width=500>&nbsp;<img src=\"/dipl/css/balken_orange.gif\" width=$width height=10 > $data[$i] Anfragen</td>";
				 if ($percent >= 50)
					print "<td width=500>&nbsp;<img src=\"/dipl/css/balken_rot.gif\" width=$width height=10 > $data[$i] Anfragen</td>";
				}
			
			 else
				print "<TD>$data[$i]</TD>\n"; 
			 $col++;
			}
      print "</TR>\n";
   }
	print "<tr><td colspan=3 class=text>Verteilung der Anzahl Anfragen nach Aufgaben.<BR></td></tr>";
	print "</TABLE><BR>";
	}


?>

<br><br>
</td>
</tr>
<tr>
<td colspan=2><div class=text>&nbsp;</div></td>
</tr>
<tr>
<td bgcolor=#e99900 colspan=2><div class=text><b>durchschnittlich zur Lösung benötigte Zeit in Tagen:</b>:</div></td>
</tr>
<tr>
<td colspan=2><div class=text>&nbsp;</div></td>
</tr>
<tr>
<td>

<?

$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 "<BR><TABLE BORDER=\"1\" class=text width=560>\n";
	   print "<TR>\n";
	   while ( list( $key, $val ) = each( $results ) ) 
			{
				print "<TH>$key</TH>\n";
			}
		   print "</TR>\n";
		   
		   for ( $i = 0; $i < $nrows; $i++ ) 
			   {
				  $col=0;
				  reset($results);
				  print "<TR>\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 "<td width=500>&nbsp;<img src=\"/dipl/css/balken_gruen.gif\" width=$width height=10 > $wert Tage</td>"; 
							 if ($percent > 25 and $percent < 50)
								print "<td width=500>&nbsp;<img src=\"/dipl/css/balken_orange.gif\" width=$width height=10 > $wert Tage</td>";
							 if ($percent >= 50)
								print "<td width=500>&nbsp;<img src=\"/dipl/css/balken_rot.gif\" width=$width height=10 > $wert Tage</td>";
							 /*if ($percent == 0) 
								print "<td width=500>&nbsp;$wert Tage</td>";
								if ($percent > 0 and $percent < 1) 
								print "<td width=500>&nbsp;<img src=\"/dipl/css/balken_rot.gif\" width=2 height=10 >$wert Tage</td>";*/
							 }
					
							 else
								print "<TD>$data[$i]</TD>\n"; // Name und vorname ausgeben....
							 $col++;
						}
					print "</TR>\n";
				} 
	}
else 
	{
		if (isset($_GET['ID'])) 
			{
				$message = "Es sind noch keine Aufgaben gelöst worden....";
			}

		print "<tr><td class=text>" . $message . "<BR></tr></td>";
	}      

?> 

</td>
</tr>

</table>
</table>
</table>


<? 
include("../footer.php");
?>