本文整理汇总了PHP中EfrontLesson::getQuestions方法的典型用法代码示例。如果您正苦于以下问题:PHP EfrontLesson::getQuestions方法的具体用法?PHP EfrontLesson::getQuestions怎么用?PHP EfrontLesson::getQuestions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EfrontLesson
的用法示例。
在下文中一共展示了EfrontLesson::getQuestions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$form->setDefaults(array('embed_type' => 'popup'));
}
$form->addRule('scorm_size', _INVALIDFIELDDATA, 'checkParameter', 'id');
$smarty->assign("T_SCORM", true);
}
//Set elements rules
$form->addRule('name', _THEFIELD . ' "' . _UNITNAME . '" ' . _ISMANDATORY, 'required', null, 'client');
//The name is mandatory
//$form -> addRule('ctg_type', _THEFIELD.' '._CONTENTTYPE.' '._ISMANDATORY, 'required', null, 'client'); //The content type is mandatry
if (!isset($_GET['edit'])) {
// changed in case parent unit is inactive
$form->addRule('parent_content_ID', _THEFIELD . ' ' . _UNITPARENT . ' ' . _ISMANDATORY, 'required', null, 'client');
$form->addRule('parent_content_ID', _INVALIDID, 'numeric');
}
//Add the content's questions, in order to setup "complete with question" field
if (sizeof($currentLesson->getQuestions()) > 0) {
$pathStrings = $currentContent->toPathStrings();
foreach ($currentLesson->getQuestions() as $key => $value) {
if ($value['type'] != 'raw_text' || $value['id'] == $currentUnit['options']['complete_question']) {
$plainText = trim(strip_tags($value['text']));
if (mb_strlen($plainText) > Question::maxQuestionText) {
$plainText = mb_substr($plainText, 0, Question::maxQuestionText) . '...';
}
$pathStrings[$value['content_ID']] ? $lessonQuestions[$value['id']] = $pathStrings[$value['content_ID']] . ' » ' . $plainText : ($lessonQuestions[$value['id']] = $plainText);
}
}
if (!empty($lessonQuestions) || $currentUnit['options']['complete_unit_setting'] == EfrontUnit::COMPLETION_OPTIONS_COMPLETEWITHQUESTION) {
$form->addElement('select', 'complete_question', _COMPLETEWITHQUESTION, $lessonQuestions, 'id = "complete_question"');
$completeUnitSelect[EfrontUnit::COMPLETION_OPTIONS_COMPLETEWITHQUESTION] = _COMPLETEWITHQUESTION;
}
}