// new CFG variable for gradebook (what roles to display)
$temp->add(new admin_setting_special_gradebookroles());
+ // enable outcomes checkbox
+ $temp->add(new admin_setting_configcheckbox('enableoutcomes', get_string('enableoutcomes', 'grades'), get_string('configenableoutcomes', 'grades'), 0, PARAM_INT));
+
$temp->add(new admin_setting_grade_profilereport());
$temp->add(new admin_setting_configselect('grade_aggregationposition', get_string('aggregationposition', 'grades'),
$temp->add(new admin_setting_configselect('grade_export_displaytype', get_string('gradeexportdisplaytype', 'grades'),
get_string('configgradeexportdisplaytype', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
-
$temp->add(new admin_setting_configselect('grade_export_decimalpoints', get_string('gradeexportdecimalpoints', 'grades'),
get_string('configexportdecimalpoints', 'grades'), 2,
array( '0' => '0',
GRADE_NAVMETHOD_COMBO => get_string('combo', 'grades'))));
$temp->add(new admin_setting_special_gradeexport());
+
+ $temp->add(new admin_setting_special_gradelimiting());
}
$ADMIN->add('grades', $temp);
GRADE_AGGREGATE_MAX =>get_string('aggregatemax', 'grades'),
GRADE_AGGREGATE_MODE =>get_string('aggregatemode', 'grades'),
GRADE_AGGREGATE_SUM =>get_string('aggregatesum', 'grades'));
+
+ $defaultvisible = array(GRADE_AGGREGATE_MEAN, GRADE_AGGREGATE_WEIGHTED_MEAN, GRADE_AGGREGATE_WEIGHTED_MEAN2,
+ GRADE_AGGREGATE_EXTRACREDIT_MEAN, GRADE_AGGREGATE_MEDIAN, GRADE_AGGREGATE_MIN,
+ GRADE_AGGREGATE_MAX, GRADE_AGGREGATE_MODE, GRADE_AGGREGATE_SUM);
+
$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));
+ $temp->add(new admin_setting_configmultiselect('grade_aggregations_visible', get_string('aggregationsvisible', 'grades'),
+ get_string('aggregationsvisiblehelp', 'grades'), $defaultvisible, $options));
+
$options = array(0 => get_string('no'), 1 => get_string('yes'));
$defaults = array('value'=>1, 'forced'=>false, 'adv'=>true);
$scales = new admin_externalpage('scales', get_string('scales'), $CFG->wwwroot.'/grade/edit/scale/index.php', 'moodle/grade:manage');
$ADMIN->add('grades', $scales);
if ($CFG->enableoutcomes) {
- $outcomes = new admin_externalpage('outcomes', get_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage', empty($CFG->enableoutcomes));
+ $outcomes = new admin_externalpage('outcomes', get_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
$ADMIN->add('grades', $outcomes);
}
$letters = new admin_externalpage('letters', get_string('letters', 'grades'), $CFG->wwwroot.'/grade/edit/letter/edit.php', 'moodle/grade:manageletters');
// check the calculation formula
if ($data['calculation'] != '') {
$grade_item = grade_item::fetch(array('id'=>$data['id'], 'courseid'=>$data['courseid']));
- $calculation = calc_formula::unlocalize($data['calculation']);
+ $calculation = calc_formula::unlocalize(stripslashes($data['calculation']));
$result = $grade_item->validate_formula($calculation);
if ($result !== true) {
$errors['calculation'] = $result;
class edit_category_form extends moodleform {
private $aggregation_options = array();
+ private $allaggoptions;
function definition() {
global $CFG, $COURSE, $DB;
GRADE_AGGREGATE_MODE =>get_string('aggregatemode', 'grades'),
GRADE_AGGREGATE_SUM =>get_string('aggregatesum', 'grades'));
+ $this->allaggoptions = array_keys($this->aggregation_options);
+
// visible elements
$mform->addElement('header', 'headercategory', get_string('gradecategory', 'grades'));
$mform->addElement('text', 'fullname', get_string('categoryname', 'grades'));
$mform->addElement('select', 'aggregation', get_string('aggregation', 'grades'), $this->aggregation_options);
$mform->setHelpButton('aggregation', array('aggregation', get_string('aggregation', 'grades'), 'grade'));
+
if ((int)$CFG->grade_aggregation_flag & 2) {
$mform->setAdvanced('aggregation');
}
$mform->addElement('checkbox', 'aggregateonlygraded', get_string('aggregateonlygraded', 'grades'));
$mform->setHelpButton('aggregateonlygraded', array('aggregateonlygraded', get_string('aggregateonlygraded', 'grades'),'grade'), true);
$mform->disabledIf('aggregateonlygraded', 'aggregation', 'eq', GRADE_AGGREGATE_SUM);
+
if ((int)$CFG->grade_aggregateonlygraded_flag & 2) {
$mform->setAdvanced('aggregateonlygraded');
}
$mform->addElement('advcheckbox', 'aggregatesubcats', get_string('aggregatesubcats', 'grades'));
$mform->setHelpButton('aggregatesubcats', array('aggregatesubcats', get_string('aggregatesubcats', 'grades'), 'grade'), true);
+
if ((int)$CFG->grade_aggregatesubcats_flag & 2) {
$mform->setAdvanced('aggregatesubcats');
}
$options = array(0 => get_string('none'));
+
for ($i=1; $i<=20; $i++) {
$options[$i] = $i;
}
$mform->setHelpButton('grade_item_decimals', array('decimalpoints', get_string('decimalpoints', 'grades'), 'grade'), true);
$mform->setDefault('grade_item_decimals', -1);
$mform->disabledIf('grade_item_decimals', 'grade_item_display', 'eq', GRADE_DISPLAY_TYPE_LETTER);
+
if ($default_gradedisplaytype == GRADE_DISPLAY_TYPE_LETTER) {
$mform->disabledIf('grade_item_decimals', 'grade_item_display', "eq", GRADE_DISPLAY_TYPE_DEFAULT);
}
$mform->disabledIf('grade_item_hidden', 'grade_item_hiddenuntil[off]', 'notchecked');
/// locking
- $mform->addElement('advcheckbox', 'grade_item_locked', get_string('locked', 'grades'));
+ $mform->addElement('checkbox', 'grade_item_locked', get_string('locked', 'grades'));
$mform->setHelpButton('grade_item_locked', array('locked', get_string('locked', 'grades'), 'grade'));
$mform->addElement('date_time_selector', 'grade_item_locktime', get_string('locktime', 'grades'), array('optional'=>true));
$options = array();
$default = '';
- $coefstring = '';
$categories = grade_category::fetch_all(array('courseid'=>$COURSE->id));
foreach ($categories as $cat) {
if ($cat->is_course_category()) {
$default = $cat->id;
}
- if ($cat->is_aggregationcoef_used()) {
- if ($cat->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
- $coefstring = ($coefstring=='' or $coefstring=='aggregationcoefweight') ? 'aggregationcoefweight' : 'aggregationcoef';
-
- } else if ($cat->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN) {
- $coefstring = ($coefstring=='' or $coefstring=='aggregationcoefextra') ? 'aggregationcoefextra' : 'aggregationcoef';
-
- } else {
- $coefstring = 'aggregationcoef';
- }
- } else {
- $mform->disabledIf('grade_item_aggregationcoef', 'parentcategory', 'eq', $cat->id);
- }
}
+
if (count($categories) > 1) {
$mform->addElement('select', 'parentcategory', get_string('parentcategory', 'grades'), $options);
$mform->addElement('static', 'currentparentaggregation', get_string('currentparentaggregation', 'grades'));
}
- if ($coefstring !== '') {
- $mform->addElement('text', 'grade_item_aggregationcoef', get_string($coefstring, 'grades'));
- $mform->setHelpButton('grade_item_aggregationcoef', array('aggregationcoefweight', get_string('aggregationcoef', 'grades'), 'grade'), true);
- }
-
/// user preferences
$mform->addElement('header', 'headerpreferences', get_string('myreportpreferences', 'grades'));
$options = array(GRADE_REPORT_PREFERENCE_DEFAULT => get_string('default', 'grades'),
$mform =& $this->_form;
$somecat = new grade_category();
+
foreach ($somecat->forceable as $property) {
if ((int)$CFG->{"grade_{$property}_flag"} & 1) {
if ($mform->elementExists($property)) {
}
}
+ $current_aggregation = null;
+
if ($id = $mform->getElementValue('id')) {
$grade_category = grade_category::fetch(array('id'=>$id));
$grade_item = $grade_category->load_grade_item();
+ $current_aggregation = $grade_category->aggregation;
+
// remove agg coef if not used
if ($grade_category->is_course_category()) {
if ($mform->elementExists('parentcategory')) {
if ($grade_category->is_course_category() && $mform->getElementValue('fullname') == '?') {
$mform->setDefault('fullname', '');
}
+ // remove unwanted aggregation options
+ if ($mform->elementExists('aggregation')) {
+ $agg_el =& $mform->getElement('aggregation');
+ $visible = explode(',', $CFG->grade_aggregations_visible);
+ if (!is_null($current_aggregation)) {
+ // current type is always visible
+ $visible[] = $current_aggregation;
+ }
+ foreach ($this->allaggoptions as $type) {
+ if (!in_array($type, $visible) && $grade_category->aggregation != $type) {
+ $agg_el->removeOption($type);
+ }
+ }
+ }
}
+
// no parent header for course category
if (!$mform->elementExists('aggregationcoef') and !$mform->elementExists('parentcategory')) {
$mform->removeElement('headerparent');
$grade_category = grade_category::fetch(array('id'=>$id));
$grade_item = $grade_category->load_grade_item();
+ $mform->setDefault('grade_item_hidden', (int) $grade_item->hidden);
+
if (!$grade_item->is_raw_used()) {
$mform->removeElement('grade_item_plusfactor');
$mform->removeElement('grade_item_multfactor');
$mform->removeElement('grade_item_aggregationcoef');
}
} else {
- //fix label if needed
- $agg_el =& $mform->getElement('grade_item_aggregationcoef');
- $aggcoef = '';
- if ($parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
- $aggcoef = 'aggregationcoefweight';
- } else if ($parent_category->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN) {
- $aggcoef = 'aggregationcoefextra';
+ $coefstring = $grade_item->get_coefstring();
- } else if ($parent_category->aggregation == GRADE_AGGREGATE_SUM) {
- $aggcoef = 'aggregationcoefextrasum';
- }
-
- if ($aggcoef !== '') {
- $agg_el->setLabel(get_string($aggcoef, 'grades'));
- $mform->setHelpButton('grade_item_aggregationcoef', array($aggcoef, get_string($aggcoef, 'grades'), 'grade'), true);
+ if ($coefstring == 'aggregationcoefextrasum') {
+ // advcheckbox is not compatible with disabledIf!
+ $element =& $mform->createElement('checkbox', 'grade_item_aggregationcoef', get_string($coefstring, 'grades'));
+ } else {
+ $element =& $mform->createElement('text', 'grade_item_aggregationcoef', get_string($coefstring, 'grades'));
}
+ $mform->insertElementBefore($element, 'parentcategory');
+ $mform->setDefault('grade_item_aggregationcoef', (int) $grade_item->aggregationcoef); // must be cast to int, otherwise "0" counts as true :S
+ $mform->setHelpButton('grade_item_aggregationcoef', array($coefstring, get_string($coefstring, 'grades'), 'grade'), true);
+ $mform->disabledIf('grade_item_aggregationcoef', 'grade_item_parentcategory', 'eq', $parent_category->id);
}
}
redirect($returnurl);
// form processing
-} else if ($data = $mform->get_data()) {
+} else if ($data = $mform->get_data(false)) {
$old_grade_grade = new grade_grade(array('userid'=>$data->userid, 'itemid'=>$grade_item->id), true); //might not exist yet
// fix no grade for scales
$showadvanced = optional_param('showadvanced', -1, PARAM_BOOL); // sticky editting mode
/// Make sure they can even access this course
-
if (!$course = $DB->get_record('course', array('id' => $courseid))) {
print_error('nocourseid');
}
}
// Change category aggregation if requested
-if (!is_null($category) && !is_null($aggregationtype)) {
+if (!is_null($category) && !is_null($aggregationtype) && confirm_sesskey()) {
if (!$grade_category = grade_category::fetch(array('id'=>$category, 'courseid'=>$courseid))) {
error('Incorrect category id!');
}
$data->aggregation = $aggregationtype;
grade_category::set_properties($grade_category, $data);
$grade_category->update();
+ grade_regrade_final_grades($courseid);
}
//first make sure we have proper final grades - we need it for locking changes
switch ($action) {
case 'delete':
- if ($eid) {
+ if ($eid && confirm_sesskey()) {
if (!$grade_edit_tree->element_deletable($element)) {
// no deleting of external activities - they would be recreated anyway!
// exception is activity without grading or misconfigured activities
case 'moveselect':
if ($eid and confirm_sesskey()) {
$grade_edit_tree->moving = $eid;
+ $moving=true;
}
break;
if ($form_key && $data = data_submitted()) {
// Perform bulk actions first
- if (!empty($data->bulkmove)) {
+ if (!empty($data->bulkmove) && confirm_sesskey()) {
$elements = array();
foreach ($data as $key => $value) {
// Category and item field updates
foreach ($data as $key => $value) {
// Grade category text inputs
- if (preg_match('/(aggregation|droplow|keephigh)_([0-9]*)/', $key, $matches)) {
+ if (preg_match('/(aggregation|droplow|keephigh)_([0-9]*)/', $key, $matches) && confirm_sesskey()) {
$value = required_param($matches[0], PARAM_INT);
$param = $matches[1];
$a->id = $matches[2];
$grade_category->$param = $value;
$grade_category->update();
+ grade_regrade_final_grades($courseid);
// Grade item text inputs
- } elseif (preg_match('/(grademax|aggregationcoef|multfactor|plusfactor)_([0-9]*)/', $key, $matches)) {
+ } elseif (preg_match('/(grademax|aggregationcoef|multfactor|plusfactor)_([0-9]*)/', $key, $matches) && confirm_sesskey()) {
$defaults = array('grademax' => 100, 'aggregationcoef' => 1, 'multfactor' => 1, 'plusfactor' => 0);
if (is_string($_POST[$matches[0]]) && strlen($_POST[$matches[0]]) < 1) {
$grade_item->$param = $value;
$grade_item->update();
+ grade_regrade_final_grades($courseid);
// Grade item checkbox inputs
- } elseif (preg_match('/extracredit_original_([0-9]*)/', $key, $matches)) { // Sum extra credit checkbox
+ } elseif (preg_match('/extracredit_original_([0-9]*)/', $key, $matches) && confirm_sesskey()) { // Sum extra credit checkbox
$extracredit = optional_param("extracredit_{$matches[1]}", null, PARAM_BOOL);
$original_value = required_param($matches[0], PARAM_BOOL);
$a->id = $matches[1];
$newvalue = null;
-
if ($original_value == 1 && is_null($extracredit)) {
$newvalue = 0;
} elseif ($original_value == 0 && $extracredit == 1) {
$grade_item->aggregationcoef = $newvalue;
$grade_item->update();
+ grade_regrade_final_grades($courseid);
// Grade category checkbox inputs
- } elseif (preg_match('/aggregate(onlygraded|subcats|outcomes)_original_([0-9]*)/', $key, $matches)) {
+ } elseif (preg_match('/aggregate(onlygraded|subcats|outcomes)_original_([0-9]*)/', $key, $matches) && confirm_sesskey()) {
$setting = optional_param('aggregate'.$matches[1].'_'.$matches[2], null, PARAM_BOOL);
$original_value = required_param($matches[0], PARAM_BOOL);
$a->id = $matches[2];
$grade_category->{'aggregate'.$matches[1]} = $newvalue;
$grade_category->update();
+ grade_regrade_final_grades($courseid);
}
}
}
print_single_button('outcomeitem.php', array('courseid'=>$course->id), get_string('addoutcomeitem', 'grades'), 'get');
}
- echo "<br /></br />";
+ //print_single_button('index.php', array('id'=>$course->id, 'action'=>'autosort'), get_string('autosort', 'grades'), 'get');
+ echo "<br /><br />";
print_single_button('index.php', array('id'=>$course->id, 'action'=>'synclegacy'), get_string('synclegacygrades', 'grades'), 'get');
helpbutton('synclegacygrades', get_string('synclegacygrades', 'grades'), 'grade');
}
foreach ($categories as $cat) {
$cat->apply_forced_settings();
$options[$cat->id] = $cat->get_name();
+
if ($cat->is_course_category()) {
$default = $cat->id;
}
-
- if ($cat->is_aggregationcoef_used()) {
- if ($cat->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
- $coefstring = ($coefstring=='' or $coefstring=='aggregationcoefweight') ? 'aggregationcoefweight' : 'aggregationcoef';
-
- } else if ($cat->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN) {
- $coefstring = ($coefstring=='' or $coefstring=='aggregationcoefextra') ? 'aggregationcoefextra' : 'aggregationcoef';
-
- } else if ($cat->aggregation == GRADE_AGGREGATE_SUM) {
- $coefstring = ($coefstring=='' or $coefstring=='aggregationcoefextrasum') ? 'aggregationcoefextrasum' : 'aggregationcoef';
-
- } else {
- $coefstring = 'aggregationcoef';
- }
- } else {
- $mform->disabledIf('aggregationcoef', 'parentcategory', 'eq', $cat->id);
- }
}
if (count($categories) > 1) {
$mform->addElement('select', 'parentcategory', get_string('gradecategory', 'grades'), $options);
}
- if ($coefstring !== '') {
- if ($coefstring == 'aggregationcoefextrasum') {
- // advcheckbox is not compatible with disabledIf!
- $mform->addElement('checkbox', 'aggregationcoef', get_string($coefstring, 'grades'));
- } else {
- $mform->addElement('text', 'aggregationcoef', get_string($coefstring, 'grades'));
- }
- $mform->setHelpButton('aggregationcoef', array($coefstring, get_string($coefstring, 'grades'), 'grade'), true);
- }
-
/// hidden params
$mform->addElement('hidden', 'id', 0);
$mform->setType('id', PARAM_INT);
$mform->removeElement('aggregationcoef');
}
} else {
- //fix label if needed
- $agg_el =& $mform->getElement('aggregationcoef');
- $aggcoef = '';
- if ($parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
- $aggcoef = 'aggregationcoefweight';
-
- } else if ($parent_category->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN) {
- $aggcoef = 'aggregationcoefextra';
-
- } else if ($parent_category->aggregation == GRADE_AGGREGATE_SUM) {
- $aggcoef = 'aggregationcoefextrasum';
+ if ($grade_item->is_category_item()) {
+ $parent_category = $parent_category->get_parent_category();
+ $coefstring = $parent_category->get_grade_item()->get_coefstring();
+ } else {
+ $parent_category->apply_forced_settings();
+ $coefstring = $grade_item->get_coefstring();
}
- if ($aggcoef !== '') {
- $agg_el->setLabel(get_string($aggcoef, 'grades'));
- $mform->setHelpButton('aggregationcoef', array($aggcoef, get_string($aggcoef, 'grades'), 'grade'), true);
+ if ($coefstring !== '') {
+ if ($coefstring == 'aggregationcoefextrasum') {
+ // advcheckbox is not compatible with disabledIf!
+ $element =& $mform->createElement('checkbox', 'aggregationcoef', get_string($coefstring, 'grades'));
+ } else {
+ $element =& $mform->createElement('text', 'aggregationcoef', get_string($coefstring, 'grades'));
+ }
+ $mform->insertElementBefore($element, 'parentcategory');
+ $mform->setHelpButton('aggregationcoef', array($coefstring, get_string($coefstring, 'grades'), 'grade'), true);
}
+
+ $mform->disabledIf('aggregationcoef', 'parentcategory', 'eq', $parent_category->id);
}
}
public $deepest_level;
+ public $uses_extra_credit = false;
+
+ public $uses_weight = false;
+
/**
* Constructor
*/
$this->deepest_level = $this->get_deepest_level($this->gtree->top_element);
$this->columns = array(grade_edit_tree_column::factory('name', array('deepest_level' => $this->deepest_level)),
- grade_edit_tree_column::factory('aggregation', array('flag' => true)),
- grade_edit_tree_column::factory('weightorextracredit', array('adv' => 'aggregationcoef')),
- grade_edit_tree_column::factory('range'), // This is not a setting... How do we deal with it?
- grade_edit_tree_column::factory('aggregateonlygraded', array('flag' => true)),
- grade_edit_tree_column::factory('aggregatesubcats', array('flag' => true)),
- grade_edit_tree_column::factory('aggregateoutcomes', array('flag' => true)),
- grade_edit_tree_column::factory('droplow', array('flag' => true)),
- grade_edit_tree_column::factory('keephigh', array('flag' => true)),
- grade_edit_tree_column::factory('multfactor', array('adv' => true)),
- grade_edit_tree_column::factory('plusfactor', array('adv' => true)),
- grade_edit_tree_column::factory('actions'),
- grade_edit_tree_column::factory('select')
- );
+ grade_edit_tree_column::factory('aggregation', array('flag' => true)));
+
+ if ($this->uses_weight) {
+ $this->columns[] = grade_edit_tree_column::factory('weight', array('adv' => 'aggregationcoef'));
+ }
+ if ($this->uses_extra_credit) {
+ $this->columns[] = grade_edit_tree_column::factory('extracredit', array('adv' => 'aggregationcoef'));
+ }
+
+ $this->columns[] = grade_edit_tree_column::factory('range'); // This is not a setting... How do we deal with it?
+ $this->columns[] = grade_edit_tree_column::factory('aggregateonlygraded', array('flag' => true));
+ $this->columns[] = grade_edit_tree_column::factory('aggregatesubcats', array('flag' => true));
+ $this->columns[] = grade_edit_tree_column::factory('aggregateoutcomes', array('flag' => true));
+ $this->columns[] = grade_edit_tree_column::factory('droplow', array('flag' => true));
+ $this->columns[] = grade_edit_tree_column::factory('keephigh', array('flag' => true));
+ $this->columns[] = grade_edit_tree_column::factory('multfactor', array('adv' => true));
+ $this->columns[] = grade_edit_tree_column::factory('plusfactor', array('adv' => true));
+ $this->columns[] = grade_edit_tree_column::factory('actions');
+ $this->columns[] = grade_edit_tree_column::factory('select');
}
/**
/**
* Given a grade_item object, returns a labelled input if an aggregation coefficient (weight or extra credit) applies to it.
* @param grade_item $item
+ * @param string type "extra" or "weight": the type of the column hosting the weight input
* @return string HTML
*/
- function get_weight_input($item) {
+ function get_weight_input($item, $type) {
if (!is_object($item) || get_class($item) !== 'grade_item') {
throw new Exception('grade_edit_tree::get_weight_input($item) was given a variable that is not of the required type (grade_item object)');
return false;
}
$parent_category = $item->get_parent_category();
-
- if ($item->is_category_item()) {
- $parent_category = $parent_category->get_parent_category();
- }
-
$parent_category->apply_forced_settings();
+ $aggcoef = $item->get_coefstring();
- if ($parent_category->is_aggregationcoef_used()) {
- $aggcoef = '';
-
- if ($parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
- $aggcoef = 'aggregationcoefweight';
- } elseif ($parent_category->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN) {
- $aggcoef = 'aggregationcoefextra';
- } elseif ($parent_category->aggregation == GRADE_AGGREGATE_SUM) {
- $aggcoef = 'aggregationcoefextrasum';
- }
-
- if ($aggcoef == 'aggregationcoefweight' || $aggcoef == 'aggregationcoefextra') {
+ if ((($aggcoef == 'aggregationcoefweight' || $aggcoef == 'aggregationcoef') && $type == 'weight') ||
+ ($aggcoef == 'aggregationcoefextra' && $type == 'extra')) {
return '<input type="text" size="6" id="aggregationcoef_'.$item->id.'" name="aggregationcoef_'.$item->id.'"
value="'.format_float($item->aggregationcoef).'" />';
- } elseif ($aggcoef == 'aggregationcoefextrasum' ) {
+ } elseif ($aggcoef == 'aggregationcoefextrasum' && $type == 'extra') {
$checked = ($item->aggregationcoef > 0) ? 'checked="checked"' : '';
$extracredit = ($item->aggregationcoef > 0) ? 1 : 0;
return '';
}
}
- }
/**
* Given an element of the grade tree, returns whether it is deletable or not (only manual grade items are deletable)
$object = $element['object'];
$level++;
-
+ $coefstring = $element['object']->get_coefstring();
if ($element['type'] == 'category') {
+ if ($coefstring == 'aggregationcoefweight') {
+ $this->uses_weight = true;
+ } elseif ($coefstring == 'aggregationcoefextra' || $coefstring == 'aggregationcoefextrasum') {
+ $this->uses_extra_credit = true;
+ }
+
foreach($element['children'] as $child_el) {
if ($level > $deepest_level) {
$deepest_level = $level;
}
public function get_category_cell($category, $levelclass, $params) {
+ global $CFG;
if (empty($params['id'])) {
throw new Exception('Array key (id) missing from 3rd param of grade_edit_tree_column_aggregation::get_category_cell($category, $levelclass, $params)');
}
GRADE_AGGREGATE_MODE => get_string('aggregatemode', 'grades'),
GRADE_AGGREGATE_SUM => get_string('aggregatesum', 'grades'));
- $script = "window.location='index.php?id={$params['id']}&category={$category->id}&aggregationtype='+this.value";
+ $visible = explode(',', $CFG->grade_aggregations_visible);
+ foreach ($options as $constant => $string) {
+ if (!in_array($constant, $visible) && $constant != $category->aggregation) {
+ unset($options[$constant]);
+ }
+ }
+
+ $script = "window.location='index.php?id={$params['id']}&category={$category->id}&aggregationtype='+this.value+'&sesskey=" . sesskey()."';";
$aggregation = choose_from_menu($options, 'aggregation_'.$category->id, $category->aggregation, get_string('choose'), $script, 0, true);
if ($this->forced) {
}
}
-class grade_edit_tree_column_weightorextracredit extends grade_edit_tree_column {
+class grade_edit_tree_column_extracredit extends grade_edit_tree_column {
+
+ public function get_header_cell() {
+ return '<th class="header" scope="col">'.get_string('extracredit', 'grades').helpbutton('aggregationcoefextra', 'aggregationcoefextra', 'grade', true, false, '', true).'</th>';
+ }
+
+ public function get_category_cell($category, $levelclass, $params) {
+
+ $item = $category->get_grade_item();
+ $aggcoef_input = grade_edit_tree::get_weight_input($item, 'extra');
+ return '<td class="cell '.$levelclass.'">' . $aggcoef_input . '</td>';
+ }
+
+ public function get_item_cell($item, $params) {
+ if (empty($params['element'])) {
+ throw new Exception('Array key (element) missing from 2nd param of grade_edit_tree_column_weightorextracredit::get_item_cell($item, $params)');
+ }
+
+ $html = '<td class="cell">';
+
+ if (!in_array($params['element']['object']->itemtype, array('courseitem', 'categoryitem', 'category'))) {
+ $html .= grade_edit_tree::get_weight_input($item, 'extra');
+ }
+
+ return $html.'</td>';
+ }
+
+ public function is_hidden($mode='simple') {
+ global $CFG;
+ if ($mode == 'simple') {
+ return strstr($CFG->grade_item_advanced, 'aggregationcoef');
+ } elseif ($mode == 'advanced') {
+ return false;
+ }
+ }
+}
+
+class grade_edit_tree_column_weight extends grade_edit_tree_column {
public function get_header_cell() {
- return '<th class="header" scope="col">'.get_string('weightorextracredit', 'grades').helpbutton('aggregationcoefweight', 'aggregationcoefweight', 'grade', true, false, '', true).'</th>';
+ return '<th class="header" scope="col">'.get_string('weightuc', 'grades').helpbutton('aggregationcoefweight', 'aggregationcoefweight', 'grade', true, false, '', true).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
$item = $category->get_grade_item();
- $aggcoef_input = grade_edit_tree::get_weight_input($item);
+ $aggcoef_input = grade_edit_tree::get_weight_input($item, 'weight');
return '<td class="cell '.$levelclass.'">' . $aggcoef_input . '</td>';
}
$html = '<td class="cell">';
if (!in_array($params['element']['object']->itemtype, array('courseitem', 'categoryitem', 'category'))) {
- $html .= grade_edit_tree::get_weight_input($item);
+ $html .= grade_edit_tree::get_weight_input($item, 'weight');
}
return $html.'</td>';
$aggregateonlygraded = ($category->aggregateonlygraded) ? get_string('yes') : get_string('no');
}
- return '<td class="cell '.$levelclass.'">' . $aggregateonlygraded . '</td>';
+ return '<td class="cell '.$levelclass.'">' . $aggregateonlygraded . $hidden.'</td>';
}
public function get_item_cell($item, $params) {
if (!empty($features['updategradesonly'])) {
$mform->addElement('advcheckbox', 'updatedgradesonly', get_string('updatedgradesonly', 'grades'));
}
-
/// selections for decimal points and format, MDL-11667, defaults to site settings, if set
//$default_gradedisplaytype = $CFG->grade_export_displaytype;
$options = array(GRADE_DISPLAY_TYPE_REAL => get_string('real', 'grades'),
*
* @return string HTML code or nothing if $return == false
*/
-function print_grade_page_head($courseid, $active_type, $active_plugin=null, $heading = false, $return=false, $bodytags='', $buttons=false) {
+function print_grade_page_head($courseid, $active_type, $active_plugin=null, $heading = false, $return=false, $bodytags='', $buttons=false, $extracss=array()) {
global $CFG, $COURSE;
$strgrades = get_string('grades');
$plugin_info = grade_get_plugin_info($courseid, $active_type, $active_plugin);
$CFG->stylesheets[] = $CFG->wwwroot . '/grade/report/styles.css';
}
+ foreach ($extracss as $css_url) {
+ $CFG->stylesheets[] = $css_url;
+ }
+
$navlinks[] = array('name' => $strgrades,
'link' => $first_link,
'type' => 'misc');
}
$object = $element['object'];
- $overlib = '';
switch ($element['type']) {
case 'item':
$url = $gpr->add_url_params($url);
if (!empty($object->feedback)) {
$feedback = addslashes_js(trim(format_string($object->feedback, $object->feedbackformat)));
- $function = "return overlib('$feedback', BORDER, 0, FGCLASS, 'feedback', "
- ."CAPTIONFONTCLASS, 'caption', CAPTION, '$strfeedback');";
- $overlib = 'onmouseover="'.s($function).'" onmouseout="return nd();"';
}
break;
}
if ($url) {
- return '<a href="'.$url.'" class="edit"><img '.$overlib.' src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'.$stredit.'" title="'.$stredit.'"/></a>';
+ return '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'.$stredit.'" title="'.$stredit.'"/></a>';
} else {
return '';
}
$columncount = 0;
- // Student name and link
- $user_pic = null;
- if ($showuserimage) {
- $user_pic = '<div class="userpic">' . print_user_picture($user, $this->courseid, true, 0, true) . '</div>';
- }
if ($fixedstudents) {
$studentrowhtml .= '<tr class="r'.$this->rowcount++ . $row_classes[$this->rowcount % 2] . '">';
} else {
+ // Student name and link
+ $user_pic = null;
+ if ($showuserimage) {
+ $user_pic = '<div class="userpic">' . print_user_picture($user, $this->courseid, true, 0, true) . '</div>';
+ }
+
$studentrowhtml .= '<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.'&course='.$this->course->id.'">'
$eid = $this->gtree->get_grade_eid($grade);
$element = array('eid'=>$eid, 'object'=>$grade, 'type'=>'grade');
- $cellclasses = 'ajax cell c'.$columncount++;
+ $cellclasses = 'grade ajax cell c'.$columncount++;
if ($item->is_category_item()) {
$cellclasses .= ' cat';
}
$cellclasses .= ' excluded';
}
- $gradecellhtml .= "<td id=\"gradecell_u$userid-i$itemid\" class=\"$cellclasses\">";
+ $grade_title = '<div class="fullname">'.fullname($user).'</div>';
+ $grade_title .= '<div class="itemname">'.$item->get_name(true).'</div>';
+
+ if (!empty($grade->feedback) && !$USER->gradeediting[$this->courseid]) {
+ $grade_title .= '<div class="feedback">'
+ .wordwrap(trim(format_string($grade->feedback, $grade->feedbackformat)), 34, '<br/ >') . '</div>';
+ }
+
+ $gradecellhtml .= "<td id=\"gradecell_u$userid-i$itemid\" class=\"$cellclasses\" title=\"$grade_title\">";
if ($grade->is_excluded()) {
$gradecellhtml .= get_string('excluded', 'grades') . ' ';
$feedback = s($grade->feedback);
$anchor_id = "gradefeedback_$userid-i$itemid";
+ $gradecellhtml .= '<a ';
if (empty($feedback)) {
$feedback = get_string('addfeedback', 'grades');
- $gradecellhtml .= '<a ';
- } else {
- $overlib = '';
- $full_feedback = addslashes_js(trim(format_string($grade->feedback, $grade->feedbackformat)));
- $overlib = "return overlib('$full_feedback', BORDER, 0, FGCLASS, 'feedback', "
- ."CAPTIONFONTCLASS, 'caption', CAPTION, '$strfeedback');";
- $gradecellhtml .= '<a onmouseover="'.s($overlib).'" onmouseout="return nd();" ';
}
$feedback_tabindex = $nexttabindex + $this->numusers;
} else { // Not editing
$gradedisplaytype = $item->get_displaytype();
- // If feedback present, surround grade with feedback tooltip: Open span here
- if (!empty($grade->feedback)) {
- $overlib = '';
- $feedback = addslashes_js(trim(format_string($grade->feedback, $grade->feedbackformat)));
- $overlib = "return overlib('$feedback', BORDER, 0, FGCLASS, 'feedback', "
- ."CAPTIONFONTCLASS, 'caption', CAPTION, '$strfeedback');";
- $gradecellhtml .= '<span onmouseover="'.s($overlib).'" onmouseout="return nd();">';
- }
-
if ($item->needsupdate) {
$gradecellhtml .= '<span class="gradingerror'.$hidden.$gradepass.'">'.get_string('error').'</span>';
// Initialise the grader report object
$report = new grade_report_grader($courseid, $gpr, $context, $page, $sortitemid);
+require_js(array('yui_yahoo', 'yui_dom', 'yui_event', 'yui_container', 'yui_connection', 'yui_dragdrop', 'yui_element', 'yui_json'));
if ($report->get_pref('enableajax')) {
$report = new grade_report_grader_ajax($courseid, $gpr, $context, $page, $sortitemid);
- require_js(array('yui_yahoo', 'yui_dom', 'yui_event', 'yui_json', 'yui_connection', 'yui_dragdrop', 'yui_treeview', 'yui_element'));
}
/// processing posted grades & feedback here
/// Print header
$reportname = get_string('modulename', 'gradereport_grader');
-print_grade_page_head($COURSE->id, 'report', 'grader', $reportname, false, null, $buttons);
+print_grade_page_head($COURSE->id, 'report', 'grader', $reportname, false, null, $buttons, array($CFG->wwwroot . '/lib/yui/container/assets/skins/sam/container.css'));
echo $report->group_selector;
echo '<div class="clearer"></div>';
print_paging_bar($numusers, $report->page, $studentsperpage, $report->pbarurl);
}
-
$reporthtml = '<script src="functions.js" type="text/javascript"></script>';
$reporthtml .= '<div class="gradeparent">';
-
$reporthtml .= $report->get_studentnameshtml();
$reporthtml .= $report->get_headerhtml();
$reporthtml .= $report->get_iconshtml();
require_once 'ajax.php';
}
+// Print YUI tooltip code
+?>
+<script type="text/javascript">
+
+YAHOO.namespace("graderreport");
+
+YAHOO.graderreport.init = function() {
+ // Get all <td> with class grade
+ var cells = YAHOO.util.Dom.getElementsByClassName('grade', 'td');
+ YAHOO.graderreport.tooltips = new Array(cells.length);
+
+ for (var i = 0; i < cells.length; i++) {
+ YAHOO.graderreport.tooltips[i] = new YAHOO.widget.Tooltip("tt"+i, { context: cells[i], autodismissdelay: 10000000 });
+ }
+};
+YAHOO.util.Event.onDOMReady(YAHOO.graderreport.init);
+
+</script>
+<?php
+
print_footer($course);
?>
* */
public $canviewhidden;
+ var $preferences_page=false;
+
/**
* Constructor. Sets local copies of user preferences and initialises grade_tree.
* @param int $courseid
// Warn if the grade is out of bounds.
if (is_null($finalgrade)) {
// ok
- } else if ($finalgrade < $grade_item->grademin) {
+ } else {
+ $bounded = $grade_item->bounded_grade($finalgrade);
+ if ($bounded > $finalgrade) {
$errorstr = 'lessthanmin';
- } else if ($finalgrade > $grade_item->grademax) {
- $errorstr = 'morethanmax';
+ } else if ($bounded < $finalgrade) {
+ $errorstr = 'morethanmax';
+ }
}
if ($errorstr) {
$user = $DB->get_record('user', array('id' => $userid), 'id, firstname, lastname');
if (empty($trimmed)) {
$feedback = NULL;
} else {
- $feedback = $postedvalue;
+ $feedback = stripslashes($postedvalue);
}
}
$columns_to_unset = array();
-
foreach ($this->gtree->get_levels() as $key=>$row) {
$columncount = 0;
if ($key == 0) {
}
// Element is a category
else if ($type == 'category') {
- $headerhtml .= '<th class="header '. $columnclass.' category'.$catlevel.'" '.$colspan.' scope="col">'
+ $headerhtml .= '<th class=" '. $columnclass.' category'.$catlevel.'" '.$colspan.' scope="col">'
. shorten_text($element['object']->get_name());
$headerhtml .= $this->get_collapsing_icon($element);
}
$headerlink = $this->gtree->get_element_header($element, true, $this->get_pref('showactivityicons'), false);
- $headerhtml .= '<th class="header '.$columnclass.' '.$type.$catlevel.$hidden.'" scope="col" onclick="set_col(this.cellIndex)">'
+ $headerhtml .= '<th class=" '.$columnclass.' '.$type.$catlevel.$hidden.'" scope="col" onclick="set_col(this.cellIndex)">'
. shorten_text($headerlink) . $arrow;
$headerhtml .= '</th>';
}
}
$columncount = 0;
-
if ($fixedstudents) {
$studentshtml .= '<tr class="r'.$this->rowcount++ . $row_classes[$this->rowcount % 2] . '">';
} else {
}
$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
+ .'<th class="c'.$columncount++.' user" scope="row" onclick="set_row(this.parentNode.rowIndex);">'.$user_pic
.'<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->course->id.'">'
.fullname($user).'</a></th>';
if ($showuseridnumber) {
- $studentshtml .= '<th class="header c'.$columncount++.' useridnumber" onclick="set_row(this.parentNode.rowIndex);">'.
+ $studentshtml .= '<th class="c'.$columncount++.' useridnumber" onclick="set_row(this.parentNode.rowIndex);">'.
$user->idnumber.'</a></th>';
}
$eid = $this->gtree->get_grade_eid($grade);
$element = array('eid'=>$eid, 'object'=>$grade, 'type'=>'grade');
- $cellclasses = 'cell c'.$columncount++;
+ $cellclasses = 'grade cell c'.$columncount++;
if ($item->is_category_item()) {
$cellclasses .= ' cat';
}
// $cellclasses .= ' excluded';
}
- $studentshtml .= '<td class="'.$cellclasses.'">';
+ $grade_title = '<div class="fullname">'.fullname($user).'</div>';
+ $grade_title .= '<div class="itemname">'.$item->get_name(true).'</div>';
+
+ if (!empty($grade->feedback) && !$USER->gradeediting[$this->courseid]) {
+ $grade_title .= '<div class="feedback">'
+ .wordwrap(trim(format_string($grade->feedback, $grade->feedbackformat)), 34, '<br/ >') . '</div>';
+ } else {
+
+ }
+
+ $studentshtml .= '<td class="'.$cellclasses.'" title="'.$grade_title.'">';
if ($grade->is_excluded()) {
$studentshtml .= '<span class="excludedfloater">'.get_string('excluded', 'grades') . '</span> ';
if ($gradeval < 1) {
$studentshtml .= '<span class="gradevalue'.$hidden.$gradepass.'">-</span>';
} else {
- $gradeval = (int)bounded_number($grade->grade_item->grademin, $gradeval, $grade->grade_item->grademax); //just in case somebody changes scale
+ $gradeval = $grade->grade_item->bounded_grade($gradeval); //just in case somebody changes scale
$studentshtml .= '<span class="gradevalue'.$hidden.$gradepass.'">'.$scales[$gradeval-1].'</span>';
}
} else {
$gradedisplaytype = $item->get_displaytype();
// If feedback present, surround grade with feedback tooltip: Open span here
- if (!empty($grade->feedback)) {
- $overlib = '';
- $feedback = addslashes_js(trim(format_string($grade->feedback, $grade->feedbackformat)));
- $overlib = "return overlib('$feedback', BORDER, 0, FGCLASS, 'feedback', "
- ."CAPTIONFONTCLASS, 'caption', CAPTION, '$strfeedback');";
- $studentshtml .= '<span onmouseover="'.s($overlib).'" onmouseout="return nd();">';
- }
if ($item->needsupdate) {
$studentshtml .= '<span class="gradingerror'.$hidden.$gradepass.'">'.get_string('error').'</span>';
}
$studentshtml .= '<tr class="r'.$this->rowcount++ . $row_classes[$this->rowcount % 2] . '">'
- .'<th class="header c0 user" scope="row" onclick="set_row(this.parentNode.rowIndex);">'.$user_pic
+ .'<th class="c0 user" scope="row" onclick="set_row(this.parentNode.rowIndex);">'.$user_pic
.'<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->course->id.'">'
.fullname($user)."</a></th>\n";
$ungraded_counts = $DB->get_records_sql($SQL, $params);
+ $fixedstudents = empty($USER->screenreader) && $CFG->grade_report_fixedstudents;
+ if (!$fixedstudents) {
+ $colspan='';
+ if ($this->get_pref('showuseridnumber')) {
+ $colspan = 'colspan="2" ';
+ }
+ $avghtml .= '<th class="header c0 range "'.$colspan.' scope="row">'.$straverage.'</th>';
+ }
+
foreach ($this->gtree->items as $itemid=>$unused) {
$item =& $this->gtree->items[$itemid];
* @return string HTML
*/
public function get_rangehtml() {
- global $USER;
+ global $CFG, $USER;
- $scalehtml = '';
+ $rangehtml = '';
if ($this->get_pref('showranges')) {
$rangesdisplaytype = $this->get_pref('rangesdisplaytype');
$rangesdecimalpoints = $this->get_pref('rangesdecimalpoints');
$columncount=0;
- $scalehtml = '<tr class="range r'.$this->rowcount++.' heading">';
+ $rangehtml = '<tr class="range r'.$this->rowcount++.' heading">';
+ $fixedstudents = empty($USER->screenreader) && $CFG->grade_report_fixedstudents;
+ if (!$fixedstudents) {
+ $colspan='';
+ if ($this->get_pref('showuseridnumber')) {
+ $colspan = 'colspan="2" ';
+ }
+ $rangehtml .= '<th class="header c0 range "'.$colspan.' scope="row">'.$this->get_lang_string('range','grades').'</th>';
+ }
foreach ($this->gtree->items as $itemid=>$unused) {
$item =& $this->gtree->items[$itemid];
$formatted_range = $item->get_formatted_range($rangesdisplaytype, $rangesdecimalpoints);
- $scalehtml .= '<th class="header c'.$columncount++.' range"><span class="rangevalues'.$hidden.'">'. $formatted_range .'</span></th>';
+ $rangehtml .= '<th class="header c'.$columncount++.' range"><span class="rangevalues'.$hidden.'">'. $formatted_range .'</span></th>';
}
- $scalehtml .= '</tr>';
+ $rangehtml .= '</tr>';
}
- return $scalehtml;
+ return $rangehtml;
}
/**
redirect($CFG->wwwroot . '/grade/report/grader/index.php?id='.$courseid);
}
-
print_grade_page_head($courseid, 'preferences', 'grader', get_string('preferences', 'gradereport_grader'));
// If USER has admin capability, print a link to the site config page for this report
.flexible th {
- white-space:normal;
+white-space:normal;
}
.gradestable th.user img {
- width: 20px;
- height: 20px;
+width:20px;
+height:20px;
}
-.gradestable th.user, .gradestable th.range {
- white-space: nowrap;
-}
-
-.grade-report-grader table#user-grades .catlevel1 {
- background-color: #ffffff;
-}
.grade-report-grader table#user-grades .catlevel2 {
- background-color: #eeeeee;
-}
-.grade-report-grader table#user-grades .catlevel3 {
- background-color: #dddddd;
+background-color:#f9f9f9;
}
.grade-report-grader table#user-grades td.overridden {
- background-color: #EFD9B3;
+background-color:#ddd;
}
.grade-report-grader table#user-grades tr.avg td.cell {
- background-color: #efefff;
+background-color:#efefff;
+font-weight:700;
+color:#00008B;
}
.grade-report-grader table#user-grades tr.odd td.cell {
- background-color: #efefef;
- white-space: nowrap;
+background-color:#efefef;
+white-space:nowrap;
}
.grade-report-grader table#user-grades tr.even td.overridden {
- background-color: #F3E4C0;
+background-color:#F3E4C0;
}
.grade-report-grader table#user-grades tr.odd td.overridden {
- background-color: #EFD9A4;
+background-color:#EFD9A4;
}
.grade-report-grader table#user-grades tr.even td.excluded {
- background-color: #EABFFF;
+background-color:#EABFFF;
}
.grade-report-grader table#user-grades tr.odd td.excluded {
- background-color: #E5AFFF;
+background-color:#E5AFFF;
}
.grade-report-grader table#user-grades tr.odd th.header {
- background-color: #efefef;
- background-image: none;
-}
-
-.grade-report-grader table#user-grades td.vmarked, .grade-report-grader table#user-grades tr.odd td.vmarked {
- background-color: #ffcc33;
-}
-
-.grade-report-grader table#user-grades td.hmarked, .grade-report-grader table#user-grades tr.odd td.hmarked {
- background-color: #ffff99;
-}
-
-.grade-report-grader table#user-grades td.hmarked.vmarked, .grade-report-grader table#user-grades tr.odd td.hmarked.vmarked{
- background-color: #ffcc99;
+background-color:#efefef;
+background-image:none;
}
.grade-report-grader table#user-grades tr.groupavg td.cell {
- background-color: #efffef;
+background-color:#efffef;
+font-weight:700;
+color:#006400;
}
-.grade-report-grader table#user-grades tr.groupavg td.cell {
- font-weight: bold;
- color: #006400;
-}
-
-.grade-report-grader table#user-grades tr.avg td.cell {
- font-weight: bold;
- color: #00008B;
-}
-
-.grade-report-grader table#user-grades td.cat,
-.grade-report-grader table#user-grades td.course {
- font-weight: bold;
+.grade-report-grader table#user-grades td.cat,.grade-report-grader table#user-grades td.course {
+font-weight:700;
}
.grade-report-grader table#user-grades {
- font-size: 80%;
-}
-
-.grade-report-grader table#user-grades {
- border-width:1px;
- border-style:solid;
- margin-top: 20px;
+font-size:10px;
+width:auto;
+background-color:transparent;
+border-style:solid;
+border-width:1px;
+margin:20px 0 0;
}
.grade-report-grader #overDiv table {
- margin: 0;
+margin:0;
}
.grade-report-grader #overDiv table td.feedback {
- border: 0px;
+border:0;
}
+
.grade-report-grader #overDiv .feedback {
- background-color: #AABBFF;
- color: #000000;
- font-family: Verdana;
- font-size: 70%;
- font-weight: normal;
+font-size:70%;
+background-color:#ABF;
+color:#000;
+font-family:Verdana;
+font-weight:400;
}
.grade-report-grader #overDiv .caption {
- background-color: #5566CC;
- color: #CCCCFF;
- font-family: Arial;
- font-size: 70%;
- font-weight: bold;
+font-size:70%;
+background-color:#56C;
+color:#CCF;
+font-family:Arial;
+font-weight:700;
}
-.grade-report-grader div.submit {
- margin-top: 20px;
- text-align: center;
+.grade-report-grader #overDiv .intersection {
+font-size:70%;
+background-color:#ABF;
+color:#000;
+font-family:Verdana;
+font-weight:400;
}
-.grade-report-grader table#user-grades td {
- border-width:1px;
- border-style:solid;
+.grade-report-grader #overDiv .intersectioncaption {
+background-color:#56C;
+color:#CCF;
+font-family:Arial;
+font-weight:700;
}
-
-.grade-report-grader table#user-grades tr.heading {
- border-width:0px 0px 0px 0px;
- border-style:solid;
+.grade-report-grader div.submit {
+margin-top:20px;
+text-align:center;
}
-.grade-report-grader table#user-grades .heading td {
- border-width:0px 0px 0px 0px;
- border-style:solid;
+.grade-report-grader table#user-grades td {
+text-align:right;
+border-style:solid;
+border-width:0 1px 1px 0;
}
.grade-report-grader table#user-grades th.category {
- border-width:1px 1px 0px 1px;
- border-style:solid;
- vertical-align: top;
+vertical-align:top;
+border-style:solid;
+border-width:1px 1px 0;
}
.grade-report-grader table#user-grades th.user {
- border-width:0px 0px 1px 0px;
- border-style:solid;
+text-align:left;
+border-style:solid;
+border-width:0 0 1px;
}
.grade-report-grader table#user-grades th.useridnumber {
- border-width:0px 0px 1px 1px;
- border-style:solid;
+border-style:solid;
+border-width:0 0 1px 1px;
+}
+
+.grade-report-grader table#user-grades th.categoryitem,.grade-report-grader table#user-grades th.courseitem,.grade-report-grader table#user-grades td.topleft {
+vertical-align:top;
+border-style:solid;
+border-width:0 1px;
}
+.grade-report-grader table#user-grades th.category,
+.grade-report-grader table#user-grades th.item,
.grade-report-grader table#user-grades th.categoryitem,
-.grade-report-grader table#user-grades th.courseitem,
-.grade-report-grader table#user-grades td.topleft {
- border-width:0px 1px 0px 1px;
- border-style:solid;
- vertical-align: top;
+.grade-report-grader table#user-grades th.courseitem {
+height: 25px;
+}
+
+.grade-report-grader td,.grade-report-grader th {
+border-color:#CECECE;
}
.grade-report-grader table#participants th {
- vertical-align: top;
+vertical-align:top;
+width:auto;
}
.grade-report-grader table#user-grades td.fillerfirst {
- border-width:0px 0px 0px 1px;
- border-style:solid;
+border-style:solid;
+border-width:0 0 0 1px;
}
.grade-report-grader table#user-grades td.fillerlast {
- border-width:0px 1px 0px 0px;
- border-style:solid;
+border-style:solid;
+border-width:0 1px 0 0;
}
-.grade-report-grader table#user-grades th.item {
- border-width:1px 1px 1px 1px;
- border-style:solid;
- vertical-align: top;
+.grade-report-grader table#user-grades th.item ,
+.grade-report-grader table#user-grades th.categoryitem ,
+.grade-report-grader table#user-grades th.courseitem {
+border-bottom-color:#000;
+vertical-align:top;
+border-style:solid;
+border-width:1px;
}
.grade-report-grader div.gradertoggle {
- display: inline;
- margin-left: 20px;
-}
-
-.grade-report-grader table#user-grades {
- margin-left:auto;
- margin-right:auto;
-}
-
-.grade-report-grader table#user-grades th.user {
- text-align:left;
-}
-
-.grade-report-grader table#user-grades td.useridnumber {
- text-align:left;
-}
-
-.grade-report-grader table#user-grades td {
- text-align:right;
+display:inline;
+margin-left:20px;
}
.grade-report-grader table#user-grades th.range {
- border-width:1px 1px 1px 1px;
- border-style:solid;
+text-align:right;
+border-style:solid;
+border-width:1px;
}
.grade-report-grader table#user-grades .userpic {
- display: inline;
- margin-right: 10px;
+display:inline;
+margin-right:10px;
}
.grade-report-grader table#user-grades .quickfeedback {
- border: #000000 1px dashed;
+border:#000 1px dashed;
}
.grade-report-grader #siteconfiglink {
- text-align: right;
+text-align:right;
}
-.grade-report-grader table#user-grades .hidden,
-.grade-report-grader table#user-grades .hidden a {
- color:#aaaaaa;
+.grade-report-grader table#user-grades .hidden,.grade-report-grader table#user-grades .hidden a {
+color:#aaa;
}
.grade-report-grader table#user-grades .datesubmitted {
- font-size: 0.7em;
+font-size:.7em;
}
.grade-report-grader table#user-grades td.cell {
- padding-left: 5px;
- padding-right: 5px;
+padding-left:5px;
+padding-right:5px;
+vertical-align:middle;
}
-/**
- * Author: Robert Russo
- */
-
.grade-report-grader table {
- border-collapse: collapse;
- background-color: #ffffff;
- font-size: 10px;
- border-color: #cecece;
-}
-
-
-.grade-report-grader .r1 {
- background-color: #ffffff;
-}
-
-.grade-report-grader .flexible th, .grade-report-grader .flexible td {
- white-space: nowrap;
-}
-
-.grade-report-grader .flexible th a, .grade-report-grader .flexible td a {
- white-space: nowrap;
+border-collapse:collapse;
+background-color:#fff;
+font-size:10px;
+border-color:#cecece;
}
.grade-report-grader th {
- padding: 10px;
+padding:2px 10px 0;
}
.grade-report-grader span.inclusion-links {
- margin: 0 5px 0 10px;
-}
-
-.grade-report-grader .gradestable th.user, .grade-report-grader .gradestable th.range, .grade-report-grader td {
- white-space: nowrap;
-}
-
-.grade-report-grader table#user-grades .catlevel1 {
- background-color: #ffffff;
-}
-
-.grade-report-grader table#user-grades .catlevel2 {
- background-color: #f9f9f9;
-}
-
-.grade-report-grader table#user-grades .catlevel3 {
- background-color: #efefef;
+margin:0 5px 0 10px;
}
.grade-report-grader table#user-grades .item {
- background-color: #e9e9e9;
-}
-
-.grade-report-grader table#user-grades td.overridden {
- background-color: #dddddd;
-}
-
-.grade-report-grader table tr.odd td.cell {
- background-color: #efefef;
-}
-
-.grade-report-grader table tr.even td.cell {
- background-color: #ffffff;
-}
-
-.grade-report-grader table tr.even th {
- background-color: #ffffff;
+background-color:#e9e9e9;
}
.grade-report-grader table tr.odd th.header {
- background-color: #efefef;
- border-width: 0px 0px 1px 0px;
- background-image: none;
+background-color:#efefef;
+background-image:none;
+border-width:0 0 1px;
}
.grade-report-grader table tr.heading th.header {
- border-top: 1px solid #cecece;
-}
-
-.grade-report-grader table#user-grades tr.heading th.categoryitem,
-.grade-report-grader table#user-grades tr.heading th.courseitem {
- border-width: 0px 0px 0px 1px;
-}
-
-.grade-report-grader table#user-grades td.vmarked, .grade-report-grader table#user-grades tr.odd td.vmarked {
- background-color: #ffcc33;
-}
-
-.grade-report-grader table#user-grades td.hmarked, .grade-report-grader table#user-grades tr.odd td.hmarked {
- background-color: #ffff99;
-}
-
-.grade-report-grader table#user-grades td.hmarked.vmarked, .grade-report-grader table#user-grades tr.odd td.hmarked.vmarked{
- background-color: #ffcc99;
-}
-
-.grade-report-grader table tr.avg td.cell {
-background-color: #f3ead8;
-}
-
-.grade-report-grader table#user-grades tr.groupavg td.cell {
- font-weight: bold;
- color: #006400;
-}
-
-.grade-report-grader table#user-grades tr.avg td.cell {
- font-weight: bold;
- color: #00008B;
-}
-
-.grade-report-grader table#user-grades td.cat,
-.grade-report-grader table#user-grades td.course {
- font-weight: bold;
-}
-
-.grade-report-grader table#user-grades {
- border-width: 1px;
- border-style: solid;
- font-size: 10px;
- margin: 0;
- margin-top: 20px;
- width: auto;
- background-color: transparent;
-}
-
-.grade-report-grader #overDiv table {
- margin: 0;
-}
-
-.grade-report-grader #overDiv table td.feedback {
- border: 0px;
-}
-.grade-report-grader #overDiv .feedback {
- background-color: #AABBFF;
- color: #000000;
- font-family: Verdana;
- font-weight: normal;
-}
-
-.grade-report-grader #overDiv .caption {
- background-color: #5566CC;
- color: #CCCCFF;
- font-family: Arial;
- font-weight: bold;
-}
-
-.grade-report-grader div.submit {
- margin-top: 20px;
- text-align: center;
-}
-
-.grade-report-grader table#user-grades td {
- border-width: 0px 1px 1px 0px;
- border-style:solid;
-}
-
-.grade-report-grader table#user-grades tr.heading {
- border-width:0px 0px 0px 0px;
- border-style:solid;
+border-top:1px solid #cecece;
}
-.grade-report-grader table#user-grades .heading td {
- border-width:0px 0px 0px 0px;
- border-style:solid;
-}
-
-.grade-report-grader table#user-grades th.category {
- border-width:1px 1px 0px 1px;
- border-style:solid;
- vertical-align: top;
+.grade-report-grader table#user-grades tr.heading th.categoryitem,.grade-report-grader table#user-grades tr.heading th.courseitem {
+border-width:0 0 0 1px;
}
.grade-report-grader table#user-grades th.category.header.catlevel1 {
- border-width: 1px 1px 0px 0px;
- border-style:solid;
- vertical-align: top;
-}
-
-.grade-report-grader table#user-grades th.user {
- border-width:0px 0px 1px 0px;
- border-style:solid;
-}
-
-.grade-report-grader table#user-grades th.useridnumber {
- border-width:0px 0px 1px 1px;
- border-style:solid;
-}
-
-.grade-report-grader div.left_scroller tr {
- height: 4em;
- font-size: 10px;
-}
-
-.grade-report-grader div.right_scroller tr {
- height: 4em;
- font-size: 10px;
-}
-
-.grade-report-grader div.left_scroller td {
- height: 4em;
- font-size: 10px;
-}
-
-.grade-report-grader div.right_scroller td {
- height: 4em;
- font-size: 10px;
-}
-
-.grade-report-grader div.left_scroller th {
- height: 4em;
- font-size: 10px;
+vertical-align:top;
+border-style:solid;
+border-width:1px 1px 0 0;
}
.grade-report-grader div.left_scroller th.user a {
- vertical-align: middle;
- margin: 0;
- padding: 0;
+vertical-align:middle;
+margin:0;
+padding:0;
}
-.grade-report-grader div.right_scroller th {
- height: 4em;
- font-size: 10px;
+.grade-report-grader table#user-grades th.categoryitem,.grade-report-grader table#user-grades th.courseitem,.grade-report-grader table td.topleft {
+vertical-align:top;
+border-color:#cecece #cecece #000;
+border-style:solid;
+border-width:0 1px 1px;
}
-.grade-report-grader table#user-grades th.categoryitem,
-.grade-report-grader table#user-grades th.courseitem,
.grade-report-grader table td.topleft {
- border-width: 0px 1px 1px 1px;
- border-style: solid;
- border-color: #cecece;
- vertical-align: top;
+border-bottom:none;
}
.grade-report-grader table#user-grades td.topleft {
- background-color: transparent;
-}
-
-.grade-report-grader table#participants th {
- vertical-align: top;
- width: auto;
-}
-
-.grade-report-grader table#user-grades td.fillerfirst {
- border-width:0px 0px 0px 1px;
- border-style:solid;
-}
-
-.grade-report-grader table#user-grades td.fillerlast {
- border-width:0px 1px 0px 0px;
- border-style:solid;
-}
-
-.grade-report-grader table#user-grades th.item {
- border-width:1px 1px 1px 1px;
- border-style:solid;
- vertical-align: top;
-}
-
-.grade-report-grader div.gradertoggle {
- display: inline;
- margin-left: 20px;
-}
-
-.grade-report-grader table#user-grades th {
- text-align: left;
-}
-
-.grade-report-grader table th.user {
- text-align: left;
- vertical-align: middle;
-}
-
-.grade-report-grader table td.useridnumber {
- text-align:left;
- vertical-align: middle;
-}
-
-.grade-report-grader table#user-grades td {
- text-align: right;
-}
-
-.grade-report-grader table#user-grades th.range {
- border-width:1px 1px 1px 1px;
- border-style:solid;
- text-align: right;
+background-color:#fff;
}
.grade-report-grader div.userpic {
- margin-right: 10px;
- float: left;
+margin-right:10px;
+float:left;
}
.grade-report-grader div.userpic img {
- border: 3px double #cecece;
- vertical-align: middle;
- width: 2.7em;
- height: 2.7em;
-}
-
-
-.grade-report-grader table#user-grades .quickfeedback {
- border: #000000 1px dashed;
-}
-
-.grade-report-grader #siteconfiglink {
- text-align: right;
-}
-
-.grade-report-grader table#user-grades .hidden,
-.grade-report-grader table#user-grades .hidden a {
- color:#aaaaaa;
-}
-
-.grade-report-grader table#user-grades .datesubmitted {
- font-size: 0.7em;
-}
-
-.grade-report-grader table#user-grades td.controls {
- background-color: #f3ead8;
-}
-
-.grade-report-grader table#user-grades td.cell {
- padding-left: 5px;
- padding-right: 5px;
- vertical-align: middle;
+border:3px double #cecece;
+vertical-align:middle;
+width:2.7em;
+height:2.7em;
}
.grade-report-grader a.quickedit {
- line-height: 1em;
- display: block;
- float: right;
- margin: .1em 0 0 0;
- clear: none;
- font-size: 9px;
- background-color: transparent;
+line-height:1em;
+display:block;
+float:right;
+clear:none;
+font-size:9px;
+background-color:transparent;
+margin:.1em 0 0;
}
.grade-report-grader a.quickedit2 {
- display: block;
- float: right;
- margin: 1.3em 0 0 0;
- clear: none;
- background-color: transparent;
+display:block;
+float:right;
+clear:none;
+background-color:transparent;
+margin:1.3em 0 0;
}
.grade-report-grader table#quick_edit {
- margin: 0 auto 0 auto;
- border: 1px solid #cecece;
+border:1px solid #cecece;
+margin:0 auto;
}
.grade-report-grader table#quick_edit td {
- vertical-align: middle;
- padding: 0;
- margin: 0;
- border: 1px solid #cecece;
- text-align: left;
+vertical-align:middle;
+border:1px solid #cecece;
+text-align:left;
+margin:0;
+padding:5px;
}
.grade-report-grader table#quick_edit td img {
- border: 3px double #cecece;
- padding: 0;
- vertical-align: middle;
+border:3px double #cecece;
+vertical-align:middle;
+padding:0;
}
.grade-report-grader td input {
- border: 1px solid #666666;
- margin-left: 10px;
- margin-right: 10px;
-}
-
-.grade-report-grader table#quick_edit td {
- padding: 5px;
- padding-top: 5px;
- padding-bottom: 5px;
+border:1px solid #666;
+margin-left:10px;
+margin-right:10px;
}
.grade-report-grader table#quick_edit td.fullname {
-border-left: none;
-padding-left: 5px;
+border-left:none;
+padding-left:5px;
}
.grade-report-grader table#quick_edit td.picture {
-border-right: none;
+border-right:none;
}
.grade-report-grader table#quick_edit td.finalgrade input {
-width: 5em;
+width:5em;
}
.grade-report-grader h1 {
- text-align: center;
- clear: both;
+text-align:center;
+clear:both;
}
.grade-report-grader form {
-text-align: center;
+text-align:center;
}
.grade-report-grader input.center {
- margin: 10px auto 0 auto;
+margin:10px auto 0;
}
.grade-report-grader .lefttbody {
- width: auto;
- vertical-align: middle;
+width:auto;
+vertical-align:middle;
}
.grade-report-grader table#user-grades th.fixedcolumn {
- border: 1px solid #cecece;
- vertical-align: middle;
+border:1px solid #cecece;
+vertical-align:middle;
}
.grade-report-grader table#fixed_column th {
- border: 1px solid #cecece;
- vertical-align: middle;
+border:1px solid #cecece;
+vertical-align:middle;
+border-right-color:#000;
}
.grade-report-grader table#fixed_column {
- padding-top: 20px;
- border-top: 1px solid #cecece;
- background-color: #ffffff;
+padding-top:20px;
+border-top:1px solid #cecece;
+background-color:#fff;
}
.grade-report-grader .left_scroller {
- float: left;
- clear: none;
- padding-top: 20px;
+float:left;
+clear:none;
+padding-top:20px;
}
.grade-report-grader .right_scroller {
- width: auto;
- clear: none;
- overflow-x: auto;
-}
-
-.grade-report-grader th {
- padding-top: 2px;
- padding-bottom: 0;
+width:auto;
+clear:none;
+overflow-x:auto;
}
-.grade-report-grader table tr.avg, .grade-report-grader table tr.groupavg td, .grade-report-grader table tr.avg td, .grade-report-grader table tr.groupavg th, .grade-report-grader table tr.avg th, .grade-report-grader table tr.controls_row, .grade-report-grader table tr.controls_row th, .grade-report-grader table tr.range_row, .grade-report-grader table tr.range_row th, div.right_scroller tr {
- height: 2em;
+.grade-report-grader table tr.avg,.grade-report-grader table tr.groupavg td,.grade-report-grader table tr.avg td,.grade-report-grader table tr.groupavg th,.grade-report-grader table tr.avg th,.grade-report-grader table tr.controls_row,.grade-report-grader table tr.controls_row th,.grade-report-grader table tr.range_row,.grade-report-grader table tr.range_row th,div.right_scroller tr {
+height:2em;
}
-.grade-report-grader table tr.avg, .grade-report-grader table tr.avg td, .grade-report-grader table tr.avg th {
-background-color: #f3ead8;
-}
-
-.grade-report-grader table#user-grades tr.groupavg td.cell, .grade-report-grader tr.groupavg th.header {
- background-color: #efffef;
-}
-
-.grade-report-grader div.gradeparent {
- text-align: left;
+.grade-report-grader table#user-grades tr.groupavg td.cell,.grade-report-grader tr.groupavg th.header {
+background-color:#efffef;
}
.grade-report-grader form td.excluded {
- color: #ff0000;
+color:red;
}
.grade-report-grader .excludedfloater {
- font-weight: bold;
- color: #ff0000;
- font-size: 9px;
- float: left;
+font-weight:700;
+color:red;
+font-size:9px;
+float:left;
}
.grade-report-grader span.gradepass {
- color: #298721;
+color:#298721;
}
.grade-report-grader span.gradefail {
- color: #890d0d;
+color:#890d0d;
}
.gradeweight {
-color: #461d7c;
-font-weight: bold;
+color:#461d7c;
+font-weight:700;
}
.grade-report-grader td select {
-font-size: 100%;
-padding: 0;
+font-size:100%;
+padding:0;
}
.grade-report-grader .righttest td select {
-font-size: 86%;
-padding: 0;
+font-size:86%;
+padding:0;
}
-.grade-report-grader tr.avg, tr.controls, td.controls, th.controls, .grade-report-grader tr.groupavg, tr.range, th.range, td.range, tr.heading th.range {
- height: 2em !important;
- white-space: nowrap;
+.grade-report-grader tr.avg,tr.controls,td.controls,th.controls,.grade-report-grader tr.groupavg,tr.range,th.range,td.range,tr.heading th.range {
+height:2em!important;
+white-space:nowrap;
}
.heading_name_row th {
- white-space: nowrap;
- width: 2000px;
+white-space:nowrap;
+width:2000px;
}
-/* IE rules */
.ie .right_scroller {
- padding-bottom: 15px;
- overflow-y: hidden;
+padding-bottom:15px;
+overflow-y:hidden;
}
.ie table#fixed_column th {
- height: 40.5px;
+height:40.5px;
}
.ie table#fixed_column tr.avg th {
- height: 21px;
+height:21px;
}
.ie div.left_scroller td {
- height: 42px;
-}
-
-/* IE6 rules */
-
-.ie6 form {
- text-align: left;
+height:42px;
}
.ie6 div.left_scroller {
- margin-top: 40px;
+margin-top:40px;
}
.ie6 div.right_scroller {
- margin-top: 40px;
- width: auto;
- position: absolute;
+margin-top:40px;
+width:auto;
+position:absolute;
}
.ie6 .excludedfloater {
- font-size: 7px;
+font-size:7px;
}
.grade_icons img.ajax {
- float: right;
+float:right;
+}
+
+.gradestable th.user,.gradestable th.range,.grade-report-grader .flexible th,.grade-report-grader .flexible td,.grade-report-grader .flexible th a,.grade-report-grader .flexible td a,.grade-report-grader .gradestable th.range,.grade-report-grader td {
+white-space:nowrap;
}
-.grade-report-grader table#user-grades td.ajax {
- text-align: left;
+.grade-report-grader table#user-grades .catlevel1,.grade-report-grader .r1,.grade-report-grader table tr.even td.cell,.grade-report-grader table tr.even th {
+background-color:#fff;
+}
+
+.grade-report-grader table#user-grades .catlevel3,.grade-report-grader table tr.odd td.cell {
+background-color:#efefef;
+}
+
+.grade-report-grader table#fixed_column tr.odd th ,
+.grade-report-grader table#user-grades tr.odd th {
+background-color:#efefef;
+}
+
+.grade-report-grader table#user-grades td.vmarked,.grade-report-grader table#user-grades tr.odd td.vmarked,.grade-report-grader table#user-grades td.vmarked,.grade-report-grader table#user-grades tr.odd td.vmarked,.grade-report-grader table#user-grades tr.even td.vmarked {
+background-color:#fc3;
+}
+
+.grade-report-grader table#user-grades td.hmarked,.grade-report-grader table#user-grades tr.odd td.hmarked,.grade-report-grader table#user-grades td.hmarked,.grade-report-grader table#user-grades tr.odd td.hmarked,.grade-report-grader table#user-grades tr.even td.hmarked {
+background-color:#ff9;
+}
+
+.grade-report-grader table#user-grades td.hmarked.vmarked,.grade-report-grader table#user-grades tr.odd td.hmarked.vmarked,.grade-report-grader table#user-grades td.hmarked.vmarked,.grade-report-grader table#user-grades tr.even td.hmarked.vmarked,.grade-report-grader table#user-grades tr.odd td.hmarked.vmarked {
+background-color:#fc9;
+}
+
+.grade-report-grader table#user-grades tr.heading,.grade-report-grader table#user-grades .heading td {
+border-style:solid;
+border-width:0;
+}
+
+.grade-report-grader table#user-grades td.useridnumber,.grade-report-grader table#user-grades th,.grade-report-grader div.gradeparent,.ie6 form,.grade-report-grader table#user-grades td.ajax {
+text-align:left;
+}
+
+.grade-report-grader table tr.avg td.cell,.grade-report-grader table#user-grades td.controls,.grade-report-grader table tr.avg,.grade-report-grader table tr.avg td,.grade-report-grader table tr.avg th {
+background-color:#f3ead8;
+}
+
+.grade-report-grader div.left_scroller tr,.grade-report-grader div.right_scroller tr,.grade-report-grader div.left_scroller td,.grade-report-grader div.right_scroller td,.grade-report-grader div.left_scroller th,.grade-report-grader div.right_scroller th {
+height:4em;
+font-size:10px;
+}
+
+.grade-report-grader table th.user,.grade-report-grader table td.useridnumber {
+text-align:left;
+vertical-align:middle;
+}
+
+.grade-report-grader .yui-overlay {
+ background-color: #FFEE69;
+ border-color: #D4C237 #A6982B #A6982B;
+ border-style: solid;
+ border-width: 1px;
+ left: 0;
+ padding: 2px 5px;
+ font-size: 0.7em;
+}
+
+.grade-report-grader .yui-overlay .fullname {
+ color: #5F3E00;
+ font-weight: bold;
+}
+.grade-report-grader .yui-overlay .itemname {
+ color: #194F3E;
+ font-weight: bold;
+}
+.grade-report-grader .yui-overlay .feedback {
+ color: #5F595E;
}
* @var array $data
* @return bool Success or Failure (array of errors).
*/
- public function process_data($data) {
+ function process_data($data) {
}
-
- public function process_action($target, $action) {
+ function process_action($target, $action) {
}
}
--- /dev/null
+#content #siteconfiglink {
+ text-align: right;
+}
+
*/
public $table;
+ var $gtree;
+
/**
* Flat structure similar to grade tree
*/
$this->showrank = grade_get_setting($this->courseid, 'report_user_showrank', $CFG->grade_report_user_showrank);
$this->showpercentage = grade_get_setting($this->courseid, 'report_user_showpercentage', $CFG->grade_report_user_showpercentage);
$this->showhiddenitems = grade_get_setting($this->courseid, 'report_user_showhiddenitems', $CFG->grade_report_user_showhiddenitems);
+
$this->showrange = true;
$this->switch = grade_get_setting($this->courseid, 'aggregationposition', $CFG->grade_aggregationposition);
$excluded = '';
$class = '';
+ // If this is a hidden grade item, hide it completely from the user. showhiddenitems: 0 = hide all, 1 = show only hidden until, 2 = show all
+ if ($grade_object->is_hidden() && !$this->canviewhidden && (
+ $this->showhiddenitems == 0 ||
+ ($this->showhiddenitems == 1 && !$grade_object->is_hiddenuntil()))) {
+ return false;
+ }
if ($type == 'category') {
$this->evenodd[$depth] = (($this->evenodd[$depth] + 1) % 2);
$hidden = ' hidden';
}
+ // If this is a hidden grade item, hide it completely from the user. showhiddenitems: 0 = hide all, 1 = show only hidden until, 2 = show all
+ if ($grade_grade->is_hidden() && !$this->canviewhidden && (
+ $this->showhiddenitems == 0 ||
+ ($this->showhiddenitems == 1 && !$grade_grade->is_hiddenuntil()))) {
+ // return false;
+ } else {
+
/// Excluded Item
if ($grade_grade->is_excluded()) {
$fullname .= ' ['.get_string('excluded', 'grades').']';
$data['grade']['class'] = $class;
$data['grade']['content'] = get_string('submittedon', 'grades', userdate($grade_grade->get_datesubmitted(), get_string('strftimedatetimeshort')));
+ } elseif ($grade_grade->is_hidden()) {
+ $data['grade']['class'] = $class.' hidden';
+ $data['grade']['content'] = '-';
} else {
$data['grade']['class'] = $class;
$data['grade']['content'] = grade_format_gradevalue($gradeval, $grade_grade->grade_item, true);
if ($grade_grade->grade_item->needsupdate) {
$data['percentage']['class'] = $class.' gradingerror';
$data['percentage']['content'] = get_string('error');
+ } elseif ($grade_grade->is_hidden()) {
+ $data['percentage']['class'] = $class.' hidden';
+ $data['percentage']['content'] = '-';
} else {
$data['percentage']['class'] = $class;
$data['percentage']['content'] = grade_format_gradevalue($gradeval, $grade_grade->grade_item, true, GRADE_DISPLAY_TYPE_PERCENTAGE);
if ($grade_grade->grade_item->needsupdate) {
$data['rank']['class'] = $class.' gradingerror';
$data['rank']['content'] = get_string('error');
+ } elseif ($grade_grade->is_hidden()) {
+ $data['rank']['class'] = $class.' hidden';
+ $data['rank']['content'] = '-';
} else if (is_null($gradeval)) {
// no grade, no rank
$data['rank']['class'] = $class;
$data['range']['content'] = $grade_grade->grade_item->get_formatted_range();
}
}
+ }
/// Category
if ($type == 'category') {
* @var array $data
* @return bool Success or Failure (array of errors).
*/
- public function process_data($data) {
+ function process_data($data) {
}
-
- public function process_action($target, $action) {
+ function process_action($target, $action) {
}
}
$string['aggregateweightedmean2'] = 'Simple weighted mean of grades';
$string['aggregation'] = 'Aggregation';
$string['aggregationcoef'] = 'Aggregation coefficient';
-$string['aggregationcoefextra'] = 'Extra credit coefficient';
-$string['aggregationcoefextrasum'] = 'Act as extra credit';
+$string['aggregationcoefextra'] = 'Extra credit';
+$string['aggregationcoefextrahelp'] = 'Extra credit for this grade item during aggregation.';
$string['aggregationcoefextrasum'] = 'Extra credit';
$string['aggregationcoefextrasumhelp'] = 'Extra credit for this grade item during aggregation.';
$string['aggregationcoefweight'] = 'Item weight';
$string['aggregationcoefweighthelp'] = 'Weight applied to all grades in this grade item during aggregation with other grade items.';
$string['aggregationhelp'] = 'Strategy used to aggregate grades across all students in a course.';
$string['aggregationposition'] = 'Aggregation position';
+$string['aggregationsvisible'] = 'Available aggregation types';
+$string['aggregationsvisiblehelp'] = 'Select all aggregation types that should be available. Hold down the Ctrl key to select multiple items.';
$string['aggregationview'] = 'Aggregation view';
$string['allgrades'] = 'All grades by category';
$string['allstudents'] = 'All students';
$string['categoryedit'] = 'Edit category';
$string['categoryname'] = 'Category name';
$string['categorytotal'] = 'Category total';
+$string['categorytotalfull'] = '$a->category total';
$string['changereportdefaults'] = 'Change report defaults';
$string['changedefaults'] = 'Change defaults';
$string['choosecategory'] = 'Select category';
$string['configshowuserimage'] = 'Whether to show the user\'s profile image next to the name in the grader report.';
$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['configunlimitedgrades'] = 'By default grades are limited by the maximum and minimum values of the grade item. Enabling this setting removes this limit, and allows grades of over 100%% to be entered directly in the gradebook. It is recommended that this setting is enabled at an off-peak time, as all grades will be recalculated, which may result in a high server load.';
$string['contract'] = 'Contract Category';
$string['controls'] = 'Controls';
$string['coursegradecategory'] = 'Course grade category';
$string['gradeexceptionshelp'] = 'Grade exceptions Help';
$string['gradeexportdisplaytype'] = 'Grade export display type';
$string['gradeexportdecimalpoints'] = 'Grade export decimal points';
+$string['gradeforstudent'] = '$a->student<br />$a->item$a->feedback';
$string['gradehelp'] = 'Grade Help';
$string['gradehistorylifetime'] = 'Grade history lifetime';
$string['gradeitem'] = 'Grade item';
$string['incorrectcourseid'] = 'Course ID was incorrect';
$string['incorrectminmax'] = 'The minimum must be lower than the maximum';
$string['inherit'] = 'Inherit';
+$string['intersectioninfo'] = 'Student/Grade info';
$string['item'] = 'Item';
$string['iteminfo'] = 'Item info';
$string['iteminfohelp'] = 'A space for entering information about the item. Text entered does not appear anywhere else.';
$string['uncategorised'] = 'Uncategorised';
$string['unchangedgrade'] = 'Grade unchanged';
$string['unenrolledusersinimport'] = 'This import included the following grades for users not currently enrolled in this course: $a';
+$string['unlimitedgrades'] = 'Unlimited grades';
$string['unlock'] = 'Unlock';
$string['unlockverbose'] = 'Unlock $a->category$a->itemmodule $a->itemname';
$string['unused'] = 'Unused';
$string['viewbygroup'] = 'Group';
$string['viewgrades'] = 'View grades';
$string['weight'] = 'weight';
+$string['weightuc'] = 'Weight';
$string['weightcourse'] = 'Use weighted grades for course';
$string['weightedascending'] = 'Sort by weighted percent ascending';
$string['weighteddescending'] = 'Sort by weighted percent descending';
}
}
+class admin_setting_special_gradelimiting extends admin_setting_configcheckbox {
+ function admin_setting_special_gradelimiting() {
+ parent::__construct('unlimitedgrades', get_string('unlimitedgrades', 'grades'),
+ get_string('configunlimitedgrades', 'grades'), '0', '1', '0');
+ }
+
+ function regrade_all() {
+ global $CFG;
+ require_once("$CFG->libdir/gradelib.php");
+ grade_force_site_regrading();
+ }
+
+ function write_setting($data) {
+ $previous = $this->get_setting();
+
+ if ($previous === null) {
+ if ($data) {
+ $this->regrade_all();
+ }
+ } else {
+ if ($data != $previous) {
+ $this->regrade_all();
+ }
+ }
+ return ($this->config_write($this->name, $data) ? '' : get_string('errorsetting', 'admin'));
+ }
+
+}
+
/**
* Primary grade export plugin - has state tracking.
*/
public function get_setting() {
return true;
}
-
+
public function write_setting($data) {
$url = $this->baseurl . '&new=' . $data;
return '';
public function output_html($data, $query='') {
global $CFG;
-
+
$namestr = get_string('name');
$settingsstr = get_string('settings');
$hiddenstr = get_string('hiddenshow', 'repository');
*/
public $forceable = array('aggregation', 'keephigh', 'droplow', 'aggregateonlygraded', 'aggregateoutcomes', 'aggregatesubcats');
+ /**
+ * String representing the aggregation coefficient. Variable is used as cache.
+ */
+ var $coefstring = null;
+
/**
* Builds this category's path string based on its parents (if any) and its own id number.
* This is typically done just before inserting this object in the DB for the first time,
// recalculate the grade back to requested range
$finalgrade = grade_grade::standardise_score($agg_grade, 0, 1, $this->grade_item->grademin, $this->grade_item->grademax);
- if (is_null($finalgrade)) {
- $grade->finalgrade = null;
- } else {
- $grade->finalgrade = (float)bounded_number($this->grade_item->grademin, $finalgrade, $this->grade_item->grademax);
- }
+ $grade->finalgrade = $this->grade_item->bounded_grade($finalgrade);
// update in db if changed
if (grade_floats_different($grade->finalgrade, $oldfinalgrade)) {
* @return boolean (just plain return;)
*/
private function sum_grades(&$grade, $oldfinalgrade, $items, $grade_values, $excluded) {
+ if (empty($items)) {
+ return null;
+ }
+
// ungraded and exluded items are not used in aggregation
foreach ($grade_values as $itemid=>$v) {
if (is_null($v)) {
$this->apply_limit_rules($grade_values);
$sum = array_sum($grade_values);
- $grade->finalgrade = bounded_number($this->grade_item->grademin, $sum, $this->grade_item->grademax);
+ $grade->finalgrade = $this->grade_item->bounded_grade($sum);
// update in db if changed
if (grade_floats_different($grade->finalgrade, $oldfinalgrade)) {
}
+ /**
+ * Recursive function to find which weight/extra credit field to use in the grade item form. Inherits from a parent category
+ * if that category has aggregatesubcats set to true.
+ * @param string $coefstring
+ * @return string $coefstring
+ */
+ public function get_coefstring($first=true) {
+ if (!is_null($this->coefstring)) {
+ return $this->coefstring;
+ }
+
+ $overriding_coefstring = null;
+
+ // Stop recursing upwards if this category aggregates subcats or has no parent
+ if (!$first && !$this->aggregatesubcats) {
+ if ($parent_category = $this->get_parent_category()) {
+ return $parent_category->get_coefstring(false);
+ } else {
+ return null;
+ }
+ } elseif ($first) {
+ if (!$this->aggregatesubcats) {
+ if ($parent_category = $this->get_parent_category()) {
+ $overriding_coefstring = $parent_category->get_coefstring(false);
+ }
+ }
+ }
+
+ // If an overriding coefstring has trickled down from one of the parent categories, return it. Otherwise, return self.
+ if (!is_null($overriding_coefstring)) {
+ return $overriding_coefstring;
+ }
+
+ // No parent category is overriding this category's aggregation, return its string
+ if ($this->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
+ $this->coefstring = 'aggregationcoefweight';
+ } else if ($this->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN) {
+ $this->coefstring = 'aggregationcoefextra';
+ } else if ($this->aggregation == GRADE_AGGREGATE_SUM) {
+ $this->coefstring = 'aggregationcoefextrasum';
+ } else {
+ $this->coefstring = 'aggregationcoef';
+ }
+ return $this->coefstring;
+ }
+
/**
* Returns tree with all grade_items and categories as elements
* @static
foreach ($dependson[$do] as $itemid) {
if (array_key_exists($itemid, $altered)) {
$values[$itemid] = $altered[$itemid];
- } else {
+ } elseif (!empty($values[$itemid])) {
$values[$itemid] = $grade_grades[$itemid]->finalgrade;
}
}
// recalculate the rawgrade back to requested range
$finalgrade = grade_grade::standardise_score($agg_grade, 0, 1, $grade_items[$do]->grademin, $grade_items[$do]->grademax);
- if (!is_null($finalgrade)) {
- $finalgrade = bounded_number($grade_items[$do]->grademin, $finalgrade, $grade_items[$do]->grademax);
- }
+ $finalgrade = $grade_items[$do]->bounded_grade($finalgrade);
$altered[$do] = $finalgrade;
unset($todo[$key]);
$rawgrade *= $this->multfactor;
$rawgrade += $this->plusfactor;
- return bounded_number($this->grademin, $rawgrade, $this->grademax);
+ return $this->bounded_grade($rawgrade);
} else if ($this->gradetype == GRADE_TYPE_SCALE) { // Dealing with a scale value
if (empty($this->scale)) {
$rawgrade = grade_grade::standardise_score($rawgrade, $rawmin, $rawmax, $this->grademin, $this->grademax);
}
- return (int)bounded_number(0, round($rawgrade+0.00001), $this->grademax);
+ return $this->bounded_grade($rawgrade);
} else if ($this->gradetype == GRADE_TYPE_TEXT or $this->gradetype == GRADE_TYPE_NONE) { // no value
/**
* Returns the most descriptive field for this object. This is a standard method used
* when we do not know the exact type of an object.
+ * @param boolean $fulltotal: if the item is a category total, returns $categoryname."total" instead of "Category total" or "Course total"
* @return string name
*/
- public function get_name() {
+ public function get_name($fulltotal=false) {
if (!empty($this->itemname)) {
// MDL-10557
return format_string($this->itemname);
return get_string('coursetotal', 'grades');
} else if ($this->is_category_item()) {
+ if ($fulltotal) {
+ $category = $this->get_parent_category();
+ $a = new stdClass();
+ $a->category = $category->get_name();
+ return get_string('categorytotalfull', 'grades', $a);
+ } else {
return get_string('categorytotal', 'grades');
+ }
} else {
return get_string('grade');
return $this->update();
}
+ /**
+ * Makes sure value is a valid grade value.
+ * @param float $gradevalue
+ * @return mixed float or int fixed grade value
+ */
+ public function bounded_grade($gradevalue) {
+ global $CFG;
+
+ if (is_null($gradevalue)) {
+ return null;
+ }
+
+ if ($this->gradetype == GRADE_TYPE_SCALE) {
+ // no >100% grades hack for scale grades!
+ // 1.5 is rounded to 2 ;-)
+ return (int)bounded_number($this->grademin, round($gradevalue+0.00001), $this->grademax);
+ }
+
+ $grademax = $this->grademax;
+
+ // NOTE: if you change this value you must manually reset the needsupdate flag in all grade items
+ $maxcoef = isset($CFG->gradeoverhundredprocentmax) ? $CFG->gradeoverhundredprocentmax : 10; // 1000% max by default
+
+ if (!empty($CFG->unlimitedgrades)) {
+ // NOTE: if you change this value you must manually reset the needsupdate flag in all grade items
+ $grademax = $grademax * $maxcoef;
+ } else if ($this->is_category_item() or $this->is_course_item()) {
+ $category = $this->load_item_category();
+ if ($category->aggregation >= 100) {
+ // grade >100% hack
+ $grademax = $grademax * $maxcoef;
+ }
+ }
+
+ return (float)bounded_number($this->grademin, $gradevalue, $grademax);
+ }
+
/**
* Finds out on which other items does this depend directly when doing calculation or category agregation
* @param bool $reset_cache
$grade->overridden = 0;
}
- if (is_null($finalgrade)) {
- $grade->finalgrade = null;
- } else {
- $grade->finalgrade = bounded_number($this->grademin, $finalgrade, $this->grademax);
- }
+ $grade->finalgrade = $this->bounded_grade($finalgrade);
}
// do we have comment from teacher?
} else {
// normalize
- $result = bounded_number($this->grademin, $result, $this->grademax);
- if ($this->gradetype == GRADE_TYPE_SCALE) {
- $result = round($result+0.00001); // round scales upwards
- }
- $grade->finalgrade = $result;
+ $grade->finalgrade = $this->bounded_grade($result);
}
// update in db if changed
return $grademin.'–'. $grademax;
}
+
+ /**
+ * Queries parent categories recursively to find the aggregationcoef type that applies to this
+ * grade item.
+ */
+ public function get_coefstring() {
+ $parent_category = $this->get_parent_category();
+ if ($this->is_category_item()) {
+ $parent_category = $parent_category->get_parent_category();
+ }
+
+ if ($parent_category->is_aggregationcoef_used()) {
+ return $parent_category->get_coefstring();
+ } else {
+ return false;
+ }
+ }
}
?>
break;
}
-
if (is_null($grade_grade)) {
if (count($grades) == 0) {
// no more grades to process
return get_string('error');
}
- $value = (int)bounded_number($grade_item->grademin, $value, $grade_item->grademax);
+ $value = $grade_item->bounded_grade($value);
return format_string($scale->scale_items[$value-1]);
} else {
if ($min == $max) {
return '';
}
- $value = bounded_number($min, $value, $max);
+ $value = $grade_item->bounded_grade($value);
$percentage = (($value-$min)*100)/($max-$min);
return format_float($percentage, $decimals, $localized).' %';
}
return ''; // no letters??
}
+ if (is_null($value)) {
+ return '-';
+ }
+
$value = grade_grade::standardise_score($value, $grade_item->grademin, $grade_item->grademax, 0, 100);
$value = bounded_number(0, $value, 100); // just in case
foreach ($letters as $boundary => $letter) {
$DB->set_field('grade_items', 'needsupdate', 1, array('courseid'=>$courseid));
}
+/**
+ * Forces regrading of all site grades - usualy when chanign site setings
+ */
+function grade_force_site_regrading() {
+ global $CFG, $DB;
+ $sql = "UPDATE {$CFG->prefix}grade_items SET needsupdate=1";
+ $DB->execute($sql);
+}
+
/**
* Updates all final grades in course.
*
$fullmod = $CFG->dirroot.'/mod/'.$modinstance->modname;
if (!file_exists($fullmod.'/lib.php')) {
- debugging('missing lib.php file in module');
+ debugging('missing lib.php file in module ' . $modinstance->modname);
return false;
}
include_once($fullmod.'/lib.php');