本文整理汇总了PHP中assQuestion::originalQuestionExists方法的典型用法代码示例。如果您正苦于以下问题:PHP assQuestion::originalQuestionExists方法的具体用法?PHP assQuestion::originalQuestionExists怎么用?PHP assQuestion::originalQuestionExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assQuestion
的用法示例。
在下文中一共展示了assQuestion::originalQuestionExists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copyAndLinkToQuestionpoolObject
public function copyAndLinkToQuestionpoolObject()
{
global $lng;
require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
// #13761; All methods use for this request should be revised, thx japo ;-)
if ('copyAndLinkToQuestionpool' == $this->ctrl->getCmd() && (!isset($_REQUEST['q_id']) || !is_array($_REQUEST['q_id']))) {
ilUtil::sendFailure($this->lng->txt('tst_no_question_selected_for_moving_to_qpl'), true);
$this->ctrl->redirect($this, 'questions');
}
if (isset($_REQUEST['q_id']) && is_array($_REQUEST['q_id'])) {
foreach ($_REQUEST['q_id'] as $q_id) {
if (!assQuestion::originalQuestionExists($q_id)) {
continue;
}
$type = ilObject::_lookupType(assQuestion::lookupParentObjId(assQuestion::_getOriginalId($q_id)));
if ($type !== 'tst') {
ilUtil::sendFailure($lng->txt('tst_link_only_unassigned'), true);
$this->ctrl->redirect($this, 'questions');
return;
}
}
}
$this->createQuestionpoolTargetObject('copyAndLinkQuestionsToPool');
}
示例2: copyAndLinkToQuestionpoolObject
public function copyAndLinkToQuestionpoolObject()
{
global $lng;
require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
foreach ($_REQUEST['q_id'] as $q_id) {
if (!assQuestion::originalQuestionExists($q_id)) {
continue;
}
$type = ilObject::_lookupType(assQuestion::lookupParentObjId(assQuestion::_getOriginalId($q_id)));
if ($type !== 'tst') {
ilUtil::sendFailure($lng->txt('tst_link_only_unassigned'), true);
$this->backObject();
return;
}
}
$this->createQuestionpoolTargetObject('copyAndLinkQuestionsToPool');
}