nicolasconnault [Fri, 18 May 2007 05:34:30 +0000 (05:34 +0000)]
MDL-9506 Fixed up the grade_tree and its unit tests. The main change to notice is in grade_category, where the array returned by get_children() is indexed by sortorder. The associated unit tests have been updated to reflect this important change.
skodak [Thu, 17 May 2007 15:44:07 +0000 (15:44 +0000)]
MDL-9843 get_cached_events does not handle components properly;
whitespace cleanup;
minor coding style changes - such as always returning arrays from get cached and file events;
marked some functions as eventslib internal only
nicolasconnault [Thu, 17 May 2007 09:04:52 +0000 (09:04 +0000)]
MDL-9506 Elements of the array returned by grade_category::get_children are now indexed by sortorder, to work more easily with grade_tree methods.
New get_sortorder method for grade_category and grade_item. This is used when the type of an object is unknown, and could be either one. Because categories have a "virtual" sortorder (through their grade_item), they can transparently return one as well.
Unit tests fail for grade_tree at present because of faulty implementation which is being fixed. The $depth attribute has been completely removed, as well as a number of switch statements, in favour of an $index variable which is exploded and used to build strings of array keys for eval statements (unset and array_splice). Can't wait to get all this working :-)
nicolasconnault [Thu, 17 May 2007 04:13:42 +0000 (04:13 +0000)]
MDL-9506 Successfully implemented the grade_tree methods for moving an element somewhere else in the tree. Tests pass successfully. However the test data doesn't yet include more than 1 top-category, so I can't test moving it. Direct insertion and deletion have not yet been tested, although insertion is used by the move_element method.
nicolasconnault [Wed, 16 May 2007 03:17:46 +0000 (03:17 +0000)]
MDL-9506 Reorganised unit tests a bit, added some stubs and tests for grade_category, and corrected missing grade_finals for orphan grade_items and categories.
nicolasconnault [Wed, 16 May 2007 02:47:56 +0000 (02:47 +0000)]
MDL-9506 grade_category::display_grades() and grade_category::get_tree() correctly built the headers for a HTML table of grades, with two layers of categories and one layer of grade_items. Empty filler cells are used when a 1st or 2nd level category doesn't exist for a grade_item.
skodak [Tue, 15 May 2007 16:45:53 +0000 (16:45 +0000)]
MDL-5958 reverting the permission change in db/lib/access.php - course creator permissions must be defined only above the course level!
they must not be enabled at module level
sam_marshall [Mon, 14 May 2007 12:11:47 +0000 (12:11 +0000)]
MDL-9382: Added fields and orderby parameters to get_user_capability_course, which allows for greatly improved performance in the case where you want more information about the courses. (However, the function does still basically suck.)
nicolasconnault [Mon, 14 May 2007 08:18:03 +0000 (08:18 +0000)]
MDL-9506 Added some unit tests, found some errors, and realised they came from incorrect setup unit test data, which I corrected (grade finals for item 3 were set to 2-digit ints although item 3 was a scale of 1-7.
nicolasconnault [Mon, 14 May 2007 04:14:22 +0000 (04:14 +0000)]
MDL-9506 Finally cracked the category aggregation. However, more thorough unit tests need to be written, with exact expectations instead of ranges, as currently used. All unit tests pass.
ikawhero [Fri, 11 May 2007 12:16:44 +0000 (12:16 +0000)]
Addng two new options to the custom profile fields:
1. Force unique - force the field data to be unique
2. Signup - display the field on the signup page
MDL-9702
nicolasconnault [Fri, 11 May 2007 08:46:34 +0000 (08:46 +0000)]
MDL-9506 Almost completed category aggregation, including generation of raw and final grades held by these categories. Only a few small glitches remain, that cause these grades not to be generated properly. This is the last critical element of the gradebook API, so I'm looking forward to finishing it :-)
nicolasconnault [Fri, 11 May 2007 03:29:00 +0000 (03:29 +0000)]
MDL-9506 Finished implementing the propagation of needsupdate flag up the hierarchy when a lower element justifies it. All unit tests pass. The next task is to implement the generation of raw grades and final grades based on this needsupdate setting.
nicolasconnault [Fri, 11 May 2007 02:43:46 +0000 (02:43 +0000)]
MDL-9506 Fixed a bug with the fetch method. This method should not be called statically when setting an internal object. For example, when the grade_category is calling its load_parent_category, it should not call grade_category::fetch, but new grade_category. Otherwise, the method assigns the new variables to the calling object.
nicolasconnault [Thu, 10 May 2007 08:08:43 +0000 (08:08 +0000)]
MDL-9506
grade_grades_raw
added grade_item object
added load_grade_item()
added call to grade_item->flag_for_update() when object is inserted, deleted or updated
grade_grades_final
added grade_item object
added load_grade_item()
grade_grades_text
added grade_item object
added load_grade_item()
grade_item
added qualifies_for_update()
added call to grade_category->flag_for_update() when object is inserted, deleted or updated (only when qualifies_for_update() is true)
However since I have made this last set of changes, the unit tests are performing extremely slow, and several of them fail. I suspect that there is a serious performance issue involved in using objects too heavily, instead of performing more SQL queries, especially when updates are concerned. Often a complete object is SELECTed before it is amended in an object form then UPDATEd.
In the next iteration I will look at this seriously, and put together some tests with thousands of users and many grade_items, to see how well the API responds.
nicolasconnault [Thu, 10 May 2007 02:34:01 +0000 (02:34 +0000)]
MDL-9506
grade_category:
new parent_category object
new load_parent_category() method
new flag_for_update() recursive method
grade_item:
new category object
changed get_category() to load_category() and updated testgradeitem
added missing idnumber field
new flag_for_update() recursive method
urs_hunkler [Wed, 9 May 2007 18:29:36 +0000 (18:29 +0000)]
added/changed custom corners lib and calls to add the necessary divs
The SCORM course makes big problems because the scorm content is absolutely positioned. All surrounding divs collapse.