[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 This files describes API changes for code that uses the question API. 2 3 === 2.8 === 4 5 1) This is jsut a warning that some methods of the question_engine_data_mapper 6 class have changed. All these methods are ones that you should not have been 7 calling directly from your code, so this should not cause any problems. 8 The changed methods are: 9 * insert_question_attempt 10 * insert_step_data 11 * update_question_attempt_step 12 13 14 === 2.7 === 15 16 1) Changes to class question_bank_view: 17 18 Filters, including $recurse and $showhidden, are now implemented as 19 pluggable \core_question\bank\search\condition classes. 20 21 Therefore $recurse and $showhidden are no longer passed to the following functions: 22 protected function display_options [deprecated, use display_options_form()] 23 protected function build_query_sql [deprecated, use build_query()] 24 25 protected function display_category_form() is deprecated. Use \core_question\bank\search\category_condition 26 27 protected function display_category_form_checkbox deprecated use html_writer::checkbox and separate JavaScript 28 29 To add filters, local plugins can now implement the function local_[pluginname]_get_question_bank_search_conditions, 30 31 2) To make columns available to question_bank_view, plugins can extend core_question\bank\column_base. 32 Users may choose to display additional columns by setting $CFG->questionbankcolumns to a comma-delimited list of columns. 33 34 3) The subsort separator has changed from _ to - in order to distinuguish subsorts vs frankenstyle component separators. 35 36 4) Because of the move to autoloading, $knowncolumntypes and known_field_types() are no longer used. 37 38 5) question_bank_column_base and it's derived classes have been namespaced to core_question\bank\column_base. 39 40 41 === 2.6 === 42 43 1) Modules using the question bank MUST now declare their use of it with the xxx_supports() 44 flag FEATURE_USES_QUESTIONS. question_module_uses_questions() should be used to determine 45 if a module uses questions. 46 47 2) It is sometimes necessary to display bits of question content without having 48 and attempt (question_usage) in progress. Two examples of this are the option 49 in the question bank to display the questiontext, and in the quiz statistics 50 report, where it displays the question text above the report. 51 52 Previously, this display was done using a special method that only worked for 53 the question text, but which would not work for other parts of the question. 54 That old mechanism has been deprecated, and there is a new method that you 55 should use. 56 57 To display the question, replace calls to question_rewrite_questiontext_preview_urls 58 with calls to question_rewrite_question_preview_urls. Because the new function 59 is more flexibile, you have to pass more arguments. 60 61 To perform the necessary permission checks when the file is downloaded, you need 62 to implement the callback [component name]_question_preview_pluginfile. 63 (Previously you implemented [component name]_questiontext_preview_pluginfile.) 64 quiz_statistics_question_preview_pluginfile is an example of what to do. 65 66 question_send_questiontext_file has been deprecated. It is no longer necessary. 67 68 To ensure you are no longer using or defining any deprecated functions, 69 search for the regular expression: 70 question_rewrite_questiontext_preview_urls|_questiontext_preview_pluginfile|question_send_questiontext_file 71 72 3) The argument list for core_question_renderer::mark_summary has changed. 73 Please update your calls. (The most likely scenario for this is if you have 74 overridden core_question_renderer::info in your own renderer.) You need to 75 make a change like: 76 - $this->mark_summary($qa, $options); 77 + $this->mark_summary($qa, $behaviouroutput, $options);
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |