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.
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.