本文整理汇总了PHP中Question::setID方法的典型用法代码示例。如果您正苦于以下问题:PHP Question::setID方法的具体用法?PHP Question::setID怎么用?PHP Question::setID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Question
的用法示例。
在下文中一共展示了Question::setID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hydrate
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;
}
示例2: getData
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>";
}
}
示例3: reallyDelQuestion
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') {
示例4: stripslashes
$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