本文整理汇总了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'));
}
示例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'];
示例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}' />";
}
}
示例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();