本文整理汇总了PHP中ilObjTest::_lookupRandomTest方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::_lookupRandomTest方法的具体用法?PHP ilObjTest::_lookupRandomTest怎么用?PHP ilObjTest::_lookupRandomTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjTest
的用法示例。
在下文中一共展示了ilObjTest::_lookupRandomTest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
/**
* parse
*
* @access public
* @param array array of assignable nodes (tree node data)
* @return
*/
public function parse($a_assignable)
{
global $objDefinition;
// begin-patch lok
$a_assignable = $this->getTestNode();
// end-patch lok
$tests = array();
foreach ($a_assignable as $node) {
$tmp_data = array();
$subobjects = array();
if (!($tmp_tst = ilObjectFactory::getInstanceByRefId((int) $node['ref_id'], false))) {
continue;
}
include_once './Modules/Test/classes/class.ilObjTest.php';
$tmp_data['random'] = ilObjTest::_lookupRandomTest($node['obj_id']);
$tmp_data['random'] = false;
foreach ($qst = $this->sortQuestions($tmp_tst->getAllQuestions()) as $question_data) {
$tmp_question = ilObjTest::_instanciateQuestion($question_data['question_id']);
#$sub['qst_txt'] = $tmp_question->_getQuestionText($question_data['question_id']);
$sub['qst_txt'] = '';
$sub['qst_points'] = $tmp_question->_getMaximumPoints($question_data['question_id']);
$sub['title'] = $tmp_question->getTitle();
$sub['description'] = $tmp_question->getComment();
$sub['id'] = $question_data['question_id'];
$subobjects[] = $sub;
}
$tmp_data['title'] = $node['title'];
$tmp_data['description'] = $node['description'];
$tmp_data['type'] = $node['type'];
$tmp_data['id'] = $node['child'];
$tmp_data['obj_id'] = $node['obj_id'];
$tmp_data['sub'] = $subobjects;
$tests[] = $tmp_data;
}
$this->setData($tests);
}
示例2: lookupRandomTest
/**
* Check if test is a random test
* @param type $a_test_obj_id
* @return bool
*/
public static function lookupRandomTest($a_test_obj_id)
{
include_once './Modules/Test/classes/class.ilObjTest.php';
return ilObjTest::_lookupRandomTest($a_test_obj_id);
}
示例3: isRandomTestType
/**
* Check if test is of type random test
* @param type $a_type
* @return type
* @todo refactor
*/
public function isRandomTestType($a_type)
{
$tst = $this->getTestByType($a_type);
include_once './Modules/Test/classes/class.ilObjTest.php';
return ilObjTest::_lookupRandomTest(ilObject::_lookupObjId($tst));
}
示例4: isRandomTestType
protected function isRandomTestType($a_tst_type = 0)
{
if (!$a_tst_type) {
$a_tst_type = $this->test_type;
}
$tst_ref_id = $this->getSettings()->getTestByType($a_tst_type);
if (!$tst_ref_id) {
return false;
}
include_once './Modules/Test/classes/class.ilObjTest.php';
return ilObjTest::_lookupRandomTest(ilObject::_lookupObjId($tst_ref_id));
}