Skip to content

Commit

Permalink
MDL-10414 Corrected tabindex order
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Jul 20, 2007
1 parent cd54510 commit c0c1e7c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions grade/report/grader/lib.php
Expand Up @@ -543,15 +543,19 @@ function get_studentshtml() {
$studentshtml = '';
$strfeedback = $this->get_lang_string("feedback");
$gradetabindex = 1;
$feedbacktabindex = 16380; // The maximum number of tabindices on 1 page is 32767
$showuserimage = $this->get_pref('showuserimage');
$numusers = count($this->users);

// Preload scale objects for items with a scaleid
$scales_list = '';
$tabindices = array();
foreach ($this->items as $item) {
if (!empty($item->scaleid)) {
$scales_list .= "$item->scaleid,";
}
$tabindices[$item->id]['grade'] = $gradetabindex;
$tabindices[$item->id]['feedback'] = $gradetabindex + $numusers;
$gradetabindex += $numusers * 2;
}
$scales_array = array();

Expand Down Expand Up @@ -632,7 +636,8 @@ function get_studentshtml() {
$studentshtml .= '<input type="hidden" name="oldgrade_'.$userid.'_'
.$item->id.'" value="'.$gradeval.'"/>';
$studentshtml .= choose_from_menu($scaleopt, 'grade_'.$userid.'_'.$item->id,
$gradeval, $this->get_lang_string('nograde'), '', '-1', true, false, $gradetabindex++);
$gradeval, $this->get_lang_string('nograde'), '', '-1',
true, false, $tabindices[$item->id]['grade']);
} elseif(!empty($scale)) {
$scales = explode(",", $scale->scale);

Expand All @@ -650,8 +655,8 @@ function get_studentshtml() {
if ($this->get_pref('quickgrading') and $grade->is_editable()) {
$value = $this->get_grade_clean($gradeval, $decimalpoints);
$studentshtml .= '<input type="hidden" name="oldgrade_'.$userid.'_'.$item->id.'" value="'.$value.'" />';
$studentshtml .= '<input size="6" tabindex="' . $gradetabindex++ . '" type="text" name="grade_'.$userid.'_'
.$item->id.'" value="'.$value.'" />';
$studentshtml .= '<input size="6" tabindex="' . $tabindices[$item->id]['grade'] . '" type="text" name="grade_'
.$userid.'_' .$item->id.'" value="'.$value.'" />';
} else {
$studentshtml .= $this->get_grade_clean($gradeval, $decimalpoints);
}
Expand All @@ -665,7 +670,7 @@ function get_studentshtml() {
}
$studentshtml .= '<input type="hidden" name="oldfeedback_'
.$userid.'_'.$item->id.'" value="' . s($grade->feedback) . '" />';
$studentshtml .= '<input tabindex="' . $feedbacktabindex++ . '" size="6" type="text" name="feedback_'
$studentshtml .= '<input tabindex="' . $tabindices[$item->id]['feedback'] . '" size="6" type="text" name="feedback_'
.$userid.'_'.$item->id.'" value="' . s($grade->feedback) . '" />';
}

Expand Down

0 comments on commit c0c1e7c

Please sign in to comment.