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.
nicolasconnault [Wed, 9 May 2007 07:50:28 +0000 (07:50 +0000)]
MDL-9506 Unit test tables are now created and emptied using XMLDB. raw.gradescale and final.gradescale have been removed in favour of a single gradevalue. Scale value is no longer rounded until moment of display. A number of other changes which you can look at by browsing the diff :-)
thepurpleblob [Tue, 8 May 2007 14:24:13 +0000 (14:24 +0000)]
MDL-9700:
Added more comprehensive checks for missing fields not exported in
previous versions.
More could be done, but this covers the basics and works for 1.6 (and
probably 1.5) exports.
nicolasconnault [Tue, 8 May 2007 08:01:55 +0000 (08:01 +0000)]
MDL-9506 Stuck on grade_category->generate_grades. I cannot figure out how to recursively generate raw grades for each category's associated grade_item based on that category's children categories and items. Heaps of other changes with this commit, including a new grade_object::update_from_db() method, which uses the state of the record in DB to update the current object with a matching id (useful when you insert an incomplete object in the DB and want to get the default values as set up in the DB).
nicolasconnault [Tue, 8 May 2007 02:20:26 +0000 (02:20 +0000)]
MDL-9506 Issue 1: adjusting a gradeitem's value would result in a grade_final object with gradevalue assigned, even when a gradescale should have been assigned. Issue 2: double grade_final entries when calling grade_item->load_final() after grade_item->generate_final(). Issue 3: Calling grade_item->update_final_grade() without first calling grade_item->generate_final() would result in fatal error. generate_final() is now called if the raw and final arrays' sizes don't match.
nicolasconnault [Mon, 7 May 2007 02:04:06 +0000 (02:04 +0000)]
MDL-9506 Removed implicit loading of associated objects from constructors (grade_item and grade_grades_raw) to avoid very large numbers of sql queries when only little data is required. The load_scale() method, for example, needs to be called explicitly.
martinlanghoff [Sun, 6 May 2007 05:32:40 +0000 (05:32 +0000)]
get_my_courses() callers update - check of the $fields param - pass null instead
The default way to call get_my_courses() is now to pass null in the $fields
param to get the (cached copy) of the useful fields. Cuts down enormously
on DB traffic, memory footprint, and session size.
With 2500 courses the calendar was causing around 15000 queries at login and 5000 on the home page.
- Replaced queries inside loops with single unlooped queries.
- Fixed calendar so that course events will show when the users role is assigned at a category level.
- Moved calendar_session_vars() function call out of calendar/lib.php (including a lib should not have side effects)
Author: Matt Clarkson - with some conflict resolution from MartinL