本文整理汇总了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';
}