/** * creates and returns an instance of a test question set config * that corresponds to the passed question set type (test mode) * * @return ilTestQuestionSetConfig */ public function getQuestionSetConfigByType($questionSetType) { if ($this->testQuestionSetConfig === null) { switch ($questionSetType) { case ilObjTest::QUESTION_SET_TYPE_FIXED: require_once 'Modules/Test/classes/class.ilTestFixedQuestionSetConfig.php'; $this->testQuestionSetConfig = new ilTestFixedQuestionSetConfig($this->tree, $this->db, $this->pluginAdmin, $this->testOBJ); break; case ilObjTest::QUESTION_SET_TYPE_RANDOM: require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfig.php'; $this->testQuestionSetConfig = new ilTestRandomQuestionSetConfig($this->tree, $this->db, $this->pluginAdmin, $this->testOBJ); break; case ilObjTest::QUESTION_SET_TYPE_DYNAMIC: require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php'; $this->testQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($this->tree, $this->db, $this->pluginAdmin, $this->testOBJ); break; } $this->testQuestionSetConfig->loadFromDb(); } return $this->testQuestionSetConfig; }
/** * Returns true, if a test is complete for use and can be set online * * @param ilTestQuestionSetConfig $testQuestionSetConfig * @return boolean */ public final function isComplete(ilTestQuestionSetConfig $testQuestionSetConfig) { if (!count($this->mark_schema->mark_steps)) { return false; } if (!$testQuestionSetConfig->isQuestionSetConfigured()) { return false; } return true; }
/** * @param ilTree $tree * @param ilDB $db * @param ilPluginAdmin $pluginAdmin * @param ilObjTest $testOBJ */ public function __construct(ilTree $tree, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ) { parent::__construct($tree, $db, $pluginAdmin, $testOBJ); }