本文整理匯總了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;
}
}