protected function hydrate(array $record) : QuestionInterface
 {
     $question = new Question();
     $question->setID($record['id']);
     $question->setName($record['name']);
     $question->setQuestion($record['question']);
     $question->setTime(new DateTimeImmutable('@' . $record['time']));
     return $question;
 }
Example #2
0
function getData($limit, $quest)
{
    for ($i = 0; $i < $limit; $i++) {
        $j = $i + 1;
        $qu = new Question();
        $topics = new Topic();
        $qu->setID($quest[$i]['q_id']);
        $qu->loadQuestion();
        $qu_text = $qu->getQuestion();
        echo "<tr>";
        echo "<td class='td'>{$j}</td>";
        echo "<td class='td'>" . $quest[$i]['q_id'] . "</td>";
        echo "<td class='td'>" . stripslashes($qu_text) . "</td>";
        // array Werte ausgeben
        echo "<td class='td'> " . $quest[$i]['count'] . "</td>";
        echo "<td class='td' > " . $quest[$i]['percentagCorrect'] . "%</td>";
        echo "</tr>";
    }
}
Example #3
0
 case 'delQuestion':
     // Löschen einer Frage
     reallyDelQuestion($q_id, $t_id);
     if ($_REQUEST['submit'] == Global_13) {
         $answer->delAnswers($q_id);
         $question->delQuestion($q_id);
         echo " <meta http-equiv='refresh' content='0; url=?{$site}' />";
     } else {
         if ($_REQUEST['submit'] == Global_14) {
             echo " <meta http-equiv='refresh' content='0; url=?{$site}' />";
         }
     }
     break;
 case 'setQuestionInactive':
     // Deaktivieren einer Frage
     $question->setID($q_id);
     $question->setInactive();
     echo " <meta http-equiv='refresh' content='0; url=?{$site}' />";
     break;
 case 'setQuestionActive':
     //Aktivieren einer Frage
     $question->setID($q_id);
     $question->setActive();
     echo " <meta http-equiv='refresh' content='0; url=?{$site}'>";
     break;
 case 'showDetails':
     // Anzeigen der Fragedetails
     if ($q_id != 0) {
         $_SESSION['values']['question']['q_id'] = $q_id;
     }
     if ($error == 'conflict') {
Example #4
0
     $Topic = $topics->getTopicName();
     echo "<br /><h2>" . Statistic_03 . " " . stripslashes($Topic) . "<br /></h2>";
     $qu->setTopic($t_id);
     $ok = $qu->setStatisticQuestions();
     if ($ok == 1) {
         $qu->showStatisticQuestionTable();
     }
     break;
 case 'changeActive':
     // Frage deaktivieren / aktivieren
     // Überbrüfung / Wertzuweisung
     $q_id = 0;
     if ($_GET['q_id']) {
         $q_id = abs(intval($_GET['q_id']));
     }
     $qu->setID($q_id);
     $qu->changeActive();
     $t_id = $_GET['t_id'];
     $topics->setTopicID($t_id);
     $topics->setTopic($t_id);
     $Topic = $topics->getTopicName();
     echo "<br /><h2> " . Statistic_03 . " " . stripslashes($Topic) . "<br /></h2>";
     $qu->setTopic($t_id);
     $ok = $qu->setStatisticQuestions();
     if ($ok == 1) {
         $qu->showStatisticQuestionTable();
     }
     break;
 case 'delQuestion':
     // Frage löschen
     // Überbrüfung / Wertzuweisung