예제 #1
0
파일: start_test.php 프로젝트: eruedin/cats
 case 'getQuestions':
     // Fragebogen genererien
     // Überbrüfung auf integer / Wertzuweisung
     $topic = 0;
     if (isset($_REQUEST["t_id"])) {
         $topic = abs(intval($_REQUEST["t_id"]));
     }
     // Session Variable leeren
     if (isset($_SESSION['values']['answerList'])) {
         unset($_SESSION['values']['answerList']);
     }
     $topics->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;