diff --git a/grade/report/grader/index.php b/grade/report/grader/index.php index 6fca7eaf471..b8f86f39cc2 100644 --- a/grade/report/grader/index.php +++ b/grade/report/grader/index.php @@ -327,10 +327,10 @@ foreach ($gtree->levels as $key=>$row) { $dimmed = ''; if ($element['object']->is_hidden()) { - $dimmed = 'class="dimmed_text"'; + $dimmed = ' dimmed_text '; } - $headerhtml .= ''. $element['object']->get_name() . '' . $arrow; diff --git a/lang/en_utf8/grades.php b/lang/en_utf8/grades.php index eb109f9fbbd..9d6b91f39ab 100644 --- a/lang/en_utf8/grades.php +++ b/lang/en_utf8/grades.php @@ -47,8 +47,11 @@ $string['exporttxt'] = 'Export TXT'; $string['exportxml'] = 'Export XML'; $string['extracredit'] = 'Extra Credit'; $string['extracreditwarning'] = 'Note: Setting all items for a category to extra credit will effectively remove them from the grade calculation. Since there will be no point total'; +$string['feedback'] = 'Feedback'; +$string['feedbackedit'] = 'Edit feedback'; $string['forelementtypes'] = ' for the selected $a'; $string['forstudents'] = 'For Students'; +$string['grade'] = 'Grade'; $string['gradebook'] = 'Gradebook'; $string['gradebookhiddenerror'] = 'The gradebook is currently set to hide everything from students.'; $string['gradecategoryhelp'] = 'Grade Category Help'; @@ -127,6 +130,7 @@ $string['nonweightedpct'] = 'non-weighted %%'; $string['noselectedcategories'] = 'no categories were selected.'; $string['noselecteditems'] = 'no items were selected.'; $string['notteachererror'] = 'You must be a teacher to use this feature.'; +$string['onascaleof'] = ' on a scale of $a->grademin to $a->grademax'; $string['outcome'] = 'Outcome'; $string['pctoftotalgrade'] = '%% of total grade'; $string['percent'] = 'Percent'; diff --git a/lib/grade/grade_item.php b/lib/grade/grade_item.php index 0c83228e048..beeef4ad08c 100644 --- a/lib/grade/grade_item.php +++ b/lib/grade/grade_item.php @@ -199,13 +199,13 @@ class grade_item extends grade_object { var $hidden = 0; /** - * Grade item lock flag. Enmpty if not locked, lcoked if any value presetn ,usually date when was locked. Locking prevents updating. + * Grade item lock flag. Empty if not locked, locked if any value present, usually date when item was locked. Locking prevents updating. * @var int $locked */ var $locked = 0; /** - * Date when to lock the grade. Empty means no automatic locking. + * Date after which the grade will be locked. Empty means no automatic locking. * @var int $locktime */ var $locktime = 0; diff --git a/lib/gradelib.php b/lib/gradelib.php index d0c3b1c27da..9cfec768cee 100644 --- a/lib/gradelib.php +++ b/lib/gradelib.php @@ -59,6 +59,16 @@ define('GRADE_UPDATE_MULTIPLE', 2); define('GRADE_UPDATE_ITEM_DELETED', 3); define('GRADE_UPDATE_ITEM_LOCKED', 4); +// Set up constants for report preferences +define('GRADER_REPORT_AGGREGATION_POSITION_LEFT', 0); +define('GRADER_REPORT_AGGREGATION_POSITION_RIGHT', 1); +define('GRADER_REPORT_AGGREGATION_VIEW_FULL', 0); +define('GRADER_REPORT_AGGREGATION_VIEW_COMPACT', 1); +define('GRADER_REPORT_GRADE_DISPLAY_TYPE_RAW', 0); +define('GRADER_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE', 1); +define('GRADER_REPORT_FEEDBACK_FORMAT_TEXT', 0); +define('GRADER_REPORT_FEEDBACK_FORMAT_HTML', 1); + require_once($CFG->libdir . '/grade/grade_category.php'); require_once($CFG->libdir . '/grade/grade_item.php'); @@ -699,7 +709,8 @@ function grade_oldgradebook_upgrade($courseid) { function grade_get_icons($element, $tree) { global $CFG; global $USER; - + + // Load language strings $straddfeedback = get_string("addfeedback", 'grades'); $stredit = get_string("edit"); $streditfeedback = get_string("editfeedback", 'grades'); @@ -718,12 +729,17 @@ function grade_get_icons($element, $tree) { $strswitch_plus = get_string("expand", 'grades'); $strunlock = get_string("unlock", 'grades'); + // Prepare container div $html = '
'; + // Prepare reference variables $eid = $element['eid']; $object = $element['object']; $type = $element['type']; + // Load user preferences + $aggregationview = get_user_preferences('grade_report_aggregationview', $CFG->grade_report_aggregationview); + // Icons shown when edit mode is on if ($USER->gradeediting) { // Edit icon (except for grade_grades) @@ -753,13 +769,13 @@ function grade_get_icons($element, $tree) { if ($type != 'category' and $USER->gradefeedback) { // Display Edit/Add feedback icon if (empty($object->feedback)) { - $html .= 'commonvars\">\n"; + $html .= 'courseid\">\n"; $html .= ''.$straddfeedback.''. "\n"; } else { - $html .= 'commonvars\">\n"; + $html .= 'courseid\">\n"; $html .= ''.$streditfeedback.''. "\n"; @@ -785,7 +801,7 @@ function grade_get_icons($element, $tree) { .${'str' . $lock_unlock}.'" title="'.${'str' . $lock_unlock}.'" />'. "\n"; // If object is a category, display expand/contract icon - if (get_class($object) == 'grade_category') { + if (get_class($object) == 'grade_category' && $aggregationview == GRADER_REPORT_AGGREGATION_VIEW_COMPACT) { $expand_contract = 'switch_minus'; // Default: expanded $state = get_user_preferences('grade_category_' . $object->id, GRADE_CATEGORY_EXPANDED); @@ -803,8 +819,8 @@ function grade_get_icons($element, $tree) { if ($USER->gradefeedback) { // Display Edit/Add feedback icon if (!empty($object->feedback)) { - $html .= 'commonvars\">\n"; + $html .= 'courseid\">\n"; $html .= ''. "\n";