Skip to content

Commit

Permalink
Merge branch 'wip-mdl-34777' of git://github.com/rajeshtaneja/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Oct 31, 2012
2 parents eecddb8 + 7400be1 commit 8120a4f
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 24 deletions.
51 changes: 39 additions & 12 deletions grade/edit/tree/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,16 @@ static function get_weight_input($item, $type) {

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 '';
}
Expand Down Expand Up @@ -811,7 +815,9 @@ public function get_item_cell($item, $params) {
} 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);
Expand Down Expand Up @@ -847,7 +853,10 @@ public function get_header_cell() {
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');
Expand Down Expand Up @@ -884,7 +893,10 @@ public function get_header_cell() {
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');
Expand Down Expand Up @@ -922,7 +934,10 @@ public function get_header_cell() {
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');
Expand Down Expand Up @@ -964,7 +979,9 @@ public function get_header_cell() {
}

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;
Expand Down Expand Up @@ -997,7 +1014,9 @@ public function get_header_cell() {
}

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;
Expand Down Expand Up @@ -1044,8 +1063,10 @@ public function get_item_cell($item, $params) {
$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;
Expand Down Expand Up @@ -1087,7 +1108,10 @@ public function get_item_cell($item, $params) {
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;
Expand Down Expand Up @@ -1175,7 +1199,10 @@ public function get_item_cell($item, $params) {
$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;
Expand Down
1 change: 1 addition & 0 deletions grade/grading/form/guide/lang/en/gradingform_guide.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
$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';
Expand Down
7 changes: 5 additions & 2 deletions grade/grading/form/guide/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public function criterion_template($mode, $options, $elementname = '{NAME}', $cr
'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'));
Expand All @@ -105,7 +106,8 @@ public function criterion_template($mode, $options, $elementname = '{NAME}', $cr

$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) {
Expand Down Expand Up @@ -194,6 +196,7 @@ public function criterion_template($mode, $options, $elementname = '{NAME}', $cr
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;

Expand Down
2 changes: 2 additions & 0 deletions grade/report/grader/lang/en/gradereport_grader.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@
$string['grader:view'] = 'View the grader report';
$string['pluginname'] = 'Grader report';
$string['preferences'] = 'Grader report preferences';
$string['useractivitygrade'] = '{$a} grade';
$string['useractivityfeedback'] = '{$a} feedback';
7 changes: 6 additions & 1 deletion grade/report/grader/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,9 @@ public function get_right_rows() {
} 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.'" />';
Expand All @@ -1045,7 +1048,9 @@ public function get_right_rows() {

// 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) . '" />';
}
Expand Down
5 changes: 5 additions & 0 deletions lang/en/grades.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
$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';
Expand Down Expand Up @@ -194,6 +195,7 @@
$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.';
Expand Down Expand Up @@ -407,6 +409,7 @@
$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';
Expand Down Expand Up @@ -484,6 +487,7 @@
$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';
Expand Down Expand Up @@ -530,6 +534,7 @@
$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}';
Expand Down
6 changes: 4 additions & 2 deletions mod/assign/feedback/comments/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ public function get_quickgrading_html($userid, $grade) {
}
}

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'));
}

/**
Expand Down
9 changes: 5 additions & 4 deletions mod/assign/gradingtable.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ public function __construct(assign $assignment, $perpage, $filter, $rowoffset, $
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';
Expand Down Expand Up @@ -526,7 +525,9 @@ function col_fullname($row) {
* @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 . '"/>';
}

/**
Expand Down
2 changes: 2 additions & 0 deletions mod/assign/lang/en/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
$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';
Expand Down Expand Up @@ -301,6 +302,7 @@
$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';
Expand Down
Loading

0 comments on commit 8120a4f

Please sign in to comment.