MDL-19797 Upgraded calls to choose_from_menu

This commit is contained in:
nicolasconnault 2009-08-17 15:19:06 +00:00
parent 2c5c7029fe
commit 698c31e100
2 changed files with 5 additions and 6 deletions

View File

@ -83,10 +83,8 @@ class grade_import_mapping_form extends moodleform {
}
}
$mform->addElement('select', 'mapfrom', get_string('mapfrom', 'grades'), $mapfromoptions);
//choose_from_menu($mapfromoptions, 'mapfrom');
$maptooptions = array('userid'=>'userid', 'username'=>'username', 'useridnumber'=>'useridnumber', 'useremail'=>'useremail', '0'=>'ignore');
//choose_from_menu($maptooptions, 'mapto');
$mform->addElement('select', 'mapto', get_string('mapto', 'grades'), $maptooptions);
$mform->addElement('header', 'general', get_string('mappings', 'grades'));

View File

@ -687,7 +687,7 @@ class grade_report_grader extends grade_report {
* @return string HTML
*/
public function get_studentshtml() {
global $CFG, $USER, $DB;
global $CFG, $USER, $DB, $OUTPUT;
$studentshtml = '';
$strfeedback = $this->get_lang_string("feedback");
@ -866,9 +866,10 @@ class grade_report_grader extends grade_report {
}
$studentshtml .= '<input type="hidden" name="oldgrade_'.$userid.'_'
.$item->id.'" value="'.$oldval.'"/>';
$studentshtml .= choose_from_menu($scaleopt, 'grade_'.$userid.'_'.$item->id,
$gradeval, $nogradestr, '', '-1',
true, false, $tabindices[$item->id]['grade']);
$select = html_select::make($scaleopt, 'grade_'.$userid.'_'.$item->id,$gradeval, $nogradestr);
$select->nothingvalue = '-1';
$select->tabindex = $tabindices[$item->id]['grade'];
$studentshtml .= $OUTPUT->select($select);
} elseif(!empty($scale)) {
$scales = explode(",", $scale->scale);