From 384f4eda80cabf4f38264444c9866d4763fe5b24 Mon Sep 17 00:00:00 2001 From: Lucas Woltmann Date: Mon, 13 Oct 2014 15:34:17 +0200 Subject: [PATCH] =?UTF-8?q?Analyseseite=20f=C3=BCr=20die=20Tutoren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 + analysis.php | 4 +- analysisTut.php | 177 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 182 insertions(+), 2 deletions(-) create mode 100755 .gitignore create mode 100644 analysisTut.php diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..a0f60fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +keys/Keys.csv +*Log.txt +*.png diff --git a/analysis.php b/analysis.php index 7bcbb05..25d3f4b 100755 --- a/analysis.php +++ b/analysis.php @@ -1,7 +1,7 @@ - \ No newline at end of file + diff --git a/analysisTut.php b/analysisTut.php new file mode 100644 index 0000000..6691cd4 --- /dev/null +++ b/analysisTut.php @@ -0,0 +1,177 @@ + + + + + + ESE-Tutor Evaluation Analyse + + + + +
+ 0) + { + CreateSectionHeader("Question Evaluation"); + CreateLegend(); + foreach ($questionData as $question) + { + CreateRowHeader(); + echo "
\n"; + // The question itself + echo "

" . $question[0]; + //average + echo "⌀" . + round( + ($question[1]+2*$question[2]+3*$question[3]+4*$question[4]+5*$question[5]) + /(array_sum(array_slice($question,1,5))), + 2) + . "\n"; + echo "

\n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + + $width = 800; + $height = 300; + + //find max of answers to set max of x-axis, max of y-axis is always seven, because there are six possibilities to answer + $values = $question; + array_shift($values); + $maxX = max($values)+1; + $maxY = 7; + + $img = CreateImage($width, $height); + + // the amount of answers for the different options and a nice group of bars + for ($i = 1; $i < 7; $i++) + { + echo "

" . $question[$i] . "

\n"; + $green = 150*($question[$i]/$maxX) + 40; + $color = ImageColorAllocate($img, 0.57 * $green, $green, 0.45 * $green); + DrawBar($img, $question[$i], $maxX, $i+1, $maxY, $question[$i], $color); + } + + //finish image and save it + $caption = array("N/A","--","-", "0", "+", "++"); + DrawCoords($img, $maxX, $maxY, $caption); + + $file=str_replace("?", "", str_replace(" ", "", $question[0])); + + ImagePNG($img,"question".$file.".png"); + ImageDestroy($img); + + echo "
\n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + echo " "; + echo "
\n"; + echo "
\n"; + } + } + // if there was any tutor Data in the log file, display it + if (count($tutorData) > 0) + { + CreateSectionHeader("Tutor Evaluation"); + CreateLegend(); + foreach ($tutorData as $tutorName => $tutor) + { + CreateRowHeader(); + echo "
\n"; + // the name of the tutor + echo "

" . $tutorName . "\n"; + + //average + echo "⌀" . + round( + ($tutor[0]+2*$tutor[1]+3*$tutor[2]+4*$tutor[3]+5*$tutor[4]) + /(array_sum($tutor)-$tutor[5]), 2) + . "\n"; + echo "

\n"; + + echo "
\n"; + echo "
\n"; + echo "
\n"; + + $width = 800; + $height = 300; + + //find max of answers to set max of x-axis, max of y-axis is always seven, because there are six possibilities to answer + $maxX = max($tutor)+1; + $maxY = 7; + + $img = CreateImage($width, $height); + + // the amount of answers for the different options and a picture + for ($i = 0; $i < 6; $i++) + { + echo "

" . $tutor[$i] . "

\n"; + $green = 150*($tutor[$i]/$maxX) + 40; + $color = ImageColorAllocate($img, 0.54 * $green, $green, 0.45 * $green); + DrawBar($img, $tutor[$i], $maxX, $i+2, $maxY, $tutor[$i], $color); + } + + //finish image and save it + $caption = array("N/A","--","-", "0", "+", "++"); + DrawCoords($img, $maxX, $maxY, $caption); + + $file = str_replace(" ", "", $tutorName); + ImagePNG($img,"tutor".$file.".png"); + ImageDestroy($img); + + echo "
\n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + echo " "; + echo "
\n"; + echo "\n"; + + } + } + // if there was any comment Data in the log file, display it + if (count($commentData) > 0) + { + CreateSectionHeader("Comments"); + foreach ($commentData as $comment) + // replace all new lines with html breaks to properly display multi-line comments + CreateParagraph(str_replace("\n", "
\n", $comment)); + } + ?> + + +