/** * Returns true, if a test is complete for use * * @return boolean True, if the test is complete for use, otherwise false * @access public */ function _isComplete($a_obj_id) { global $ilDB; $test_id = ilObjTestAccess::_getTestIDFromObjectID($a_obj_id); $result = $ilDB->queryF("SELECT tst_mark.*, tst_tests.* FROM tst_tests, tst_mark WHERE tst_mark.test_fi = tst_tests.test_id AND tst_tests.test_id = %s", array('integer'), array($test_id)); $found = $result->numRows(); if ($found) { $row = $ilDB->fetchAssoc($result); // check for at least: title, author and minimum of 1 mark step if (strlen($row["title"]) && strlen($row["author"]) && $found) { // check also for minmum of 1 question if (ilObjTestAccess::_getQuestionCount($test_id) > 0) { return true; } else { return false; } } else { return false; } } else { return false; } $test = new ilObjTest($obj_id, false); $test->loadFromDb(); if ($test->getTitle() and $test->author and count($test->mark_schema->mark_steps) and count($test->questions)) { return true; } else { return false; } }