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
52f81103d3
MDL-10063 simpletestlib.php included from majority of unit tests - let's include it once from the test runner itself
2007-06-09 16:17:33 +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
skodak
2bb0dbf71d
MDL-10062 - unit test of raw grade load_text() improved
2007-06-09 14:29:07 +00:00
skodak
4cf1b9be9d
MDL-10062 - changes in raw grade handling of feedback and information
...
improved grade_update() function
2007-06-09 14:16:20 +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
210611f6ee
MDL-9629 Changed grade_item.gradetype default to 1, added GRADE_TYPE_NONE constant = 0, incrementing existing constants by 1. Set up auto-generation of idnumber for grade_item if itemmodule and iteminstance are set, only a temporary stub if they are not set (must be replaced by correct generation code). New category form now has server-side validation (not using formslib)
2007-06-05 08:50:24 +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
c3096060de
MDL-9506 Added ksort() of each level of categories and items for the gradebook. Unsorted arrays caused erratic behaviour when moving elements of the tree around.
2007-05-30 05:47:26 +00:00
nicolasconnault
a3d5594248
MDL-9506 Refactored grade_tree::get_tree by doing the following:
...
- Extracted the $fillers array into a class variable
- Extracted the addition of elements to grade_tree::fillers into a new add_fillers($array) method
- Extracted the inclusion of fillers into the tree_array to a new include_fillers($tree, $object=NULL) method
- Removed the building of the tree_filled, which was already performed by build_tree_filled()
- Removed the generation of next_sortorder and previous_sortorder attributes, which was already performed by renumber()
Result is a much leaner and scalable set of methods, and a tighter definition of responsibilities for the varying classes. I think I have also noticed a significant inprovement in speed.
2007-05-30 03:09:38 +00:00
nicolasconnault
646323549e
MDL-9506 Resolved recursion issues in grade_tree:renumber and grade_tree::get_neighbour_element. Unit tests all pass now.
2007-05-29 04:07:04 +00:00
nicolasconnault
de420c11c5
MDL-9317 Applying Petr's second patch
2007-05-29 00:56:44 +00:00
nicolasconnault
c91ed4be0d
MDL-9506 Category and Item now set their own courseid if not set explicitly, and if they have enough information from
...
other sources. category::set_as_parent has a new constraint: cannot set over children from different courses.
Applied recursion to grade_tree::renumber(), but still some fine-tuning to do, since only grade_items are getting updated in DB.
2007-05-28 08:00:19 +00:00
nicolasconnault
d990776605
MDL-9137 Applied parts of Petr's patch on the gradebook objects. Unit tests unaffected.
2007-05-28 02:05:21 +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
skodak
7458bee224
MDL-9643 some more polishing
2007-05-26 12:59:13 +00:00
skodak
a9cca58ea2
MDL-9643 minor maths unit test cleanup
2007-05-25 07:07:05 +00:00
nicolasconnault
8ae28b4959
MDL-9506 WOrking on grade_tree edit tree
2007-05-25 07:02:04 +00:00
skodak
ffaa6c4abd
MDL-9643 mathslib.php library, unit tests, removed e and pi constants
2007-05-25 06:50:09 +00:00
nicolasconnault
2186f72cb1
MDL-9629 Beginning the edit category page. Also added dmllib::sql_max($field) and fixed a few bugs. Grade_item should now extrapolate its sortorder upon insertion if not set, by looking up the last sortorder in the table, and incrementing by 1.
2007-05-24 08:50:01 +00:00
skodak
d46306de6a
MDL-9848 eventslib improvements and cleanup
2007-05-22 10:26:29 +00:00
nicolasconnault
9c585e573c
MDL-9506 Changed grade_tree fullobjects param (not fully implemented) to $include_grades param, default to false, fully implemented. Full objects are always loaded when building the tree, but grades are only loaded conditionally.
2007-05-22 09:03:33 +00:00
nicolasconnault
92a66edf7a
MDL-9506 Implemented grade_tree->update_db, fixed bugs in grade_category etc...
2007-05-22 04:38:20 +00:00
nicolasconnault
adc2f286e6
MDL-9506 Extracted the code that applies droplow and keephigh rules to aggregated values, into its own little method. Unit testing this method revealed a coding error which I have rectified.
2007-05-21 08:56:44 +00:00
nicolasconnault
c227624882
MDL-9506 New grade_tree->build_tree_filled method called at the end of renumber(). Prepares object for display_grades().
2007-05-21 07:47:41 +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
750b0550d9
MDL-9506 Resolved a small bug in grade_category that failed the set_as_parent method.
2007-05-21 02:22:12 +00:00
nicolasconnault
03f01edded
MDL-9506 New grade_category::set_as_parent($children) method (non-static). Crucial method for adding categories over children. 4 constraints have been set up, and successfully tested in unit tests. However, the method fails when it comes to updating the children's parent fields. The test data may be missing some required fields.
2007-05-18 08:05:53 +00:00
nicolasconnault
d7f1cc4c3b
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.
2007-05-18 05:34:30 +00:00
nicolasconnault
a39cac258d
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 :-)
2007-05-17 09:04:52 +00:00
nicolasconnault
607a0bbbc9
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.
2007-05-17 04:13:42 +00:00
nicolasconnault
8ff4550af2
MDL-9506 Refactored some of the category methods into grade_tree, same for unit tests.
2007-05-17 02:22:32 +00:00
nicolasconnault
e835361626
MDL-9506 Created new grade_tree object for working with a tree of grade_categories and items.
2007-05-16 15:04:35 +00:00
nicolasconnault
e81235897c
MDL-9506 Fixed a couple of failing unit tests, due to new test data
2007-05-16 07:47:04 +00:00
nicolasconnault
c78b0cc59a
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.
2007-05-16 03:17:46 +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
toyomoyo
9492291c82
some changes to events to make grade_added work
2007-05-15 03:19:01 +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
77d2540eea
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.
2007-05-11 03:29:00 +00:00
nicolasconnault
1d4b666828
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.
2007-05-11 02:43:46 +00:00
moodler
b55997c112
Removed set_timecreated and just tidied up some time-related things
2007-05-11 02:11:30 +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
8c8462437d
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
2007-05-10 02:34:01 +00:00
nicolasconnault
5de0c5cb76
MDL-9506 Replaces grade_grades_text.gradesid by composite key userid and itemid.
2007-05-09 09:01:56 +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