From: skodak Date: Thu, 28 Jun 2007 13:20:30 +0000 (+0000) Subject: MDL-10224 total course grade implemented + lots of other changes and improvements... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b3ac6c3ef0f61b1663ff39379fd6de932d344a08;p=moodle.git MDL-10224 total course grade implemented + lots of other changes and improvements; there are still some regressions and bugs - going to fix them ASAP; some unit tests still missing too --- diff --git a/backup/backuplib.php b/backup/backuplib.php index 885de7b364..5e825f105a 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -1597,7 +1597,7 @@ foreach ($texts as $text) { fwrite ($bf,start_tag("GRADE_TEXT",6,true)); fwrite ($bf,full_tag("ID",7,false,$text->id)); - fwrite ($bf,full_tag("USERID",7,false,$text->userid)); + fwrite ($bf,full_tag("GRADEID",7,false,$text->gradeid)); fwrite ($bf,full_tag("INFORMATION",7,false,$text->information)); fwrite ($bf,full_tag("INFORMATIONFORMAT",7,false,$text->informationformat)); fwrite ($bf,full_tag("FEEDBACK",7,false,$text->feedback)); diff --git a/backup/restorelib.php b/backup/restorelib.php index f9f5c439db..d38cfd08e6 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -1287,7 +1287,7 @@ $dbrec->path = grade_category::build_path($dbrec); // this is not needed in the xml because // given this parent and grandparent(s) we can recalculate the depth - $dbrec->depth = grade_category::get_depth_from_path($dbrec->path); + $dbrec->depth = substr_count($dbrec->path, '/'); update_record('grade_categories', $dbrec); } else { // if fullname already exists, we should keep the current grade category @@ -1552,9 +1552,8 @@ //traverse_xmlize($ite_info); //Debug //print_object ($GLOBALS['traverse_array']); //Debug //$GLOBALS['traverse_array']=""; //Debug - $text->itemid = $itemid; - $user = backup_getid($restore->backup_unique_code,"user", backup_todb($ite_info['#']['USERID']['0']['#'])); - $text->userid = $user->new_id; + $grade = backup_getid($restore->backup_unique_code,"grade_grades", backup_todb($ite_info['#']['GRADEID']['0']['#'])); + $text->gradeid = $grade->new_id; $text->information = backup_todb($ite_info['#']['INFORMATION']['0']['#']); $text->informationformat = backup_todb($ite_info['#']['INFORMATIONFORMAT']['0']['#']); $text->feedback = backup_todb($ite_info['#']['FEEDBACK']['0']['#']); diff --git a/grade/report/grader/category.php b/grade/report/grader/category.php index bd90ee11b7..824ae2ee68 100644 --- a/grade/report/grader/category.php +++ b/grade/report/grader/category.php @@ -1,4 +1,5 @@ -libdir . '/gradelib.php'; * @param string $source_type 'topcat', 'subcat' or 'item' * @return string HTML code */ -function get_edit_tree($tree, $level=1, $elements=NULL, $source_sortorder=NULL, $action=NULL, $source_type=NULL) { - if (empty($tree->tree_array)) { - return null; - } else { - global $CFG; - global $USER; - - $strmove = get_string("move"); - $strmoveup = get_string("moveup"); - $strmovedown = get_string("movedown"); - $strmovehere = get_string("movehere"); - $strcancel = get_string("cancel"); - $stredit = get_string("edit"); - $strdelete = get_string("delete"); - $strhide = get_string("hide"); - $strshow = get_string("show"); - $strlock = get_string("lock", 'grades'); - $strunlock = get_string("unlock", 'grades'); - $strnewcategory = get_string("newcategory", 'grades'); - $strcategoryname = get_string("categoryname", 'grades'); - $strcreatecategory = get_string("createcategory", 'grades'); - $strsubcategory = get_string("subcategory", 'grades'); - $stritems = get_string("items", 'grades'); - $strcategories = get_string("categories", 'grades'); - - $list = ''; - $closing_form_tags = ''; - - if (empty($elements)) { - $list .= '
' . "\n"; - $list .= '