mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-11835 Implemented all the default settings suggested in the pdf report, and turned down the size of the report table fonts.
This commit is contained in:
parent
3f4e29b4ac
commit
9ecd438653
4 changed files with 86 additions and 19 deletions
|
@ -837,6 +837,32 @@ class grade_structure {
|
||||||
return 'i'.$grade_item->id;
|
return 'i'.$grade_item->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_params_for_iconstr($element) {
|
||||||
|
$strparams = new stdClass();
|
||||||
|
$strparams->category = '';
|
||||||
|
$strparams->itemname = '';
|
||||||
|
$strparams->itemmodule = '';
|
||||||
|
if (!method_exists($element['object'], 'get_name')) {
|
||||||
|
return $strparams;
|
||||||
|
}
|
||||||
|
|
||||||
|
$strparams->itemname = $element['object']->get_name();
|
||||||
|
|
||||||
|
// If element name is categorytotal, get the name of the parent category
|
||||||
|
if ($strparams->itemname == get_string('categorytotal', 'grades')) {
|
||||||
|
$parent = $element['object']->get_parent_category();
|
||||||
|
$strparams->category = $parent->get_name() . ' ';
|
||||||
|
} else {
|
||||||
|
$strparams->category = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$strparams->itemmodule = null;
|
||||||
|
if (isset($element['object']->itemmodule)) {
|
||||||
|
$strparams->itemmodule = $element['object']->itemmodule;
|
||||||
|
}
|
||||||
|
return $strparams;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return edit icon for give element
|
* Return edit icon for give element
|
||||||
* @param object $element
|
* @param object $element
|
||||||
|
@ -860,6 +886,10 @@ class grade_structure {
|
||||||
$strfeedback = get_string('feedback');
|
$strfeedback = get_string('feedback');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$strparams = $this->get_params_for_iconstr($element);
|
||||||
|
if ($element['type'] == 'item' or $element['type'] == 'category') {
|
||||||
|
}
|
||||||
|
|
||||||
$object = $element['object'];
|
$object = $element['object'];
|
||||||
$overlib = '';
|
$overlib = '';
|
||||||
|
|
||||||
|
@ -867,6 +897,7 @@ class grade_structure {
|
||||||
case 'item':
|
case 'item':
|
||||||
case 'categoryitem':
|
case 'categoryitem':
|
||||||
case 'courseitem':
|
case 'courseitem':
|
||||||
|
$stredit = get_string('editverbose', 'grades', $strparams);
|
||||||
if (empty($object->outcomeid) || empty($CFG->enableoutcomes)) {
|
if (empty($object->outcomeid) || empty($CFG->enableoutcomes)) {
|
||||||
$url = $CFG->wwwroot.'/grade/edit/tree/item.php?courseid='.$this->courseid.'&id='.$object->id;
|
$url = $CFG->wwwroot.'/grade/edit/tree/item.php?courseid='.$this->courseid.'&id='.$object->id;
|
||||||
} else {
|
} else {
|
||||||
|
@ -876,6 +907,7 @@ class grade_structure {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'category':
|
case 'category':
|
||||||
|
$stredit = get_string('editverbose', 'grades', $strparams);
|
||||||
$url = $CFG->wwwroot.'/grade/edit/tree/category.php?courseid='.$this->courseid.'&id='.$object->id;
|
$url = $CFG->wwwroot.'/grade/edit/tree/category.php?courseid='.$this->courseid.'&id='.$object->id;
|
||||||
$url = $gpr->add_url_params($url);
|
$url = $gpr->add_url_params($url);
|
||||||
break;
|
break;
|
||||||
|
@ -919,12 +951,9 @@ class grade_structure {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
static $strshow = null;
|
$strparams = $this->get_params_for_iconstr($element);
|
||||||
static $strhide = null;
|
$strshow = get_string('showverbose', 'grades', $strparams);
|
||||||
if (is_null($strshow)) {
|
$strhide = get_string('hideverbose', 'grades', $strparams);
|
||||||
$strshow = get_string('show');
|
|
||||||
$strhide = get_string('hide');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($element['object']->is_hidden()) {
|
if ($element['object']->is_hidden()) {
|
||||||
$icon = 'show';
|
$icon = 'show';
|
||||||
|
@ -957,12 +986,9 @@ class grade_structure {
|
||||||
function get_locking_icon($element, $gpr) {
|
function get_locking_icon($element, $gpr) {
|
||||||
global $CFG;
|
global $CFG;
|
||||||
|
|
||||||
static $strunlock = null;
|
$strparams = $this->get_params_for_iconstr($element);
|
||||||
static $strlock = null;
|
$strunlock = get_string('unlockverbose', 'grades', $strparams);
|
||||||
if (is_null($strunlock)) {
|
$strlock = get_string('lockverbose', 'grades', $strparams);
|
||||||
$strunlock = get_string('unlock', 'grades');
|
|
||||||
$strlock = get_string('lock', 'grades');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($element['object']->is_locked()) {
|
if ($element['object']->is_locked()) {
|
||||||
$icon = 'unlock';
|
$icon = 'unlock';
|
||||||
|
@ -1010,8 +1036,10 @@ class grade_structure {
|
||||||
$type = $element['type'];
|
$type = $element['type'];
|
||||||
$object = $element['object'];
|
$object = $element['object'];
|
||||||
|
|
||||||
|
|
||||||
if ($type == 'item' or $type == 'courseitem' or $type == 'categoryitem') {
|
if ($type == 'item' or $type == 'courseitem' or $type == 'categoryitem') {
|
||||||
$streditcalculation = get_string('editcalculation', 'grades');
|
$strparams = $this->get_params_for_iconstr($element);
|
||||||
|
$streditcalculation = get_string('editcalculationverbose', 'grades', $strparams);
|
||||||
|
|
||||||
// show calculation icon only when calculation possible
|
// show calculation icon only when calculation possible
|
||||||
if ((!$object->is_external_item() or $object->is_outcome_item())
|
if ((!$object->is_external_item() or $object->is_outcome_item())
|
||||||
|
|
|
@ -566,7 +566,7 @@ class grade_report_grader extends grade_report {
|
||||||
// Element is a category
|
// Element is a category
|
||||||
else if ($type == 'category') {
|
else if ($type == 'category') {
|
||||||
$headerhtml .= '<th class="header '. $columnclass.' category'.$catlevel.'" '.$colspan.' scope="col">'
|
$headerhtml .= '<th class="header '. $columnclass.' category'.$catlevel.'" '.$colspan.' scope="col">'
|
||||||
. $element['object']->get_name();
|
. shorten_text($element['object']->get_name());
|
||||||
$headerhtml .= $this->get_collapsing_icon($element);
|
$headerhtml .= $this->get_collapsing_icon($element);
|
||||||
|
|
||||||
// Print icons
|
// Print icons
|
||||||
|
@ -597,8 +597,9 @@ class grade_report_grader extends grade_report {
|
||||||
}
|
}
|
||||||
|
|
||||||
$headerlink = $this->gtree->get_element_header($element, true, $this->get_pref('showactivityicons'), false);
|
$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)">'. $headerlink . $arrow;
|
$headerhtml .= '<th class="header '.$columnclass.' '.$type.$catlevel.$hidden.'" scope="col" onclick="set_col(this.cellIndex)">'
|
||||||
$headerhtml .= $this->get_icons($element) . '</th>';
|
. shorten_text($headerlink) . $arrow;
|
||||||
|
$headerhtml .= '</th>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1042,6 +1043,34 @@ class grade_report_grader extends grade_report {
|
||||||
return $scalehtml;
|
return $scalehtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds and return the HTML row of ranges for each column (i.e. range).
|
||||||
|
* @return string HTML
|
||||||
|
*/
|
||||||
|
function get_iconshtml() {
|
||||||
|
global $USER;
|
||||||
|
|
||||||
|
$iconshtml = '';
|
||||||
|
if ($USER->gradeediting[$this->courseid]) {
|
||||||
|
|
||||||
|
$iconshtml = '<tr class="r'.$this->rowcount++.'">'
|
||||||
|
. '<th class="header c0 range" scope="row">'.$this->get_lang_string('controls','grades').'</th>';
|
||||||
|
|
||||||
|
$columncount = 1;
|
||||||
|
foreach ($this->gtree->items as $itemid=>$unused) {
|
||||||
|
// emulate grade element
|
||||||
|
$item =& $this->gtree->items[$itemid];
|
||||||
|
|
||||||
|
$eid = $this->gtree->get_item_eid($item);
|
||||||
|
$element = $this->gtree->locate_element($eid);
|
||||||
|
|
||||||
|
$iconshtml .= '<td class="cell c'.$columncount++.' icons">' . $this->get_icons($element) . '</td>';
|
||||||
|
}
|
||||||
|
$iconshtml .= '</tr>';
|
||||||
|
}
|
||||||
|
return $iconshtml;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a grade_category, grade_item or grade_grade, this function
|
* Given a grade_category, grade_item or grade_grade, this function
|
||||||
* figures out the state of the object and builds then returns a div
|
* figures out the state of the object and builds then returns a div
|
||||||
|
|
|
@ -31,7 +31,7 @@ $strinherit = get_string('inherit', 'grades');
|
||||||
|
|
||||||
/// Add settings for this module to the $settings object (it's already defined)
|
/// Add settings for this module to the $settings object (it's already defined)
|
||||||
$settings->add(new admin_setting_configtext('grade_report_studentsperpage', get_string('studentsperpage', 'grades'),
|
$settings->add(new admin_setting_configtext('grade_report_studentsperpage', get_string('studentsperpage', 'grades'),
|
||||||
get_string('configstudentsperpage', 'grades'), 20));
|
get_string('configstudentsperpage', 'grades'), 100));
|
||||||
|
|
||||||
$settings->add(new admin_setting_configcheckbox('grade_report_quickgrading', get_string('quickgrading', 'grades'),
|
$settings->add(new admin_setting_configcheckbox('grade_report_quickgrading', get_string('quickgrading', 'grades'),
|
||||||
get_string('configquickgrading', 'grades'), 1));
|
get_string('configquickgrading', 'grades'), 1));
|
||||||
|
@ -52,7 +52,7 @@ $settings->add(new admin_setting_configselect('grade_report_aggregationview', ge
|
||||||
GRADE_REPORT_AGGREGATION_VIEW_GRADES_ONLY => get_string('gradesonly', 'grades'))));
|
GRADE_REPORT_AGGREGATION_VIEW_GRADES_ONLY => get_string('gradesonly', 'grades'))));
|
||||||
|
|
||||||
$settings->add(new admin_setting_configselect('grade_report_meanselection', get_string('meanselection', 'grades'),
|
$settings->add(new admin_setting_configselect('grade_report_meanselection', get_string('meanselection', 'grades'),
|
||||||
get_string('configmeanselection', 'grades'), GRADE_REPORT_MEAN_ALL,
|
get_string('configmeanselection', 'grades'), GRADE_REPORT_MEAN_GRADED,
|
||||||
array(GRADE_REPORT_MEAN_ALL => get_string('meanall', 'grades'),
|
array(GRADE_REPORT_MEAN_ALL => get_string('meanall', 'grades'),
|
||||||
GRADE_REPORT_MEAN_GRADED => get_string('meangraded', 'grades'))));
|
GRADE_REPORT_MEAN_GRADED => get_string('meangraded', 'grades'))));
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ $settings->add(new admin_setting_configcheckbox('grade_report_showeyecons', get_
|
||||||
get_string('configshoweyecons', 'grades'), 0));
|
get_string('configshoweyecons', 'grades'), 0));
|
||||||
|
|
||||||
$settings->add(new admin_setting_configcheckbox('grade_report_showaverages', get_string('showaverages', 'grades'),
|
$settings->add(new admin_setting_configcheckbox('grade_report_showaverages', get_string('showaverages', 'grades'),
|
||||||
get_string('configshowaverages', 'grades'), 0));
|
get_string('configshowaverages', 'grades'), 1));
|
||||||
|
|
||||||
$settings->add(new admin_setting_configcheckbox('grade_report_showgroups', get_string('showgroups', 'grades'),
|
$settings->add(new admin_setting_configcheckbox('grade_report_showgroups', get_string('showgroups', 'grades'),
|
||||||
get_string('configshowgroups', 'grades'), 0));
|
get_string('configshowgroups', 'grades'), 0));
|
||||||
|
|
|
@ -59,6 +59,9 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.grade-report-grader table#user-grades {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
.grade-report-grader table#user-grades {
|
.grade-report-grader table#user-grades {
|
||||||
border-width:1px;
|
border-width:1px;
|
||||||
|
@ -112,6 +115,7 @@
|
||||||
.grade-report-grader table#user-grades th.category {
|
.grade-report-grader table#user-grades th.category {
|
||||||
border-width:1px 1px 0px 1px;
|
border-width:1px 1px 0px 1px;
|
||||||
border-style:solid;
|
border-style:solid;
|
||||||
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grade-report-grader table#user-grades th.user {
|
.grade-report-grader table#user-grades th.user {
|
||||||
|
@ -124,6 +128,11 @@
|
||||||
.grade-report-grader table#user-grades td.topleft {
|
.grade-report-grader table#user-grades td.topleft {
|
||||||
border-width:0px 1px 0px 1px;
|
border-width:0px 1px 0px 1px;
|
||||||
border-style:solid;
|
border-style:solid;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade-report-grader table#participants th {
|
||||||
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grade-report-grader table#user-grades td.fillerfirst {
|
.grade-report-grader table#user-grades td.fillerfirst {
|
||||||
|
@ -139,6 +148,7 @@
|
||||||
.grade-report-grader table#user-grades th.item {
|
.grade-report-grader table#user-grades th.item {
|
||||||
border-width:1px 1px 1px 1px;
|
border-width:1px 1px 1px 1px;
|
||||||
border-style:solid;
|
border-style:solid;
|
||||||
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grade-report-grader div.gradertoggle {
|
.grade-report-grader div.gradertoggle {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue