diff --git a/lib/questionlib.php b/lib/questionlib.php index 32d00f95fbd..b281dbc5191 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -114,19 +114,6 @@ function question_save_qtype_order($neworder, $config = null) { /// FUNCTIONS ////////////////////////////////////////////////////// -/** - * Returns an array of names of activity modules that use this question - * - * @deprecated since Moodle 2.1. Use {@link questions_in_use} instead. - * - * @param object $questionid - * @return array of strings - */ -function question_list_instances($questionid) { - throw new coding_exception('question_list_instances has been deprectated. ' . - 'Please use questions_in_use instead.'); -} - /** * @param array $questionids of question ids. * @return boolean whether any of these questions are being used by any part of Moodle. @@ -191,23 +178,6 @@ function question_context_has_any_questions($context) { WHERE qc.contextid = ? AND q.parent = 0", array($contextid)); } -/** - * Returns list of 'allowed' grades for grade selection - * formatted suitably for dropdown box function - * - * @deprecated since 2.1. Use {@link question_bank::fraction_options()} or - * {@link question_bank::fraction_options_full()} instead. - * - * @return object ->gradeoptionsfull full array ->gradeoptions +ve only - */ -function get_grade_options() { - $grades = new stdClass(); - $grades->gradeoptions = question_bank::fraction_options(); - $grades->gradeoptionsfull = question_bank::fraction_options_full(); - - return $grades; -} - /** * Check whether a given grade is one of a list of allowed options. If not, * depending on $matchgrades, either return the nearest match, or return false @@ -250,17 +220,6 @@ function match_grade_options($gradeoptionsfull, $grade, $matchgrades = 'error') } } -/** - * @deprecated Since Moodle 2.1. Use {@link question_category_in_use} instead. - * @param integer $categoryid a question category id. - * @param boolean $recursive whether to check child categories too. - * @return boolean whether any question in this category is in use. - */ -function question_category_isused($categoryid, $recursive = false) { - throw new coding_exception('question_category_isused has been deprectated. ' . - 'Please use question_category_in_use instead.'); -} - /** * Tests whether any question in a category is used by any part of Moodle. * @@ -892,19 +851,6 @@ function question_hash($question) { return make_unique_id_code(); } -/// FUNCTIONS THAT SIMPLY WRAP QUESTIONTYPE METHODS ////////////////////////////////// -/** - * Saves question options - * - * Simply calls the question type specific save_question_options() method. - * @deprecated all code should now call the question type method directly. - */ -function save_question_options($question) { - debugging('Please do not call save_question_options any more. Call the question type method directly.', - DEBUG_DEVELOPER); - question_bank::get_qtype($question->qtype)->save_question_options($question); -} - /// CATEGORY FUNCTIONS ///////////////////////////////////////////////////////////////// /** @@ -1429,17 +1375,6 @@ function question_require_capability_on($question, $cap) { return true; } -/** - * Get the real state - the correct question id and answer - for a random - * question. - * @param object $state with property answer. - * @deprecated this function has not been relevant since Moodle 2.1! - */ -function question_get_real_state($state) { - throw new coding_exception('question_get_real_state has not been relevant since Moodle 2.1. ' . - 'I am not sure what you are trying to do, but stop it at once!'); -} - /** * @param object $context a context * @return string A URL for editing questions in this context. diff --git a/question/upgrade.txt b/question/upgrade.txt index f235639251b..6ee6425a8ab 100644 --- a/question/upgrade.txt +++ b/question/upgrade.txt @@ -1,5 +1,18 @@ This files describes API changes for code that uses the question API. +=== 2.9 === + +1) Some functions in questionlib.php where were deprecated in the past have now + beed deleted: + + Deprecated since 2.1 + * question_list_instances + * get_grade_options + * question_category_isused + * save_question_options + * question_get_real_state + + === 2.8 === 1) This is jsut a warning that some methods of the question_engine_data_mapper