mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-10386
- Renamed grade_report_shownotes preference to grade_report_showfeedback - Added grade_report_quickgrading and grade_report_quickfeedback preferences - Re-organised the grade_get_icons() function: The icons are all prepared first, then the preferences and conditions are applied to the selection of icons. This allows for a third $icons parameter, an array of icon names, which explicitly sets which icons should be returned by the function, regardless of preferences and options. - Identified and fixed MDL-10391 bug with updating boolean user preferences (advcheckbox used)
This commit is contained in:
parent
72e42141cf
commit
ce0c946a1f
@ -31,8 +31,7 @@ function grader_report_print_toggle($type, $baseurl, $return=false) {
|
||||
$icons = array('eyecons' => 'hide',
|
||||
'calculations' => 'calc',
|
||||
'locks' => 'lock',
|
||||
'grandtotals' => 'sigma',
|
||||
'notes' => 'feedback');
|
||||
'grandtotals' => 'sigma');
|
||||
|
||||
$pref_name = 'grade_report_show' . $type;
|
||||
$show_pref = get_user_preferences($pref_name, $CFG->$pref_name);
|
||||
@ -131,6 +130,9 @@ $showgrandtotals = get_user_preferences('grade_report_showgrandtotals', $CF
|
||||
$showgroups = get_user_preferences('grade_report_showgroups', $CFG->grade_report_showgroups);
|
||||
$aggregation_position = get_user_preferences('grade_report_aggregationposition', $CFG->grade_report_aggregationposition);
|
||||
$showscales = get_user_preferences('grade_report_showscales', $CFG->grade_report_showscales);
|
||||
$showfeedback = get_user_preferences('grade_report_showfeedback', $CFG->grade_report_showfeedback);
|
||||
$quickgrading = get_user_preferences('grade_report_quickgrading', $CFG->grade_report_quickgrading);
|
||||
$quickfeedback = get_user_preferences('grade_report_quickfeedback', $CFG->grade_report_quickfeedback);
|
||||
|
||||
// Override perpage if set in URL
|
||||
if ($perpageurl = optional_param('perpage', 0, PARAM_INT)) {
|
||||
@ -388,7 +390,7 @@ if ($USER->gradeediting) {
|
||||
grader_report_print_toggle('calculations', $baseurl);
|
||||
}
|
||||
|
||||
grader_report_print_toggle('notes', $baseurl);
|
||||
grader_report_print_toggle('feedback', $baseurl);
|
||||
grader_report_print_toggle('grandtotals', $baseurl);
|
||||
grader_report_print_toggle('groups', $baseurl);
|
||||
grader_report_print_toggle('scales', $baseurl);
|
||||
@ -493,7 +495,6 @@ $studentshtml = '';
|
||||
|
||||
foreach ($users as $userid => $user) {
|
||||
// Student name and link
|
||||
|
||||
$studentshtml .= '<tr><th class="user"><a href="' . $CFG->wwwroot . '/user/view.php?id='
|
||||
. $user->id . '">' . fullname($user) . '</a></th>';
|
||||
foreach ($items as $item) {
|
||||
@ -533,13 +534,50 @@ foreach ($users as $userid => $user) {
|
||||
$i++;
|
||||
$scaleopt[$i] = $scaleoption;
|
||||
}
|
||||
|
||||
if ($quickgrading) {
|
||||
$studentshtml .= choose_from_menu($scaleopt, 'grade_'.$userid.'_'.$item->id,
|
||||
$gradeval, get_string('nograde'), '', -1, true);
|
||||
} elseif ($scale = get_record('scale', 'id', $item->scaleid)) {
|
||||
$scales = explode(",", $scale->scale);
|
||||
|
||||
// invalid grade if gradeval < 1
|
||||
if ((int) $gradeval < 1) {
|
||||
$studentshtml .= '-';
|
||||
} else {
|
||||
$studentshtml .= $scales[$gradeval-1];
|
||||
}
|
||||
} else {
|
||||
// no such scale, throw error?
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($quickgrading) {
|
||||
$studentshtml .= '<input size="6" type="text" name="grade_'.$userid.'_'.$item->id.'" value="'.$gradeval.'"/>';
|
||||
} else {
|
||||
$studentshtml .= $gradeval;
|
||||
}
|
||||
}
|
||||
|
||||
$icons_html = '<div class="grade_icons">';
|
||||
|
||||
if (!$quickgrading) {
|
||||
// If quickgrading is off, print an edit icon
|
||||
$icons_html .= grade_get_icons($element, $gtree, array('edit'));
|
||||
}
|
||||
|
||||
if ($showfeedback && $quickfeedback) {
|
||||
$studentshtml .= '<input size="6" type="text" name="feedback_'.$userid.'_'.$item->id.'" value="'. @$grade->feedback . '"/>';
|
||||
} elseif ($showfeedback) { // If quickfeedback is off but showfeedback is on, print an edit feedback icon
|
||||
if (empty($grade->feedback)) {
|
||||
$icons_html .= grade_get_icons($element, $gtree, array('add_feedback'));
|
||||
} else {
|
||||
$icons_html .= grade_get_icons($element, $gtree, array('edit_feedback'));
|
||||
}
|
||||
}
|
||||
|
||||
$icons_html .= '</div>';
|
||||
$studentshtml .= $icons_html;
|
||||
} else {
|
||||
// finalgrades[$userid][$itemid] could be null because of the outer join
|
||||
// in this case it's different than a 0
|
||||
|
@ -51,6 +51,7 @@ if ($form = data_submitted()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
redirect($CFG->wwwroot . '/grade/report.php?report=grader&id='.$courseid, get_string('changessaved'), 1);
|
||||
exit;
|
||||
}
|
||||
|
@ -19,15 +19,17 @@ class grader_report_preferences_form extends moodleform {
|
||||
|
||||
/// form definition with preferences defaults
|
||||
//--------------------------------------------------------------------------------
|
||||
$preferences = array('bulkcheckboxes' => 'checkbox',
|
||||
'enableajax' => 'checkbox',
|
||||
'showcalculations' => 'checkbox',
|
||||
'showeyecons' => 'checkbox',
|
||||
'showgrandtotals' => 'checkbox',
|
||||
'showgroups' => 'checkbox',
|
||||
'showlocks' => 'checkbox',
|
||||
'shownotes' => 'checkbox',
|
||||
'showscales' => 'checkbox',
|
||||
$preferences = array('bulkcheckboxes' => 'advcheckbox',
|
||||
'enableajax' => 'advcheckbox',
|
||||
'showcalculations' => 'advcheckbox',
|
||||
'showeyecons' => 'advcheckbox',
|
||||
'showgrandtotals' => 'advcheckbox',
|
||||
'showgroups' => 'advcheckbox',
|
||||
'showlocks' => 'advcheckbox',
|
||||
'showfeedback' => 'advcheckbox',
|
||||
'showscales' => 'advcheckbox',
|
||||
'quickgrading' => 'advcheckbox',
|
||||
'quickfeedback' => 'advcheckbox',
|
||||
'aggregationposition' => array(get_string('left', 'grades'), get_string('right', 'grades')),
|
||||
'aggregationview' => array(get_string('full', 'grades'), get_string('compact', 'grades')),
|
||||
'gradedisplaytype' => array(get_string('raw', 'grades'), get_string('percentage', 'grades')),
|
||||
|
@ -27,10 +27,14 @@ $settings->add(new admin_setting_configcheckbox('grade_report_showgrandtotals',
|
||||
get_string('configshowgrandtotals', 'grades'), 0));
|
||||
$settings->add(new admin_setting_configcheckbox('grade_report_showlocks', get_string('showlocks', 'grades'),
|
||||
get_string('configshowlocks', 'grades'), 0));
|
||||
$settings->add(new admin_setting_configcheckbox('grade_report_shownotes', get_string('shownotes', 'grades'),
|
||||
get_string('configshownotes', 'grades'), 0));
|
||||
$settings->add(new admin_setting_configcheckbox('grade_report_showfeedback', get_string('showfeedback', 'grades'),
|
||||
get_string('configshowfeedback', 'grades'), 0));
|
||||
$settings->add(new admin_setting_configcheckbox('grade_report_showscales', get_string('showscales', 'grades'),
|
||||
get_string('configshowscales', 'grades'), 0));
|
||||
$settings->add(new admin_setting_configcheckbox('grade_report_quickgrading', get_string('quickgrading', 'grades'),
|
||||
get_string('configquickgrading', 'grades'), 1));
|
||||
$settings->add(new admin_setting_configcheckbox('grade_report_quickfeedback', get_string('quickfeedback', 'grades'),
|
||||
get_string('configquickfeedback', 'grades'), 1));
|
||||
$settings->add(new admin_setting_configtext('grade_report_studentsperpage', get_string('studentsperpage', 'grades'),
|
||||
get_string('configstudentsperpage', 'grades'), 20));
|
||||
$settings->add(new admin_setting_configselect('grade_report_feedbackformat', get_string('feedbackformat', 'grades'),
|
||||
|
@ -37,12 +37,14 @@ $string['configenableajax'] = 'Adds a layer of AJAX functionality to the grader
|
||||
$string['configfeedbackformat'] = 'The format of feedback notes attached to grades. This also determines the interface element used to enter such feedback (htmleditor for HTML format).';
|
||||
$string['configgradedisplaytype'] = 'Grades can be shown as raw grades or as percentages (in reference to the minimum and maximum grades).';
|
||||
$string['configgrandtotalsdisplaytype'] = 'Grand totals can be shown as raw grades or as percentages (in reference to the minimum and maximum grades).';
|
||||
$string['configquickfeedback'] = 'Quick Feedback adds a text input element in each grade cell on the grader report, allowing you to edit many grades at once. You can then click the Update button to perform all these changes at once, instead of one at a time.';
|
||||
$string['configquickgrading'] = 'Quick Grading adds a text input element in each grade cell on the grader report, allowing you to edit the feedback for many grades at once. You can then click the Update button to perform all these changes at once, instead of one at a time.';
|
||||
$string['configshowcalculations'] = 'Whether to show calculator icons near each grade item and category, tooltips over calculated items and a visual indicator that a column is calculated.';
|
||||
$string['configshoweyecons'] = 'Whether to show an eye-con near each grade (controlling its visibility to the user).';
|
||||
$string['configshowgrandtotals'] = 'Show grand totals in the grader report.';
|
||||
$string['configshowgroups'] = 'Show group totals and means in the grader report.';
|
||||
$string['configshowlocks'] = 'Whether to show a lock/unlock icon near each grade.';
|
||||
$string['configshownotes'] = 'Whether to show a feedback icon (for adding/editing) near each grade.';
|
||||
$string['configshowfeedback'] = 'Whether to show a feedback icon (for adding/editing) near each grade.';
|
||||
$string['configshowscales'] = 'Display a row showing the scale for each grading item, in the grader report.';
|
||||
$string['configstudentsperpage'] = 'The number of students to display per page in the grader report.';
|
||||
$string['contract'] = 'Contract Category';
|
||||
@ -124,7 +126,7 @@ $string['hideeyecons'] = 'Hide eyecons';
|
||||
$string['hidegrandtotals'] = 'Hide grandtotals';
|
||||
$string['hidegroups'] = 'Hide groups';
|
||||
$string['hidelocks'] = 'Hide locks';
|
||||
$string['hidenotes'] = 'Hide feedback';
|
||||
$string['hidefeedback'] = 'Hide feedback';
|
||||
$string['hidescales'] = 'Hide scales';
|
||||
$string['highgradeascending'] = 'Sort by high grade ascending';
|
||||
$string['highgradedescending'] = 'Sort by high grade descending';
|
||||
@ -186,6 +188,8 @@ $string['points'] = 'points';
|
||||
$string['pointsascending'] = 'Sort by points ascending';
|
||||
$string['pointsdescending'] = 'Sort by points descdending';
|
||||
$string['preferences'] = 'Preferences';
|
||||
$string['quickfeedback'] = 'Quick Feedback';
|
||||
$string['quickgrading'] = 'Quick Grading';
|
||||
$string['rank'] = 'Rank';
|
||||
$string['raw'] = 'Raw';
|
||||
$string['rawpct'] = 'Raw %%';
|
||||
@ -211,7 +215,7 @@ $string['showeyecons'] = 'Show eye-cons';
|
||||
$string['showgrandtotals'] = 'Show grand totals';
|
||||
$string['showgroups'] = 'Show groups';
|
||||
$string['showlocks'] = 'Show locks';
|
||||
$string['shownotes'] = 'Show feedback';
|
||||
$string['showfeedback'] = 'Show feedback';
|
||||
$string['showscales'] = 'Show scales';
|
||||
$string['showhiddenitems'] = 'Show Hidden Items';
|
||||
$string['sort'] = 'sort';
|
||||
|
167
lib/gradelib.php
167
lib/gradelib.php
@ -711,12 +711,15 @@ function grade_oldgradebook_upgrade($courseid) {
|
||||
*
|
||||
* @param object $object
|
||||
* @param object $tree (A complete grade_tree object)
|
||||
* @param array $icons An array of icon names that this function is explicitly requested to print, regardless of settings
|
||||
* @param bool $limit If true, use the $icons array as the only icons that will be printed. If false, use it to exclude these icons.
|
||||
* @return string HTML
|
||||
*/
|
||||
function grade_get_icons($element, $tree) {
|
||||
function grade_get_icons($element, $tree, $icons=null, $limit=true) {
|
||||
global $CFG;
|
||||
global $USER;
|
||||
|
||||
|
||||
// Load language strings
|
||||
$straddfeedback = get_string("addfeedback", 'grades');
|
||||
$stredit = get_string("edit");
|
||||
@ -745,62 +748,51 @@ function grade_get_icons($element, $tree) {
|
||||
$object = $element['object'];
|
||||
$type = $element['type'];
|
||||
|
||||
// Add mock attributes in case the object is not of the right type
|
||||
if ($type != 'grade') {
|
||||
$object->feedback = '';
|
||||
}
|
||||
|
||||
// Load user preferences
|
||||
$aggregationview = get_user_preferences('grade_report_aggregationview', $CFG->grade_report_aggregationview);
|
||||
$showeyecons = get_user_preferences('grade_report_showeyecons', $CFG->grade_report_showeyecons);
|
||||
$showlocks = get_user_preferences('grade_report_showlocks', $CFG->grade_report_showlocks);
|
||||
$shownotes = get_user_preferences('grade_report_shownotes', $CFG->grade_report_shownotes);
|
||||
$showfeedback = get_user_preferences('grade_report_showfeedback', $CFG->grade_report_showfeedback);
|
||||
$showcalculations = get_user_preferences('grade_report_showcalculations', $CFG->grade_report_showcalculations);
|
||||
|
||||
// Icons shown when edit mode is on
|
||||
if ($USER->gradeediting) {
|
||||
// Edit icon (except for grade_grades)
|
||||
if ($type == 'category') {
|
||||
$html .= '<a href="report/grader/edit_category.php?courseid='.$object->courseid.'&id='.$object->id.'">';
|
||||
$html .= '<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'
|
||||
.$stredit.'" title="'.$stredit.'" /></a>'. "\n";
|
||||
// Prepare image strings
|
||||
$edit_category_icon = '<a href="report/grader/edit_category.php?courseid='.$object->courseid.'&id='.$object->id.'">'
|
||||
. '<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'
|
||||
. $stredit.'" title="'.$stredit.'" /></a>'. "\n";
|
||||
|
||||
} else if ($type == 'item' or $type == 'courseitem' or $type == 'categoryitem') {
|
||||
$html .= '<a href="report/grader/edit_item.php?courseid='.$object->courseid.'&id='.$object->id.'">';
|
||||
$html .= '<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'
|
||||
.$stredit.'" title="'.$stredit.'" /></a>'. "\n";
|
||||
$edit_item_icon = '<a href="report/grader/edit_item.php?courseid='.$object->courseid.'&id='.$object->id.'">'
|
||||
. '<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'
|
||||
. $stredit.'" title="'.$stredit.'" /></a>'. "\n";
|
||||
|
||||
} else if ($type == 'grade') {
|
||||
// What is the purpose of edit_grade page?
|
||||
/*
|
||||
$html .= '<a href="report/grader/edit_grade.php?courseid='.$object->courseid.'&id='.$object->id.'">';
|
||||
$html .= '<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'
|
||||
.$stredit.'" title="'.$stredit.'" /></a>'. "\n";
|
||||
*/
|
||||
}
|
||||
$edit_grade_icon = '<a href="report/grader/edit_grade.php?courseid='.$object->courseid.'&id='.$object->id.'">'
|
||||
. '<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'
|
||||
. $stredit.'" title="'.$stredit.'" /></a>'. "\n";
|
||||
|
||||
// Calculation icon for items and categories
|
||||
if ($showcalculations && $type != 'grade') {
|
||||
$html .= '<a href="report/grader/edit_calculation.php?courseid='.$object->courseid.'&id='.$object->id.'">';
|
||||
$html .= '<img src="'.$CFG->pixpath.'/t/calc.gif" class="iconsmall" alt="'
|
||||
.$streditcalculation.'" title="'.$streditcalculation.'" /></a>'. "\n";
|
||||
}
|
||||
$edit_calculation_icon = '<a href="report/grader/edit_calculation.php?courseid='.$object->courseid.'&id='.$object->id.'">'
|
||||
. '<img src="'.$CFG->pixpath.'/t/calc.gif" class="iconsmall" alt="'
|
||||
. $streditcalculation.'" title="'.$streditcalculation.'" /></a>'. "\n";
|
||||
|
||||
if ($shownotes) {
|
||||
// Setup object identifier and show feedback icon if applicable
|
||||
if ($type == 'grade' and $shownotes) {
|
||||
// Display Edit/Add feedback icon
|
||||
if (empty($object->feedback)) {
|
||||
$html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
||||
. "&action=add&courseid=$object->courseid\">\n";
|
||||
$html .= '<img src="'.$CFG->pixpath.'/t/feedback_add.gif" class="iconsmall" alt="'.$straddfeedback.'" '
|
||||
$add_feedback_icon = '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
||||
. "&action=add&courseid=$object->courseid\">\n"
|
||||
. '<img src="'.$CFG->pixpath.'/t/feedback_add.gif" class="iconsmall" alt="'.$straddfeedback.'" '
|
||||
. 'title="'.$straddfeedback.'" /></a>'. "\n";
|
||||
} else {
|
||||
$html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
||||
. "&action=edit&courseid=$object->courseid\">\n";
|
||||
$html .= '<img src="'.$CFG->pixpath.'/t/feedback.gif" class="iconsmall" alt="'.$streditfeedback.'" '
|
||||
|
||||
$edit_feedback_icon = '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
||||
. "&action=edit&courseid=$object->courseid\">\n"
|
||||
. '<img src="'.$CFG->pixpath.'/t/feedback.gif" class="iconsmall" alt="'.$streditfeedback.'" '
|
||||
. 'title="'.$streditfeedback.'" onmouseover="return overlib(\''.$object->feedback.'\', CAPTION, \''
|
||||
. $strfeedback.'\');" onmouseout="return nd();" /></a>'. "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($showeyecons) {
|
||||
$view_feedback_icon = '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
||||
. "&action=view&courseid=$object->courseid\">\n"
|
||||
. '<img onmouseover="return overlib(\''.$object->feedback.'\', CAPTION, \''
|
||||
. $strfeedback.'\');" onmouseout="return nd();" '
|
||||
. 'src="'.$CFG->pixpath.'/t/feedback.gif" class="iconsmall" alt="" /></a>'. "\n";
|
||||
|
||||
// Prepare Hide/Show icon state
|
||||
$hide_show = 'hide';
|
||||
@ -808,14 +800,11 @@ function grade_get_icons($element, $tree) {
|
||||
$hide_show = 'show';
|
||||
}
|
||||
|
||||
// Display Hide/Show icon
|
||||
$html .= '<a href="report.php?report=grader&target='.$eid
|
||||
. "&action=$hide_show$tree->commonvars\">\n";
|
||||
$html .= '<img src="'.$CFG->pixpath.'/t/'.$hide_show.'.gif" class="iconsmall" alt="'
|
||||
.${'str' . $hide_show}.'" title="'.${'str' . $hide_show}.'" /></a>'. "\n";
|
||||
}
|
||||
$show_hide_icon = '<a href="report.php?report=grader&target='.$eid
|
||||
. "&action=$hide_show$tree->commonvars\">\n"
|
||||
. '<img src="'.$CFG->pixpath.'/t/'.$hide_show.'.gif" class="iconsmall" alt="'
|
||||
. ${'str' . $hide_show}.'" title="'.${'str' . $hide_show}.'" /></a>'. "\n";
|
||||
|
||||
if ($showlocks) {
|
||||
// Prepare lock/unlock string
|
||||
$lock_unlock = 'lock';
|
||||
if ($object->is_locked()) {
|
||||
@ -823,36 +812,76 @@ function grade_get_icons($element, $tree) {
|
||||
}
|
||||
|
||||
// Print lock/unlock icon
|
||||
$html .= '<a href="report.php?report=grader&target='.$eid
|
||||
. "&action=$lock_unlock$tree->commonvars\">\n";
|
||||
$html .= '<img src="'.$CFG->pixpath.'/t/'.$lock_unlock.'.gif" class="iconsmall" alt="'
|
||||
.${'str' . $lock_unlock}.'" title="'.${'str' . $lock_unlock}.'" /></a>'. "\n";
|
||||
}
|
||||
$lock_unlock_icon = '<a href="report.php?report=grader&target='.$eid
|
||||
. "&action=$lock_unlock$tree->commonvars\">\n"
|
||||
. '<img src="'.$CFG->pixpath.'/t/'.$lock_unlock.'.gif" class="iconsmall" alt="'
|
||||
. ${'str' . $lock_unlock}.'" title="'.${'str' . $lock_unlock}.'" /></a>'. "\n";
|
||||
|
||||
// If object is a category, display expand/contract icon
|
||||
if (get_class($object) == 'grade_category' && $aggregationview == GRADER_REPORT_AGGREGATION_VIEW_COMPACT) {
|
||||
// Prepare expand/contract string
|
||||
$expand_contract = 'switch_minus'; // Default: expanded
|
||||
|
||||
$state = get_user_preferences('grade_category_' . $object->id, GRADE_CATEGORY_EXPANDED);
|
||||
|
||||
if ($state == GRADE_CATEGORY_CONTRACTED) {
|
||||
$expand_contract = 'switch_plus';
|
||||
}
|
||||
|
||||
$html .= '<a href="report.php?report=grader&target=' . $eid
|
||||
. "&action=$expand_contract$tree->commonvars\">\n";
|
||||
$html .= '<img src="'.$CFG->pixpath.'/t/'.$expand_contract.'.gif" class="iconsmall" alt="'
|
||||
.${'str' . $expand_contract}.'" title="'.${'str' . $expand_contract}.'" /></a>'. "\n";
|
||||
$contract_expand_icon = '<a href="report.php?report=grader&target=' . $eid
|
||||
. "&action=$expand_contract$tree->commonvars\">\n"
|
||||
. '<img src="'.$CFG->pixpath.'/t/'.$expand_contract.'.gif" class="iconsmall" alt="'
|
||||
. ${'str' . $expand_contract}.'" title="'.${'str' . $expand_contract}.'" /></a>'. "\n";
|
||||
|
||||
// If an array of icon names is given, return only these in the order they are given
|
||||
if (!empty($icons) && is_array($icons)) {
|
||||
$new_html = '';
|
||||
|
||||
foreach ($icons as $icon_name) {
|
||||
if ($icon_name == 'edit') {
|
||||
$icon_name .= "_$type";
|
||||
}
|
||||
if ($limit) {
|
||||
$new_html .= ${$icon_name . '_icon'};
|
||||
} else {
|
||||
${'show_' . $icon_name} = false;
|
||||
}
|
||||
}
|
||||
if ($limit) {
|
||||
return $new_html;
|
||||
} else {
|
||||
$html .= $new_html;
|
||||
}
|
||||
}
|
||||
|
||||
// Icons shown when edit mode is on
|
||||
if ($USER->gradeediting) {
|
||||
// Edit icon (except for grade_grades)
|
||||
if ($type == 'category') {
|
||||
$html .= $edit_category_icon;
|
||||
|
||||
} else if ($type == 'item' or $type == 'courseitem' or $type == 'categoryitem') {
|
||||
$html .= $edit_item_icon;
|
||||
}
|
||||
|
||||
// Calculation icon for items and categories
|
||||
if ($showcalculations && $type != 'grade') {
|
||||
$html .= $edit_calculation_icon;
|
||||
}
|
||||
|
||||
if ($showeyecons) {
|
||||
$html .= $show_hide_icon;
|
||||
}
|
||||
|
||||
if ($showlocks) {
|
||||
$html .= $lock_unlock_icon;
|
||||
}
|
||||
|
||||
// If object is a category, display expand/contract icon
|
||||
if (get_class($object) == 'grade_category' && $aggregationview == GRADER_REPORT_AGGREGATION_VIEW_COMPACT) {
|
||||
$html .= $contract_expand_icon;
|
||||
}
|
||||
} else { // Editing mode is off
|
||||
if ($shownotes) {
|
||||
if ($showfeedback) {
|
||||
// Display view feedback icon
|
||||
if (!empty($object->feedback)) {
|
||||
$html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
||||
. "&action=view&courseid=$object->courseid\">\n";
|
||||
$html .= '<img onmouseover="return overlib(\''.$object->feedback.'\', CAPTION, \''
|
||||
. $strfeedback.'\');" onmouseout="return nd();" '
|
||||
. 'src="'.$CFG->pixpath.'/t/feedback.gif" class="iconsmall" alt="" /></a>'. "\n";
|
||||
$html .= $view_feedback_icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2007070900; // YYYYMMDD = date
|
||||
$version = 2007070902; // YYYYMMDD = date
|
||||
// XY = increments within a single day
|
||||
|
||||
$release = '1.9 dev'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user