当前位置: 首页>>代码示例>>PHP>>正文


PHP Question::setTopic方法代码示例

本文整理汇总了PHP中Question::setTopic方法的典型用法代码示例。如果您正苦于以下问题:PHP Question::setTopic方法的具体用法?PHP Question::setTopic怎么用?PHP Question::setTopic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Question的用法示例。


在下文中一共展示了Question::setTopic方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testQuestionCreation

 public function testQuestionCreation()
 {
     $this->assertEquals($this->single_choice_question->getTitle(), 'Basic Math');
     $this->assertEquals($this->single_choice_question->getDescription(), 'What is the result of 1+1?');
     $this->assertEquals($this->single_choice_question->getAvailableAnswers(), $this->single_choice_question_answers);
     $this->assertFalse($this->single_choice_question->wasAnswered());
     $this->assertEquals($this->multiple_choice_question->getTitle(), 'Planets');
     $this->assertEquals($this->multiple_choice_question->getDescription(), 'What planets are between the Sun and the Earth?');
     $this->assertEquals($this->multiple_choice_question->getAvailableAnswers(), $this->multiple_choice_question_answers);
     $this->assertFalse($this->multiple_choice_question->wasAnswered());
     $question = new Question();
     $question->setInternalId(4);
     $this->assertEquals($question->getInternalId(), 4);
     $question->setTopic(array('planets' => 'Planets related questions'));
     $this->assertEquals($question->getTopic(), array('planets' => 'Planets related questions'));
 }
开发者ID:micaelamenara,项目名称:MultipleChoiceExams,代码行数:16,代码来源:QuestionsTest.php

示例2: stripslashes

     // Fragen nach Thema sortieren
     $topics->getTopic();
     $topicarray = $topics->getTopicArray();
     $number = $qu->getNumberOfQuestions($topicarray);
     $inactive = $qu->getNumberOfInactiveQuestions($topicarray);
     //muss noch erstellt werden
     $lp = $qu->getLearnpathCount($topicarray);
     $topics->showTopicTableStatistic($number, $lp, $inactive);
     break;
 case 'getStatisticQuestions':
     // Fragen in Tabelle anzeigen
     $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 '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'];
开发者ID:eruedin,项目名称:cats,代码行数:31,代码来源:statistic.php

示例3: reallyDelTopic

     reallyDelTopic($t_id);
     if ($_REQUEST['submit'] == Global_13) {
         $topics->setTopicID($t_id);
         $topics->delTopic();
         echo " <meta http-equiv='refresh' content='0; url=?site=topic' />";
     } else {
         if ($_REQUEST['submit'] == Global_14) {
             echo " <meta http-equiv='refresh' content='0; url=?site=topic' />";
         }
     }
     break;
 case 'getQuestions':
     // Fragen zum Thema anzeigen
     $topics->setTopic($t_id);
     echo "<br /><h2> " . Topic_03 . " " . stripslashes($topics->getTopicName()) . "<br /></h2>";
     $question->setTopic($t_id);
     $question->setAllQuestions();
     $question->showQuestionTable();
     break;
 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}' />";
         }
     }
开发者ID:eruedin,项目名称:cats,代码行数:31,代码来源:topic.php

示例4: htmlspecialchars

         $new = htmlspecialchars($_POST["new"]);
     }
     // Umwandlung von Sonderzeichen in HTML-Code
     $_SESSION['values']['question']['description'] = 0;
     if ($_POST["description"]) {
         $_SESSION['values']['question']['description'] = abs(intval($_POST["description"]));
     }
     $_SESSION['values']['question']['descriptionText'] = "";
     if ($_POST["descriptionText"]) {
         $_SESSION['values']['question']['descriptionText'] = htmlspecialchars($_POST["descriptionText"]);
     }
     // Session Variable setzen
     $_SESSION['values']['question']['new'] = 1;
 }
 $question->setType($_SESSION['values']['question']['qt']);
 $question->setTopic($_SESSION['values']['question']['t_id']);
 if ($_SESSION['values']['question']['descriptionText'] == '') {
     $_SESSION['values']['question']['description'] = 0;
 }
 if ($_SESSION['values']['question']['description'] == 0 && $_SESSION['values']['question']['descriptionText'] != '') {
     $_SESSION['values']['question']['descriptionText'] = '';
 }
 $check = $question->checkQuestion();
 if ($check == 1 && $_SESSION['values']['question']['t_id'] != '') {
     $topic->getTopic();
     $topicArray = $topic->getTopicArray();
     $question->setAllTopics($topicArray);
     $question->showQuestionInfos();
     $answer->setQuestionType($_SESSION['values']['question']['qt']);
     $answer->addAnswer();
     $answer->addAnswer();
开发者ID:eruedin,项目名称:cats,代码行数:31,代码来源:collect_question.php


注:本文中的Question::setTopic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。