commit 3327fab5a7dc0b81ae8500ead1744ee1ca5687bd Author: Ben Tindell Date: Thu May 7 12:08:52 2015 -0500 Creating patch of CSV Import Context Sensitive Help diff --git a/grade/import/grade_import_form.php b/grade/import/grade_import_form.php index 4894a08..5712bad 100644 --- a/grade/import/grade_import_form.php +++ b/grade/import/grade_import_form.php @@ -24,7 +24,7 @@ require_once($CFG->libdir.'/gradelib.php'); class grade_import_form extends moodleform { function definition (){ - global $COURSE; + global $COURSE, $OUTPUT; $mform =& $this->_form; @@ -58,17 +58,17 @@ class grade_import_form extends moodleform { $radio[] = $mform->createElement('radio', 'separator', null, get_string('sepcomma', 'grades'), 'comma'); $radio[] = $mform->createElement('radio', 'separator', null, get_string('sepcolon', 'grades'), 'colon'); $radio[] = $mform->createElement('radio', 'separator', null, get_string('sepsemicolon', 'grades'), 'semicolon'); - $mform->addGroup($radio, 'separator', get_string('separator', 'grades'), ' ', false); + $mform->addGroup($radio, 'separator', get_string('separator', 'grades').$OUTPUT->help_icon('separator','grades'), ' ', false); $mform->setDefault('separator', 'comma'); } if (!empty($features['verbosescales'])) { $options = array(1=>get_string('yes'), 0=>get_string('no')); - $mform->addElement('select', 'verbosescales', get_string('verbosescales', 'grades'), $options); + $mform->addElement('select', 'verbosescales', get_string('verbosescales', 'grades').$OUTPUT->help_icon('verbosescales','grades'), $options); } $options = array('10'=>10, '20'=>20, '100'=>100, '1000'=>1000, '100000'=>100000); - $mform->addElement('select', 'previewrows', get_string('rowpreviewnum', 'grades'), $options); // TODO: localize + $mform->addElement('select', 'previewrows', get_string('rowpreviewnum', 'grades').$OUTPUT->help_icon('rowpreviewnum','grades'), $options); // TODO: localize $mform->setType('previewrows', PARAM_INT); $mform->addElement('checkbox', 'forceimport', get_string('forceimport', 'grades')); $mform->addHelpButton('forceimport', 'forceimport', 'grades'); @@ -83,7 +83,7 @@ class grade_import_form extends moodleform { class grade_import_mapping_form extends moodleform { function definition () { - global $CFG, $COURSE; + global $CFG, $COURSE, $OUTPUT; $mform =& $this->_form; // this is an array of headers @@ -98,7 +98,7 @@ class grade_import_mapping_form extends moodleform { $mapfromoptions[$i] = s($h); } } - $mform->addElement('select', 'mapfrom', get_string('mapfrom', 'grades'), $mapfromoptions); + $mform->addElement('select', 'mapfrom', get_string('mapfrom', 'grades').$OUTPUT->help_icon('mapfrom', 'grades'), $mapfromoptions); $maptooptions = array( 'userid' => get_string('userid', 'grades'), @@ -107,9 +107,9 @@ class grade_import_mapping_form extends moodleform { 'useremail' => get_string('email'), '0' => get_string('ignore', 'grades') ); - $mform->addElement('select', 'mapto', get_string('mapto', 'grades'), $maptooptions); + $mform->addElement('select', 'mapto', get_string('mapto', 'grades').$OUTPUT->help_icon('mapto', 'grades'), $maptooptions); - $mform->addElement('header', 'general', get_string('mappings', 'grades')); + $mform->addElement('header', 'general', get_string('mappings', 'grades').$OUTPUT->help_icon('mappings', 'grades')); // Add a feedback option. $feedbacks = array(); diff --git a/lang/en/grades.php b/lang/en/grades.php index 23b7b23..a68d6dd 100644 --- a/lang/en/grades.php +++ b/lang/en/grades.php @@ -431,8 +431,11 @@ $string['managegradereport'] = 'Report item order'; //End 20140206 $string['manualitem'] = 'Manual item'; $string['mapfrom'] = 'Map from'; +$string['mapfrom_help'] = 'Select the column from the provided spreadsheet that contains information to distinguish the grades pertaining to one user from those of another user.'; $string['mappings'] = 'Grade item mappings'; +$string['mappings_help'] = 'Each column in the provided spreadsheet is represented below as a string of text with a select box next to it. For the column(s) that you would like to import into the gradebook, select the column in the gradebook that you would like to override. In example, if you have a column in your spreadsheet called Project #1 with the grades that you would like to be placed under the first assignment in the gradebook, select that assignment in the dropdown next to "Project #1".'; $string['mapto'] = 'Map to'; +$string['mapto_help'] = 'Select the user information contained in Moodle to match the identifying information selected in "Map to:". If you selected a column that contains the user\'s full name, select "Username", if you selected a column that contains the user\'s email address, select "Email address", and so on.'; $string['max'] = 'Highest'; $string['maxgrade'] = 'Max grade'; $string['meanall'] = 'All grades'; @@ -589,6 +592,7 @@ $string['resetweightsshort'] = 'Reset weights'; $string['resetweights'] = 'Reset weights of {$a->itemname}'; $string['respectingcurrentdata'] = 'leaving current configuration unmodified'; $string['rowpreviewnum'] = 'Preview rows'; +$string['rowpreviewnum_help'] = 'Sets the number of rows that are available during the preview step of the pasted data. The preview step allows the user to ensure that tthe data was interpreted correctly.'; $string['savechanges'] = 'Save changes'; $string['savepreferences'] = 'Save preferences'; $string['scaleconfirmdelete'] = 'Are you sure you wish to delete the scale "{$a}"?'; @@ -599,6 +603,7 @@ $string['selectalloroneuser'] = 'Select all or one user'; $string['selectauser'] = 'Select a user'; $string['selectdestination'] = 'Select destination of {$a}'; $string['separator'] = 'Separator'; +$string['separator_help'] = 'If you are importing a .csv file, select “Comma”. If you are importing any other file, make sure that the data is separated by a tab, a comma, a colon, or a semicolon and select that option.'; $string['sepcolon'] = 'Colon'; $string['sepcomma'] = 'Comma'; $string['sepsemicolon'] = 'Semicolon'; @@ -731,6 +736,7 @@ $string['userpreferences'] = 'User preferences'; $string['userenrolmentsuspended'] = 'User enrolment suspended'; $string['useweighted'] = 'Use weighted'; $string['verbosescales'] = 'Verbose scales'; +$string['verbosescales_help'] = 'Verbose scales is for importing grades that have non-numeric grading scales (Pass/Fail, Satisfactory, etc.). Having it on will not affect numeric scores. Turning this setting off will prevent any scores from being updated that do not have numeric values, even if the grading type is a non-numeric scale.'; $string['viewbygroup'] = 'Group'; $string['viewgrades'] = 'View grades'; $string['weight'] = 'weight';