Merge branch 'wip-mdl-34777' of git://github.com/rajeshtaneja/moodle

This commit is contained in:
Dan Poltawski
2012-10-31 09:59:44 +08:00
10 changed files with 74 additions and 24 deletions
+39 -12
View File
@@ -373,12 +373,16 @@ class grade_edit_tree {
if ((($aggcoef == 'aggregationcoefweight' || $aggcoef == 'aggregationcoef') && $type == 'weight') ||
($aggcoef == 'aggregationcoefextraweight' && $type == 'extra')) {
return '<input type="text" size="6" id="aggregationcoef_'.$item->id.'" name="aggregationcoef_'.$item->id.'"
return '<label class="accesshide" for="aggregationcoef_'.$item->id.'">'.
get_string('extracreditvalue', 'grades', $item->itemname).'</label>'.
'<input type="text" size="6" id="aggregationcoef_'.$item->id.'" name="aggregationcoef_'.$item->id.'"
value="'.grade_edit_tree::format_number($item->aggregationcoef).'" />';
} elseif ($aggcoef == 'aggregationcoefextrasum' && $type == 'extra') {
$checked = ($item->aggregationcoef > 0) ? 'checked="checked"' : '';
return '<input type="hidden" name="extracredit_'.$item->id.'" value="0" />
<input type="checkbox" id="extracredit_'.$item->id.'" name="extracredit_'.$item->id.'" value="1" '."$checked />\n";
<label class="accesshide" for="extracredit_'.$item->id.'">'.
get_string('extracreditvalue', 'grades', $item->itemname).'</label>
<input type="checkbox" id="extracredit_'.$item->id.'" name="extracredit_'.$item->id.'" value="1" '."$checked />\n";
} else {
return '';
}
@@ -811,7 +815,9 @@ class grade_edit_tree_column_range extends grade_edit_tree_column {
} elseif ($item->is_external_item()) {
$grademax = format_float($item->grademax, $item->get_decimals());
} else {
$grademax = '<input type="text" size="6" id="grademax'.$item->id.'" name="grademax_'.$item->id.'" value="'.format_float($item->grademax, $item->get_decimals()).'" />';
$grademax = '<label class="accesshide" for="grademax'.$item->id.'">'.get_string('grademax', 'grades').'</label>
<input type="text" size="6" id="grademax'.$item->id.'" name="grademax_'.$item->id.'" value="'.
format_float($item->grademax, $item->get_decimals()).'" />';
}
$itemcell = clone($this->itemcell);
@@ -847,7 +853,10 @@ class grade_edit_tree_column_aggregateonlygraded extends grade_edit_tree_column_
public function get_category_cell($category, $levelclass, $params) {
$onlygradedcheck = ($category->aggregateonlygraded == 1) ? 'checked="checked"' : '';
$hidden = '<input type="hidden" name="aggregateonlygraded_'.$category->id.'" value="0" />';
$aggregateonlygraded ='<input type="checkbox" id="aggregateonlygraded_'.$category->id.'" name="aggregateonlygraded_'.$category->id.'" value="1" '.$onlygradedcheck . ' />';
$aggregateonlygraded = '<label class="accesshide" for="aggregateonlygraded_'.$category->id.'">'.
get_string('aggregateonlygraded', 'grades').'</label>
<input type="checkbox" id="aggregateonlygraded_'.$category->id.'" name="aggregateonlygraded_'.
$category->id.'" value="1" '.$onlygradedcheck . ' />';
if ($this->forced) {
$aggregateonlygraded = ($category->aggregateonlygraded) ? get_string('yes') : get_string('no');
@@ -884,7 +893,10 @@ class grade_edit_tree_column_aggregatesubcats extends grade_edit_tree_column_cat
public function get_category_cell($category, $levelclass, $params) {
$subcatscheck = ($category->aggregatesubcats == 1) ? 'checked="checked"' : '';
$hidden = '<input type="hidden" name="aggregatesubcats_'.$category->id.'" value="0" />';
$aggregatesubcats = '<input type="checkbox" id="aggregatesubcats_'.$category->id.'" name="aggregatesubcats_'.$category->id.'" value="1" ' . $subcatscheck.' />';
$aggregatesubcats = '<label class="accesshide" for="aggregatesubcats_'.$category->id.'">'.
get_string('aggregatesubcats', 'grades').'</label>
<input type="checkbox" id="aggregatesubcats_'.$category->id.'" name="aggregatesubcats_'.$category->id.
'" value="1" ' . $subcatscheck.' />';
if ($this->forced) {
$aggregatesubcats = ($category->aggregatesubcats) ? get_string('yes') : get_string('no');
@@ -922,7 +934,10 @@ class grade_edit_tree_column_aggregateoutcomes extends grade_edit_tree_column_ca
public function get_category_cell($category, $levelclass, $params) {
$outcomescheck = ($category->aggregateoutcomes == 1) ? 'checked="checked"' : '';
$hidden = '<input type="hidden" name="aggregateoutcomes_'.$category->id.'" value="0" />';
$aggregateoutcomes = '<input type="checkbox" id="aggregateoutcomes_'.$category->id.'" name="aggregateoutcomes_'.$category->id.'" value="1" ' . $outcomescheck.' />';
$aggregateoutcomes = '<label class="accesshide" for="aggregateoutcomes_'.$category->id.'">'.
get_string('aggregateoutcomes', 'grades').'</label>
<input type="checkbox" id="aggregateoutcomes_'.$category->id.'" name="aggregateoutcomes_'.$category->id.
'" value="1" ' . $outcomescheck.' />';
if ($this->forced) {
$aggregateoutcomes = ($category->aggregateoutcomes) ? get_string('yes') : get_string('no');
@@ -964,7 +979,9 @@ class grade_edit_tree_column_droplow extends grade_edit_tree_column_category {
}
public function get_category_cell($category, $levelclass, $params) {
$droplow = '<input type="text" size="3" id="droplow_'.$category->id.'" name="droplow_'.$category->id.'" value="'.$category->droplow.'" />';
$droplow = '<label class="accesshide" for="droplow_' . $category->id.'">' . get_string('droplowestvalue', 'grades') . '</label>';
$droplow .= '<input type="text" size="3" id="droplow_' . $category->id . '" name="droplow_' . $category->id . '" value="'
. $category->droplow.'" />';
if ($this->forced) {
$droplow = $category->droplow;
@@ -997,7 +1014,9 @@ class grade_edit_tree_column_keephigh extends grade_edit_tree_column_category {
}
public function get_category_cell($category, $levelclass, $params) {
$keephigh = '<input type="text" size="3" id="keephigh_'.$category->id.'" name="keephigh_'.$category->id.'" value="'.$category->keephigh.'" />';
$keephigh = '<label class="accesshide" for="keephigh_'.$category->id.'">'.get_string('keephigh', 'grades').'</label>';
$keephigh .= '<input type="text" size="3" id="keephigh_'.$category->id.'" name="keephigh_'.$category->id.'" value="'.
$category->keephigh.'" />';
if ($this->forced) {
$keephigh = $category->keephigh;
@@ -1044,8 +1063,10 @@ class grade_edit_tree_column_multfactor extends grade_edit_tree_column {
$itemcell->text = '&nbsp;';
return $itemcell;
}
$multfactor = '<input type="text" size="4" id="multfactor'.$item->id.'" name="multfactor_'.$item->id.'" value="'.grade_edit_tree::format_number($item->multfactor).'" />';
$multfactor = '<label class="accesshide" for="multfactor'.$item->id.'">'.
get_string('multfactorvalue', 'grades', $item->itemname).'</label>
<input type="text" size="4" id="multfactor'.$item->id.'" name="multfactor_'.$item->id.'" value="'.
grade_edit_tree::format_number($item->multfactor).'" />';
$itemcell->text = $multfactor;
return $itemcell;
@@ -1087,7 +1108,10 @@ class grade_edit_tree_column_plusfactor extends grade_edit_tree_column {
return $itemcell;
}
$plusfactor = '<input type="text" size="4" id="plusfactor_'.$item->id.'" name="plusfactor_'.$item->id.'" value="'.grade_edit_tree::format_number($item->plusfactor).'" />';
$plusfactor = '<label class="accesshide" for="plusfactor_'. $item->id . '">'.
get_string('plusfactorvalue', 'grades', $item->itemname).'</label>
<input type="text" size="4" id="plusfactor_'.$item->id.'" name="plusfactor_'.$item->id.'" value="'.
grade_edit_tree::format_number($item->plusfactor).'" />';
$itemcell->text = $plusfactor;
return $itemcell;
@@ -1175,7 +1199,10 @@ class grade_edit_tree_column_select extends grade_edit_tree_column {
$itemselect = '';
if ($params['itemtype'] != 'course' && $params['itemtype'] != 'category') {
$itemselect = '<input class="itemselect" type="checkbox" name="select_'.$params['eid'].'" onchange="toggleCategorySelector();"/>'; // TODO: convert to YUI handler
$itemselect = '<label class="accesshide" for="select_'.$params['eid'].'">'.
get_string('select', 'grades', $item->itemname).'</label>
<input class="itemselect" type="checkbox" name="select_'.$params['eid'].
'" onchange="toggleCategorySelector();"/>'; // TODO: convert to YUI handler
}
//html_writer::table() will wrap the item cell contents in a <TD> so don't do it here
return $itemselect;
@@ -43,6 +43,7 @@ $string['criteriondelete'] = 'Delete criterion';
$string['criterionempty'] = 'Click to edit criterion';
$string['criterionmovedown'] = 'Move down';
$string['criterionmoveup'] = 'Move up';
$string['criterionname'] = 'Criterion name';
$string['definemarkingguide'] = 'Define marking guide';
$string['description'] = 'Description';
$string['descriptionmarkers'] = 'Description for Markers';
+5 -2
View File
@@ -93,7 +93,8 @@ class gradingform_guide_renderer extends plugin_renderer_base {
'name' => '{NAME}[criteria][{CRITERION-id}][sortorder]', 'value' => $criterion['sortorder']));
$shortname = html_writer::empty_tag('input', array('type'=> 'text',
'name' => '{NAME}[criteria][{CRITERION-id}][shortname]', 'value' => htmlspecialchars($criterion['shortname'])));
'name' => '{NAME}[criteria][{CRITERION-id}][shortname]', 'value' => htmlspecialchars($criterion['shortname']),
'id ' => '{NAME}[criteria][{CRITERION-id}][shortname]'));
$shortname = html_writer::tag('div', $shortname, array('class'=>'criterionname'));
$description = html_writer::tag('textarea', htmlspecialchars($criterion['description']),
array('name' => '{NAME}[criteria][{CRITERION-id}][description]', 'cols' => '65', 'rows' => '5'));
@@ -105,7 +106,8 @@ class gradingform_guide_renderer extends plugin_renderer_base {
$maxscore = html_writer::empty_tag('input', array('type'=> 'text',
'name' => '{NAME}[criteria][{CRITERION-id}][maxscore]', 'size' => '3',
'value' => htmlspecialchars($criterion['maxscore'])));
'value' => htmlspecialchars($criterion['maxscore']),
'id' => '{NAME}[criteria][{CRITERION-id}][maxscore]'));
$maxscore = html_writer::tag('div', $maxscore, array('class'=>'criterionmaxscore'));
} else {
if ($mode == gradingform_guide_controller::DISPLAY_EDIT_FROZEN) {
@@ -194,6 +196,7 @@ class gradingform_guide_renderer extends plugin_renderer_base {
array('for'=>'{NAME}[criteria][{CRITERION-id}][score]', 'class' => $scoreclass));
$score .= html_writer::empty_tag('input', array('type'=> 'text',
'name' => '{NAME}[criteria][{CRITERION-id}][score]', 'class' => $scoreclass,
'id' => '{NAME}[criteria][{CRITERION-id}][score]',
'size' => '3', 'value' => htmlspecialchars($currentscore)));
$score .= '/'.$maxscore;
@@ -32,3 +32,5 @@ $string['grader:manage'] = 'Manage the grader report';
$string['grader:view'] = 'View the grader report';
$string['pluginname'] = 'Grader report';
$string['preferences'] = 'Grader report preferences';
$string['useractivitygrade'] = '{$a} grade';
$string['useractivityfeedback'] = '{$a} feedback';
+6 -1
View File
@@ -1034,6 +1034,9 @@ class grade_report_grader extends grade_report {
} else if ($item->gradetype != GRADE_TYPE_TEXT) { // Value type
if ($this->get_pref('quickgrading') and $grade->is_editable()) {
$value = format_float($gradeval, $decimalpoints);
$gradelabel = fullname($user) . ' ' . $item->itemname;
$itemcell->text .= '<label class="accesshide" for="grade_'.$userid.'_'.$item->id.'">'
.get_string('useractivitygrade', 'gradereport_grader', $gradelabel).'</label>';
$itemcell->text .= '<input size="6" tabindex="' . $tabindices[$item->id]['grade']
. '" type="text" class="text" title="'. $strgrade .'" name="grade_'
.$userid.'_' .$item->id.'" id="grade_'.$userid.'_'.$item->id.'" value="'.$value.'" />';
@@ -1045,7 +1048,9 @@ class grade_report_grader extends grade_report {
// If quickfeedback is on, print an input element
if ($this->get_pref('showquickfeedback') and $grade->is_editable()) {
$feedbacklabel = fullname($user) . ' ' . $item->itemname;
$itemcell->text .= '<label class="accesshide" for="feedback_'.$userid.'_'.$item->id.'">'
.get_string('useractivityfeedback', 'gradereport_grader', $feedbacklabel).'</label>';
$itemcell->text .= '<input class="quickfeedback" tabindex="' . $tabindices[$item->id]['feedback'].'" id="feedback_'.$userid.'_'.$item->id
. '" size="6" title="' . $strfeedback . '" type="text" name="feedback_'.$userid.'_'.$item->id.'" value="' . s($grade->feedback) . '" />';
}
+5
View File
@@ -150,6 +150,7 @@ $string['displayweighted'] = 'Display weighted grades';
$string['dropdown'] = 'Dropdown menu';
$string['droplow'] = 'Drop the lowest';
$string['droplow_help'] = 'This setting enables a specified number of the lowest grades to be excluded from the aggregation.';
$string['droplowestvalue'] = 'Set drop lowest grade value';
$string['dropped'] = 'Dropped';
$string['dropxlowest'] = 'Drop X lowest';
$string['dropxlowestwarning'] = 'Note: If you use drop x lowest the grading assumes that all items in the category have the same point value. If point values differ results will be unpredictable';
@@ -194,6 +195,7 @@ $string['exportsettings'] = 'Export settings';
$string['exportonlyactive'] = 'Require active enrolment';
$string['exportonlyactive_help'] = 'Only include students in the export whose enrolment has not been suspended';
$string['exportto'] = 'Export to';
$string['extracreditvalue'] = 'Extra credit value for {$a}';
$string['extracreditwarning'] = 'Note: Setting all items for a category to extra credit will effectively remove them from the grade calculation. Since there will be no point total';
$string['feedback'] = 'Feedback';
$string['feedback_help'] = 'This box enables any comments about the grade to be added.';
@@ -407,6 +409,7 @@ $string['morethanmax'] = 'The grade entered for {$a->itemname} for {$a->username
$string['moveselectedto'] = 'Move selected items to';
$string['movingelement'] = 'Moving {$a}';
$string['multfactor'] = 'Multiplicator';
$string['multfactorvalue'] = 'Multiplicator value for {$a}';
$string['multfactor_help'] = 'The multiplicator is the factor by which all grades for this grade item will be multiplied, with a maximum value of the maximum grade. For example, if the multiplicator is 2 and the maximum grade is 100, then all grades less than 50 are multiplied by 2, and all grades 50 and above are changed to 100.';
$string['mypreferences'] = 'My preferences';
$string['myreportpreferences'] = 'My report preferences';
@@ -484,6 +487,7 @@ $string['percentdescending'] = 'Sort by percent descending';
$string['percentshort'] = '%';
$string['plusfactor'] = 'Offset';
$string['plusfactor_help'] = 'The offset is a number that is added to every grade for this grade item, after the multiplicator is applied.';
$string['plusfactorvalue'] = 'Offset value for {$a}';
$string['points'] = 'points';
$string['pointsascending'] = 'Sort by points ascending';
$string['pointsdescending'] = 'Sort by points descending';
@@ -530,6 +534,7 @@ $string['savepreferences'] = 'Save preferences';
$string['scaleconfirmdelete'] = 'Are you sure you wish to delete the scale "{$a}"?';
$string['scaledpct'] = 'Scaled %';
$string['seeallcoursegrades'] = 'See all course grades';
$string['select'] = 'Select {$a}';
$string['selectalloroneuser'] = 'Select all or one user';
$string['selectauser'] = 'Select a user';
$string['selectdestination'] = 'Select destination of {$a}';
+4 -2
View File
@@ -69,8 +69,10 @@ class assign_feedback_comments extends assign_feedback_plugin {
}
}
return html_writer::tag('textarea', $commenttext, array('name'=>'quickgrade_comments_' . $userid,
'class'=>'quickgrade'));
return html_writer::tag('label', get_string('pluginname', 'assignfeedback_comments'),
array('for'=>'quickgrade_comments_' . $userid, 'class'=>'accesshide'))
. html_writer::tag('textarea', $commenttext,
array('name'=>'quickgrade_comments_' . $userid, 'id'=>'quickgrade_comments_' . $userid, 'class'=>'quickgrade'));
}
/**
+5 -4
View File
@@ -158,9 +158,8 @@ class assign_grading_table extends table_sql implements renderable {
if (!$this->is_downloading()) {
$columns[] = 'select';
$headers[] = get_string('select') .
'<div class="selectall"><input type="checkbox" name="selectall" title="' .
get_string('selectall') .
'"/></div>';
'<div class="selectall"><label class="accesshide" for="selectall">' . get_string('selectall') . '</label>
<input type="checkbox" id="selectall" name="selectall" title="' . get_string('selectall') . '"/></div>';
// We have to call this column userid so we can use userid as a default sortable column.
$columns[] = 'userid';
@@ -526,7 +525,9 @@ class assign_grading_table extends table_sql implements renderable {
* @return string
*/
function col_select(stdClass $row) {
return '<input type="checkbox" name="selectedusers" value="' . $row->userid . '"/>';
return '<label class="accesshide" for="selectuser_' . $row->userid . '">' .
get_string('selectuser', 'assign', fullname($row)) . '</label>
<input type="checkbox" id=="selectuser_' . $row->userid . 'name="selectedusers" value="' . $row->userid . '"/>';
}
/**
+2
View File
@@ -238,6 +238,7 @@ $string['scale'] = 'Scale';
$string['sendnotifications'] = 'Notify graders about submissions';
$string['sendnotifications_help'] = 'If enabled, graders (usually teachers) receive a message whenever a student submits an assignment, early, on time and late. Message methods are configurable.';
$string['selectlink'] = 'Select...';
$string['selectuser'] = 'Select {$a}';
$string['sendlatenotifications'] = 'Notify graders about late submissions';
$string['sendlatenotifications_help'] = 'If enabled, graders (usually teachers) receive a message whenever a student submits an assignment late. Message methods are configurable.';
$string['sendsubmissionreceipts'] = 'Send submission receipt to students';
@@ -301,6 +302,7 @@ $string['updatetable'] = 'Save and update table';
$string['upgradenotimplemented'] = 'Upgrade not implemented in plugin ({$a->type} {$a->subtype})';
$string['userextensiondate'] = 'Extension granted until: {$a}';
$string['userswhoneedtosubmit'] = 'Users who need to submit: {$a}';
$string['usergrade'] = 'User grade';
$string['viewfeedback'] = 'View feedback';
$string['viewfeedbackforuser'] = 'View feedback for user: {$a}';
$string['viewfullgradingpage'] = 'Open the full grading page to provide feedback';
+5 -3
View File
@@ -761,7 +761,6 @@ class assign {
$update->teamsubmissiongroupingid = $formdata->teamsubmissiongroupingid;
$update->blindmarking = $formdata->blindmarking;
$result = $DB->update_record('assign', $update);
$this->instance = $DB->get_record('assign', array('id'=>$update->id), '*', MUST_EXIST);
@@ -1028,7 +1027,9 @@ class assign {
} else {
$displaygrade = format_float($grade);
}
$o = '<input type="text" name="quickgrade_' . $userid . '" value="' . $displaygrade . '" size="6" maxlength="10" class="quickgrade"/>';
$o = '<label class="accesshide" for="quickgrade_' . $userid . '">' . get_string('usergrade', 'assign') . '</label>';
$o .= '<input type="text" id="quickgrade_' . $userid . '" name="quickgrade_' . $userid . '" value="' . $displaygrade
. '" size="6" maxlength="10" class="quickgrade"/>';
$o .= '&nbsp;/&nbsp;' . format_float($this->get_instance()->grade,2);
$o .= '<input type="hidden" name="grademodified_' . $userid . '" value="' . $modified . '"/>';
return $o;
@@ -1050,7 +1051,8 @@ class assign {
}
}
if ($editing) {
$o = '<select name="quickgrade_' . $userid . '" class="quickgrade">';
$o = '<label class="accesshide" for="quickgrade_' . $userid . '">' . get_string('usergrade', 'assign') . '</label>';
$o .= '<select name="quickgrade_' . $userid . '" class="quickgrade">';
$o .= '<option value="-1">' . get_string('nograde') . '</option>';
foreach ($this->cache['scale'] as $optionid => $option) {
$selected = '';