MDL-11835 proper merging

This commit is contained in:
skodak
2007-12-09 15:26:00 +00:00
parent 91cd49491c
commit d6948ebc6a
7 changed files with 36 additions and 10 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ $options = array(GRADE_AGGREGATE_MEAN =>get_string('aggregatemean', '
GRADE_AGGREGATE_MAX =>get_string('aggregatemax', 'grades'),
GRADE_AGGREGATE_MODE =>get_string('aggregatemode', 'grades'),
GRADE_AGGREGATE_SUM =>get_string('aggregatesum', 'grades'));
$defaults = array('value'=>GRADE_AGGREGATE_WEIGHTED_MEAN, 'forced'=>false, 'adv'=>false);
$defaults = array('value'=>GRADE_AGGREGATE_WEIGHTED_MEAN2, 'forced'=>false, 'adv'=>false);
$temp->add(new admin_setting_gradecat_combo('grade_aggregation', get_string('aggregation', 'grades'), get_string('aggregationhelp', 'grades'), $defaults, $options));
$options = array(0 => get_string('no'), 1 => get_string('yes'));
+6 -1
View File
@@ -642,6 +642,10 @@ class grade_report_grader extends grade_report {
$scales_list = substr($scales_list, 0, -1);
$scales_array = get_records_list('scale', 'id', $scales_list);
}
$row_classes = array(' even ', ' odd ');
$row_classes = array(' even ', ' odd ');
foreach ($this->users as $userid => $user) {
@@ -662,7 +666,8 @@ class grade_report_grader extends grade_report {
$user_pic = '<div class="userpic">' . print_user_picture($user->id, $this->courseid, true, 0, true) . '</div>';
}
$studentshtml .= '<tr class="r'.$this->rowcount++.'"><th class="header c'.$columncount++.' user" scope="row" onclick="set_row(this.parentNode.rowIndex);">'.$user_pic
$studentshtml .= '<tr class="r'.$this->rowcount++ . $row_classes[$this->rowcount % 2] . '">'
.'<th class="header c'.$columncount++.' user" scope="row" onclick="set_row(this.parentNode.rowIndex);">'.$user_pic
.'<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->course->id.'">'
.fullname($user).'</a></th>';
+9 -1
View File
@@ -40,6 +40,15 @@
background-color: #efefff;
}
.grade-report-grader table#user-grades tr.odd td.cell {
background-color: #efefef;
}
.grade-report-grader table#user-grades tr.odd th.header {
background-color: #efefef;
background-image: none;
}
.grade-report-grader table#user-grades tr.groupavg td.cell {
background-color: #efffef;
}
@@ -151,7 +160,6 @@
vertical-align: top;
}
.grade-report-grader div.gradertoggle {
display: inline;
margin-left: 20px;
+7
View File
@@ -105,6 +105,7 @@ $string['configshowuserimage'] = 'Whether to show the user\'s profile image next
$string['configstudentsperpage'] = 'The number of students to display per page in the grader report.';
$string['configstudentsperpagedefault'] = 'The number of students to display per page in the grader report. Leave this field empty to use the site default (currently $a).';
$string['contract'] = 'Contract Category';
$string['controls'] = 'Controls';
$string['coursegradecategory'] = 'Course grade category';
$string['coursegradedisplaytype'] = 'Course grade display type';
$string['coursegradedisplayupdated'] = 'The course grade display type has been updated.';
@@ -133,10 +134,12 @@ $string['dropxlowestwarning'] = 'Note: If you use drop x lowest the grading assu
$string['duplicatescale'] = 'Duplicate scale';
$string['edit'] = 'Edit';
$string['editcalculation'] = 'Edit calculation';
$string['editcalculationverbose'] = 'Edit calculation for $a->category$a->itemmodule $a->itemname';
$string['editfeedback'] = 'Edit feedback';
$string['editgrade'] = 'Edit grade';
$string['editoutcomes'] = 'Edit outcomes';
$string['edittree'] = 'Categories and items';
$string['editverbose'] = 'Edit $a->category$a->itemmodule $a->itemname';
$string['enableajax'] = 'Enable AJAX';
$string['enableoutcomes'] = 'Enable outcomes';
$string['encoding'] = 'Encoding';
@@ -236,6 +239,7 @@ $string['hidelocks'] = 'Hide locks';
$string['hidenooutcomes'] = 'Show outcomes';
$string['hidefeedback'] = 'Hide feedback';
$string['hideranges'] = 'Hide ranges';
$string['hideverbose'] = 'Hide $a->category$a->itemmodule $a->itemname';
$string['highgradeascending'] = 'Sort by high grade ascending';
$string['highgradedescending'] = 'Sort by high grade descending';
$string['highgradeletter'] = 'High';
@@ -273,6 +277,7 @@ $string['lock'] = 'Lock';
$string['locked'] = 'Locked';
$string['locktime'] = 'Lock after';
$string['locktimedate'] = 'Locked after: $a';
$string['lockverbose'] = 'Lock $a->category$a->itemmodule $a->itemname';
$string['lowest'] = 'Lowest';
$string['lowgradeletter'] = 'Low';
$string['manualitem'] = 'Manual item';
@@ -418,6 +423,7 @@ $string['shownumberofgrades'] = 'Show number of grades in averages';
$string['showranges'] = 'Show ranges';
$string['showrank'] = 'Show rank';
$string['showuserimage'] = 'Show user profile images';
$string['showverbose'] = 'Show $a->category$a->itemmodule $a->itemname';
$string['sitewide'] = 'Site-wide';
$string['sort'] = 'sort';
$string['sortasc'] = 'Sort in ascending order';
@@ -447,6 +453,7 @@ $string['updatedgradesonly'] = 'Export new or updated grades only';
$string['uncategorised'] = 'Uncategorised';
$string['unchangedgrade'] = 'Grade unchanged';
$string['unlock'] = 'Unlock';
$string['unlockverbose'] = 'Unlock $a->category$a->itemmodule $a->itemname';
$string['unused'] = 'Unused';
$string['uploadgrades'] = 'Upload grades';
$string['useadvanced'] = 'Use Advanced Features';
+8 -4
View File
@@ -80,7 +80,7 @@ function upgrade_18_letters() {
/// Changing the default of field letter on table grade_letters to drop it
$table = new XMLDBTable('grade_letters');
$field = new XMLDBField('letter');
$field->setAttributes(XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, null, 'lowerboundary');
$field->setAttributes(XMLDB_TYPE_CHAR, '255', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null, 'lowerboundary');
/// Launch change of default for field letter
$result = $result && change_field_precision($table, $field);
@@ -131,8 +131,9 @@ function upgrade_18_gradebook($courseid) {
$course_category->courseid = $courseid;
$course_category->fullname = get_string('coursegradecategory', 'grades');
$course_category->parent = null;
$course_category->aggregation = GRADE_AGGREGATE_MEAN;
$course_category->aggregation = GRADE_AGGREGATE_WEIGHTED_MEAN2;
$course_category->timemodified = $course_category->timecreated = time();
$course_category->aggregateonlygraded = 0;
if (!$course_category->id = insert_record('grade_categories', $course_category)) {
return false;
}
@@ -148,6 +149,7 @@ function upgrade_18_gradebook($courseid) {
$course_item->itemtype = 'course';
$course_item->iteminstance = $course_category->id;
$course_item->gradetype = GRADE_TYPE_VALUE;
$course_item->display = GRADE_DISPLAY_TYPE_PERCENTAGE;
$course_item->sortorder = $order++;
$course_item->timemodified = $course_item->timecreated = $course_category->timemodified;
$course_item->needsupdate = 1;
@@ -173,8 +175,9 @@ function upgrade_18_gradebook($courseid) {
$category->fullname = addslashes($oldcat->name);
$category->parent = $course_category->id;
$category->droplow = $oldcat->drop_x_lowest;
$category->aggregation = GRADE_AGGREGATE_MEAN;
$category->aggregation = GRADE_AGGREGATE_WEIGHTED_MEAN2;
$category->timemodified = $category->timecreated = time();
$category->aggregateonlygraded = 0;
if (!$category->id = insert_record('grade_categories', $category)) {
return false;
}
@@ -191,6 +194,7 @@ function upgrade_18_gradebook($courseid) {
$item->itemtype = 'category';
$item->iteminstance = $category->id;
$item->gradetype = GRADE_TYPE_VALUE;
$item->display = GRADE_DISPLAY_TYPE_PERCENTAGE;
$item->plusfactor = $oldcat->bonus_points;
$item->hidden = $oldcat->hidden;
$item->aggregationcoef = $oldcat->weight;
@@ -205,7 +209,7 @@ function upgrade_18_gradebook($courseid) {
}
}
$course_category->aggregation = GRADE_AGGREGATE_WEIGHTED_MEAN;
$course_category->aggregation = GRADE_AGGREGATE_WEIGHTED_MEAN2;
update_record('grade_categories', $course_category);
}
unset($oldcats);
+3 -3
View File
@@ -318,7 +318,7 @@ class grade_category extends grade_object {
$this->fullname = get_string('coursegradecategory', 'grades');
$this->path = null;
$this->parent = null;
$this->aggregation = GRADE_AGGREGATE_MEAN;
$this->aggregation = GRADE_AGGREGATE_WEIGHTED_MEAN2;
$this->apply_default_settings();
$this->apply_forced_settings();
@@ -1205,7 +1205,7 @@ class grade_category extends grade_object {
foreach ($this->forceable as $property) {
if (isset($CFG->{"grade_$property"})) {
if ($CFG->{"grade_$property"} == -1) {
continue; //use class defaults
continue; //temporary bc before version bump
}
$this->$property = $CFG->{"grade_$property"};
}
@@ -1223,7 +1223,7 @@ class grade_category extends grade_object {
foreach ($this->forceable as $property) {
if (isset($CFG->{"grade_$property"}) and isset($CFG->{"grade_{$property}_flag"}) and ((int)$CFG->{"grade_{$property}_flag"} & 1)) {
if ($CFG->{"grade_$property"} == -1) {
continue; //use class defaults
continue; //temporary bc before version bump
}
$this->$property = $CFG->{"grade_$property"};
$updated = true;
+2
View File
@@ -2153,6 +2153,8 @@ function assignment_update_grades($assignment=null, $userid=0, $nullifnone=true)
}
}
assignment_grade_item_update($assignment, $grades);
} else {
assignment_grade_item_update($assignment, NULL);
}
} else {