48 Commits

Author SHA1 Message Date
nicolasconnault
da3801e84b MDL-14967 Upgraded gradebook code and unit tests. 4 failing tests in grade_item to fix. 2008-05-23 14:52:50 +00:00
nicolasconnault
b7064779f5 Updated copyright notice in header 2007-10-10 05:25:14 +00:00
skodak
fcac8e513a MDL-11357, MDL-11358 cleanup and improvements in public grade API - new function grade_get_grades() that returns all grading information (grade item data, outcomes and user grades); other minor improvements and bugfixes; updated assignment to use new grade API 2007-09-22 20:21:44 +00:00
skodak
aaff71daf4 MDL-10365 Improved handling of history when inserting/updating/deleting in new grade reports;first part 2007-07-06 12:49:28 +00:00
skodak
f92dcad81a MDL-10233 improved static factory methods of grade obejcts fetch() and fetch_all(); implemented default values of grade objects, fixed null values for some properties that are not required - unit tests included, tested with PHP4 and PHP5 2007-06-24 22:26:33 +00:00
skodak
2cc4b0f90d MDL-10223 Implement locking of grades and grade items - cron support still not implemented;
this patch also contains improvements in handling of needsupdate, though it is not yet fully working for calculated grades
2007-06-22 08:57:39 +00:00
skodak
ac9b080524 MDL-10202 merge raw and final grade tables 2007-06-20 23:06:29 +00:00
skodak
b8ff92b66b MDL-9137 various grading improvements
1/ initial support for migration of old grade_items and categories (not tested)
2/ rewritten grade update and calculation logic
3/ initial support for calculation formulas
4/ minor API refactoring and cleanup
5/ various small bugfixes
6/ fixed use of grademax with scales
7/ fixed some unit tests

TODO:
* implement proper locking of grades - needs discussion
* force recalculation of all formulas after adding/removing/changing of grade items
* better delete flag support
* support for NULLs n backup - Eloy already proposed a solution
* support for NULLs in set_field()
* speedup
* more unit tests nd functional tests
2007-06-18 13:43:40 +00:00
skodak
f70152b7bb MDL-10104 grade_create_item() in gradelib.php was obsoleted by grade_update() function which does the creation and update of grade_items 2007-06-12 20:19:38 +00:00
skodak
34e67f76a8 MDL-10076 finalize grade_is_locked() and implement grade item locking in assignment 2007-06-10 20:34:07 +00:00
skodak
cdbbd26f80 MDL-10064 global $CFG in unit test files is non standard, it is recommended to use MOODLE_INTERNAL test in all library files 2007-06-09 16:32:36 +00:00
skodak
02e6a9731f MDL-9866 reverting previous incorrect fix for include() in simpletest library; patching grade unit tests instead 2007-06-09 15:03:05 +00:00
nicolasconnault
1c307f2186 grade_item idnumber now self generated if needed.
deleted flag implemented in grade_item::update method
added GRADE_TYPE_NONE to gradelib and updated grade_item object
Implemented multiple items (generation of itemnumber when not explicitly given)
2007-06-07 12:45:24 +00:00
skodak
13127313d3 fixed unit grade tests - missing grade types 2007-06-06 22:15:40 +00:00
nicolasconnault
bbac4ae7c5 MDL-9972 Removed the __destruct() method, which was not needed. Also fixed a few bugs that caused notices in PHP5. 2007-06-05 01:19:09 +00:00
nicolasconnault
526e1a8a25 MDL-9506 Corrected a number of small errors in unit tests and classes. 2007-05-28 01:26:58 +00:00
nicolasconnault
ab53054fd1 MDL-9506 Removed the debugging message for the fetch() methods. Added droplow and keephigh rules to grade_category::aggregate_grades(). The only question now is what to do when the droplow or keephigh field is larger than the number of grades for a given user/item combination. At the moment it just gives that value 0. 2007-05-21 05:54:12 +00:00
nicolasconnault
0dfe77317a 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. 2007-05-16 02:47:56 +00:00
nicolasconnault
5e16f809f8 MDL-9506 Experimental development of numbering and displaying of category and items tree/table. Messy work :-) 2007-05-15 09:59:53 +00:00
nicolasconnault
dda0c7e666 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. 2007-05-14 08:18:03 +00:00
nicolasconnault
096858ffcf 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. 2007-05-14 04:14:22 +00:00
nicolasconnault
2df712352d 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 :-) 2007-05-11 08:46:34 +00:00
nicolasconnault
8f4a626d5c 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.
2007-05-10 08:08:43 +00:00
nicolasconnault
6c76ea8dfa MLD-9506 Grade_grades_raw object now infers grademax and grademin from scale, if scaleid is given at the time of insert of update. 2007-05-09 08:56:08 +00:00
nicolasconnault
6527197b4e 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 :-) 2007-05-09 07:50:28 +00:00
nicolasconnault
2c72af1f08 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). 2007-05-08 08:01:55 +00:00
nicolasconnault
f151b07393 MDL-9506 Added category's associated grade_item object, and changed unit tests database data so that it creates its own test tables. 2007-05-07 07:33:11 +00:00
nicolasconnault
46566dd8c6 MDL-9506 Moved unit tests in a simpletest subfolder so they can be automatically grouped. Added grade_history and grade_text object and another heap of small implementations. 2007-05-04 07:40:51 +00:00
nicolasconnault
52b72d77c5 MDL-9506 Reorganised the gradebook unit tests into more manageable classes. 2007-05-04 02:31:16 +00:00
nicolasconnault
5501446df5 MDL-9506 Added grade_outcome.php. Also added unit test for creation of log in history table when grade_raw is updated. 2007-05-03 08:51:48 +00:00
nicolasconnault
4d0263c6e2 MDL-9506 See previous revision. This adds same functionality but in relation to the hidden field. 2007-05-03 08:08:38 +00:00
nicolasconnault
fae51e127b MDL-9506 Added grade_item::toggle_locking and unit tests. Affects all final grades if reqested. 2007-05-03 08:02:51 +00:00
nicolasconnault
27f95e9b47 MDL-9506 Upgraded grade_item::adjust_grade with Darlene's more elegant formula. Completed grade_category::get_children($depth, $arraytype). Added 4 constants to help that method. Added and passed all unit tests (111 now). 2007-05-03 07:10:22 +00:00
nicolasconnault
7c8a963f7b MDL-9506 Finished all unit test stubs, another batch to write soon. One one test fails because I haven't implemented recursive category hierarchy output yet, and not sure if it's needed. A grade_category already returns its immediate children, and that may be enough. 2007-05-02 07:20:13 +00:00
nicolasconnault
ce385eb4e3 MDL-9506 Implemented category path and depth, and wrote unit tests for them. 2007-05-01 08:56:37 +00:00
nicolasconnault
d5bdb228a5 MDL-9506 Finished grade_item::adjust_grade, which now also adjusts scale grades correctly. Added grade_scale object to wrap around the current non-normalized scale DB table. When/if we upgrade to grade_scales and grade_scale_items DB tables, changing the grade_scale class will be easy. 2007-05-01 05:45:54 +00:00
nicolasconnault
d8676dc32e MDL-9506 Implemented rescaling and grade adjustment formulas in grade_item::adjust_grade(). Also wrote unit tests. 2007-05-01 03:18:55 +00:00
nicolasconnault
b3f111607f MDL-9506 Lots more unit tests, and work on grade_item::update method and associated functionality. 3 unit tests currently fail, so more work needed. 2007-04-30 09:09:32 +00:00
nicolasconnault
869807d8e4 MLD-9506 Corrected update_final_grades() in grade_item, which was updating the grade_raw table
instead of grade_final. Made a few other adjustments.
2007-04-30 05:25:19 +00:00
nicolasconnault
a8995b34df MDL-9506 Added grade_grades_raw as a proper object used by grade_item. Also added a global function in gradelib for updating grade_grades_raw objects. 2007-04-30 04:49:25 +00:00
nicolasconnault
f440c2d1b1 MDL-9506 Implemented get_raw and get_final, plus added method_exists() checks for each unit test. 2007-04-30 02:05:51 +00:00
tjhunt
d4bf4b8695 Fix syntax error. 2007-04-27 10:37:21 +00:00
nicolasconnault
e5c674f1e1 MDL-9506 Added raw and final grade objects, plus more work in unit tests. 2007-04-27 08:12:16 +00:00
nicolasconnault
60cf74305d MDL-9506 More work in the unit tests 2007-04-26 08:29:30 +00:00
nicolasconnault
f9f4a93b4e MDL-9506 Refactored gradelib.php: an abstract class (php5 in mind) holds data and methods common
to all grade_* objects. The unit test file has also been refactored to improve clarity.
2007-04-26 07:14:12 +00:00
nicolasconnault
27fbffb62b MDL-9506 More implementation of gradebook API and more unit tests. 2007-04-26 04:39:40 +00:00
nicolasconnault
619a59a70f MDL-9506 Set up the unit test bed and continued to implement gradebook API. 2007-04-24 08:50:19 +00:00
nicolasconnault
5834dcdb1d MDL-9506 First draft of gradelib, and the stubs for the unit tests. 2007-04-23 09:00:32 +00:00