setTopicID($topic); $numOfQu=$topics->getNumOfQu(); $percentage=$topics->getRawToPass(); $myQuiz->setTopicID($topic); $myQuiz->setQuestionLimit($numOfQu); $myQuiz->setRawToPass($percentage); $value=$myQuiz->generateQuestions(); if($value!='notEnoughQuestions'){ $myQuiz->getDBAnswers(); $myQuiz->showQuiz(); $t_id=$myQuiz->getTopicID(); } break; case 'evaluate': // Fragebogen auswerten //Wertzuweisung und Initalisierung $selectedAnswers=0; if(isset($_REQUEST['selectedAnswers'])) { $selectedAnswers = $_REQUEST['selectedAnswers']; $_SESSION ['values']['selectedAnswers']=$selectedAnswers; } if (isset($_SESSION['values']['selectedAnswers'])) { $topic=0; if(isset($_REQUEST["t_id"])) $topic=abs(intval($_REQUEST["t_id"])); $myQuiz->setQuestions(); $myQuiz->setSelectedAnswers(); $myQuiz->setAnswers(); $myQuiz->updateStatistic(); $topics->setTopicID($topic); $numOfQu=$topics->getNumOfQu(); $percentage=$topics->getRawToPass(); $myQuiz->setTopicID($topic); $myQuiz->setQuestionLimit($numOfQu); $myQuiz->setRawToPass($percentage); $myQuiz->evaluateQuiz(); } else { // kein Test bearbeitet } break; case "requestCert": $topic=0; if(isset($_REQUEST["t_id"])) $topic=abs(intval($_REQUEST["t_id"])); $progress = new progress(); $progress->setTopic($topic); $progress->getProgress(); $topics->setTopicID($topic); $percentage=$topics->getRawToPass(); $haspassed = false; foreach ($progress->progress as $entry) { if ($entry['number'] > 0) { $currentperc = 100 * $entry['correct'] / (1.0 * $entry['number']); if ($currentperc >= $percentage) { $haspassed = true; } } } if ($haspassed) { // A paper/PDF certificate for passing the test has been requested. echo "
".Class_Quiz_12_ExplainCert; echo "
\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "
\n". "
\n". "\n". "\n". "\n". "
\n". "
\n". "
\n". "\n". "\n". "\n". "\"\"\n". "
\n". "
".Class_Quiz_13_Donate5."".Class_Quiz_14_Donate10."
\n"; } else { // Test wurde nie bestanden echo "
" . Class_Quiz_09; } break; } } else echo "
".Global_01."
"; ?>