[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/question/ -> upgrade.php (summary)

This file contains dtabase upgrade code that is called from lib/db/upgrade.php, and also check methods that can be used for pre-install checks via admin/environment.php and lib/environmentlib.php.

Author: T.J.Hunt@open.ac.uk
Copyright: © 2007 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU Public License
File Size: 363 lines (15 kb)
Included or required:0 times
Referenced: 6 times
Includes or requires: 0 files

Defines 11 functions

  question_check_no_rqp_questions()
  question_remove_rqp_qtype()
  question_remove_rqp_qtype_config_string()
  question_random_check()
  question_delete_unused_random()
  question_cwqpfs_to_update()
  question_cwqpfs_check_children()
  question_category_next_parent_in()
  question_category_checking()
  question_upgrade_context_etc()
  question_fix_random_question_parents()

Functions
Functions that are not part of a class:

question_check_no_rqp_questions($result)   X-Ref
This test is becuase the RQP question type was included in core
up to and including Moodle 1.8, and was removed before Moodle 1.9.

Therefore, we want to check whether any rqp questions exist in the database
before doing the upgrade. However, the check is not relevant if that
question type was never installed, or if the person has chosen to
manually reinstall the rqp question type from contrib.

param: $result the result object that can be modified.
return: null if the test is irrelevant, or true or false depending on whether the test passes.

question_remove_rqp_qtype()   X-Ref
No description

question_remove_rqp_qtype_config_string()   X-Ref
No description

question_random_check($result)   X-Ref

param: $result the result object that can be modified.
return: null if the test is irrelevant, or true or false depending on whether the test passes.

question_delete_unused_random()   X-Ref
No description

question_cwqpfs_to_update($categories = null)   X-Ref
No description

question_cwqpfs_check_children($checkid, $categories, $categorychildparents, $cwqpfs)   X-Ref
No description

question_category_next_parent_in($contextid, $question_categories, $id, $already_seen = array()   X-Ref
No description

question_category_checking($question_categories)   X-Ref
Check that either category parent is 0 or a category shared in the same context.
Fix any categories to point to grand or grand grand parent etc in the same context or 0.


question_upgrade_context_etc()   X-Ref
No description

question_fix_random_question_parents()   X-Ref
In Moodle, all random questions should have question.parent set to be the same
as question.id. One effect of MDL-5482 is that this will not be true for questions that
were backed up then restored. The probably does not cause many problems, except occasionally,
if the bogus question.parent happens to point to a multianswer question type, or when you
try to do a subsequent backup. Anyway, these question.parent values should be fixed, and
that is what this update does.




Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7