本文整理匯總了PHP中quiz::addQuestion方法的典型用法代碼示例。如果您正苦於以下問題:PHP quiz::addQuestion方法的具體用法?PHP quiz::addQuestion怎麽用?PHP quiz::addQuestion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類quiz
的用法示例。
在下文中一共展示了quiz::addQuestion方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: classes
require_once 'src/core/controller/classes.php';
$ObjClass = new classes();
require_once 'src/core/controller/quiz.php';
$ObjQuiz = new quiz();
// set class id for form and links
if ($_POST['classid'] != "") {
$classid = $_POST['classid'];
} else {
$classid = $d;
}
if ($_POST['quiz_id'] != "") {
$quiz_id = $_POST['quiz_id'];
} else {
$quiz_id = $e;
}
if ($_POST['y'] == 'quiz' && $_POST['z'] == 'addQuestion' && $_POST['action'] == "save") {
$createContent = $ObjQuiz->addQuestion($_POST['quiz_id'], $_POST['question'], $_POST['answers'], $_POST['position']);
if ($createContent !== false) {
$responseMsg = "Your question has been added successfully";
} else {
$responseMsg = "Could not create your question at this time - something went wrong, sorry";
}
}
// create the view for coursek information
require_once 'web/core/quiz/addQuestion.php';
} else {
require_once 'web/core/security/insufficientrights.php';
}
} else {
require_once 'web/core/login/index.php';
}