本文整理汇总了PHP中Question::getQuestionID方法的典型用法代码示例。如果您正苦于以下问题:PHP Question::getQuestionID方法的具体用法?PHP Question::getQuestionID怎么用?PHP Question::getQuestionID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Question
的用法示例。
在下文中一共展示了Question::getQuestionID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getResponseForQuestion
/**
* @param Question $question
* @return null|QuestionResponse
*/
public function getResponseForQuestion(Question $question)
{
if (count($this->getResponses()) > 0) {
foreach ($this->getResponses() as $response) {
if ($question->getQuestionID() == $response->getQuestionID()) {
return $response;
}
}
}
return null;
}
示例2: Question
\t<th>Summary</th>
\t<th>Type</th>
\t<th>Quiz</th>
\t<th>Created</th>
\t<th>Reviewed</th>
\t<th></th>
</tr>
EOT;
/** Display questions - could use a table formatter function, but for now coded in this file **/
/* This is very inefficient and results in very slow load times - need to reduce the number of sql queries */
foreach ($questions_array as $this_question_entry) {
print "<tr>\n";
//print "<td>$this_question_entry</td>";
$this_question = new Question($qdb->getQuestion($this_question_entry));
// Allow either q number or summary to be clicked (as summary may be null - eg. picture quiz)
print "<td><a href=\"" . ADMIN_EDIT_FILE . "?question=" . $this_question->getQuestionID() . "\">{$this_question_entry}</a></td>";
// Note hard coded length of summary (this file to be discontinued)
print "<td><a href=\"" . ADMIN_EDIT_FILE . "?question=" . $this_question->getQuestionID() . "\">" . $this_question->getSummary(45) . "</a></td>";
print "<td>" . $this_question->getType() . "</td>";
print "<td>" . $this_question->getQuizzes() . "</td>";
print "<td>" . $this_question->getCreated() . "</td>";
print "<td>" . $this_question->getReviewed() . "</td>\n";
print "<td><a href=\"" . ADMIN_Q_FILE . "?question=" . $this_question->getQuestionID() . "\">Test</a></td>\n";
print "</tr>\n";
}
print "</table>\n";
if (isset($debug) && $debug) {
$end_time = time();
$total_time = $end_time - $start_time;
print "Start time: {$start_time} \n";
print "End time: {$end_time} \n";
示例3: header
}
// no questionid - error and back to index page
// 0 is used for new rather than edit
if ($questionid < 0) {
$err = Errors::getInstance();
$err->errorEvent(WARNING_QUESTION, "Unable to load question {$questionid}");
// redirect to admin index page
if (!$debug) {
header("Location: " . ADMIN_FILE . "?status=" . WARNING_QUESTION);
}
exit(0);
} elseif ($questionid > 0) {
// load questionid
$question = new Question($qdb->getQuestion($questionid));
// now check that we have loaded question correctly - check that the db read was valid
if ($questionid != $question->getQuestionID()) {
$err = Errors::getInstance();
$err->errorEvent(WARNING_PARAMETER, "Question parameter missing on edit page");
// redirect to admin index page
if (!$debug) {
header("Location: " . ADMIN_FILE . "?status=" . WARNING_PARAMETER);
}
exit(0);
}
}
/* At this point we have loaded the current question - (or it's a new) so display form */
require_once $include_dir . "adminmenu.php";
print "<h2>Edit Question</h2>\n";
print $message . "\n";
print "<p>Do NOT use apostrophes etc, instead use their html equivelant.<br />(e.g. &quot; = " &amp;=&)</p>\n";
print "<form action=\"" . ADMIN_EDIT_FILE . "\" method=\"post\">\n";