From 03c50e20a77e377e236f2ffd52c5aaf314639275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 2 Feb 2010 14:05:16 +0000 Subject: [PATCH] Testtool Auswertung auf Fragenebene --- cis/testtool/admin/auswertung.php | 74 +++---- cis/testtool/admin/auswertung_detail.php | 185 ++++++++++++++++++ .../admin/auswertung_detail_frage.php | 132 +++++++++++++ 3 files changed, 358 insertions(+), 33 deletions(-) create mode 100644 cis/testtool/admin/auswertung_detail.php create mode 100644 cis/testtool/admin/auswertung_detail_frage.php diff --git a/cis/testtool/admin/auswertung.php b/cis/testtool/admin/auswertung.php index 1f6e9f26a..5b54dbdbf 100644 --- a/cis/testtool/admin/auswertung.php +++ b/cis/testtool/admin/auswertung.php @@ -225,39 +225,47 @@ foreach($stg_obj->result as $row)

Auswertung Reihungstest

-
-Reihungstest wählen:  - -Studiengang: - - -
- + + + + + +
+
+ Reihungstest wählen:  + + Studiengang: + + +
+
+ Auswertung auf Fragenebene +
+ * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > + * Rudolf Hangl < rudolf.hangl@technikum-wien.at > + * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > + */ +/** + * Detailierte Auswertung der Reihungstests + */ +require_once('../../../config/cis.config.inc.php'); +require_once('../../../include/functions.inc.php'); +require_once('../../../include/studiengang.class.php'); +require_once('../../../include/gebiet.class.php'); +require_once('../../../include/benutzerberechtigung.class.php'); + +echo ' + + + Testtool Auswertung + + + + +

Testtool Auswertung - Detail

+'; + +$stg_kz = (isset($_GET['stg_kz'])?$_GET['stg_kz']:''); +$gebiet_id = (isset($_GET['gebiet_id'])?$_GET['gebiet_id']:''); +$db = new basis_db(); + +echo ' +
+ + + + + + + + + + +
Studiengang + + Gebiet + +
'; + +if(isset($_GET['show'])) +{ + $qry = "SELECT * FROM ( + SELECT + distinct on(tbl_frage.frage_id) *, tbl_gebiet.kurzbz as gebiet + FROM + testtool.tbl_frage + JOIN testtool.tbl_ablauf USING(gebiet_id) + JOIN testtool.tbl_frage_sprache USING(frage_id) + JOIN testtool.tbl_gebiet USING(gebiet_id) + WHERE + demo=false + AND tbl_frage_sprache.sprache='German'"; + if($stg_kz!='') + $qry.=" AND studiengang_kz='".addslashes($stg_kz)."'"; + if($gebiet_id!='') + $qry.=" AND gebiet_id='".addslashes($gebiet_id)."'"; + $qry.=") as a ORDER BY gebiet_id, nummer"; + + //echo $qry.'

'; + if($result = $db->db_query($qry)) + { + echo '
+ + + + + + + + '; + $i=0; + while($row = $db->db_fetch_object($result)) + { + $i++; + $hlp=''; + $hlp .=' + + + '; + + $qry = "SELECT + count(*) as anzahl + FROM + testtool.tbl_pruefling_frage + JOIN testtool.tbl_pruefling USING(pruefling_id) + WHERE + frage_id=$row->frage_id"; + if($stg_kz!='') + $qry.=" AND studiengang_kz='".addslashes($stg_kz)."'"; + + $qry_vorschlag = " + SELECT + vorschlag_id, nummer, punkte, count(*) as anzahl_vorschlag, ($qry) as anzahl_gesamt, + (SELECT text FROM testtool.tbl_vorschlag_sprache WHERE vorschlag_id=tbl_vorschlag.vorschlag_id AND sprache='German' LIMIT 1) as text + FROM + testtool.tbl_vorschlag + JOIN testtool.tbl_antwort USING(vorschlag_id) + JOIN testtool.tbl_pruefling USING(pruefling_id) + WHERE + frage_id='$row->frage_id' "; + if($stg_kz!='') + $qry_vorschlag.=" AND studiengang_kz='".addslashes($stg_kz)."'"; + + $qry_vorschlag.=" + GROUP BY + vorschlag_id, nummer, punkte + ORDER BY punkte DESC, vorschlag_id"; + //echo $qry_vorschlag.'
'; + $hlp2=''; + $gesamt =0; + if($result_vorschlag = $db->db_query($qry_vorschlag)) + { + while($row_vorschlag = $db->db_fetch_object($result_vorschlag)) + { + $hlp2.= ' + + + '; + + $gesamt = $row_vorschlag->anzahl_gesamt; + } + } + echo $hlp."".$hlp2; + echo ''; + } + echo '
GebietFrageGesamtVorschlag/Punkte/Anzahl
Details'.$row->gebiet.''.strip_tags($row->text).' ('.$row->nummer.') '.$row_vorschlag->text.''.number_format($row_vorschlag->punkte,2).' Pkt'.$row_vorschlag->anzahl_vorschlag.'$gesamt
'; + } +} +?> + + \ No newline at end of file diff --git a/cis/testtool/admin/auswertung_detail_frage.php b/cis/testtool/admin/auswertung_detail_frage.php new file mode 100644 index 000000000..adf084eef --- /dev/null +++ b/cis/testtool/admin/auswertung_detail_frage.php @@ -0,0 +1,132 @@ + + * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > + * Rudolf Hangl < rudolf.hangl@technikum-wien.at > + * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > + */ +/** + * Detailierte Auswertung der Reihungstests + */ +require_once('../../../config/cis.config.inc.php'); +require_once('../../../include/functions.inc.php'); +require_once('../../../include/studiengang.class.php'); +require_once('../../../include/gebiet.class.php'); +require_once('../../../include/benutzerberechtigung.class.php'); + +echo ' + + + Testtool Auswertung + + + + +

Testtool Auswertung - Frage Detail

+'; + +$frage_id = (isset($_GET['frage_id'])?$_GET['frage_id']:''); +$sprache = (isset($_GET['sprache'])?$_GET['sprache']:'German'); +$db = new basis_db(); + +if($frage_id!='' && is_numeric($frage_id)) +{ + $qry = "SELECT + *, + tbl_frage_sprache.text as frage_text, + tbl_frage_sprache.audio as frage_audio, + tbl_frage_sprache.bild as frage_bild, + tbl_vorschlag_sprache.text as vorschlag_text, + tbl_vorschlag_sprache.audio as vorschlag_audio, + tbl_vorschlag_sprache.bild as vorschlag_bild, + (SELECT count(*) FROM testtool.tbl_antwort WHERE vorschlag_id=tbl_vorschlag.vorschlag_id) as anzahl, + (SELECT count(*) FROM testtool.tbl_pruefling_frage WHERE frage_id='$frage_id') as gesamt_anzahl + FROM + testtool.tbl_frage + JOIN testtool.tbl_frage_sprache USING(frage_id) + JOIN testtool.tbl_vorschlag USING(frage_id) + JOIN testtool.tbl_vorschlag_sprache USING(vorschlag_id) + WHERE + tbl_frage_sprache.sprache='".addslashes($sprache)."' AND + tbl_vorschlag_sprache.sprache='".addslashes($sprache)."' AND + frage_id='$frage_id' + ORDER BY punkte DESC, vorschlag_id"; + + if($result = $db->db_query($qry)) + { + $first=true; + $i=0; + while($row = $db->db_fetch_object($result)) + { + $i++; + if($first) + { + //Fragen Details + echo " + Anzahl der Personen die diese Frage bekommen haben (alle Stg): $row->gesamt_anzahl
+

+ "; + echo '
'; + $first=false; + echo $row->frage_text.'
'; + if($row->frage_audio!='') + { + echo ' + + + + + + + + '; + } + if($row->frage_bild!='') + echo "

\n"; + + echo '


'; + } + + //Vorschlaege + echo '
'; + //echo "Vorschlag $i: "; + $first=false; + echo $row->vorschlag_text; + if($row->vorschlag_audio!='') + { + echo ' + + + + + + + + '; + } + if($row->vorschlag_bild!='') + echo "

\n"; + echo "


Punkte: ".number_format($row->punkte,2); + echo "
Anzahl beantwortet (alle Stg): $row->anzahl"; + echo '


'; + } + } +} +?> + + \ No newline at end of file