Skip to content

Commit

Permalink
MDL-50834 gradebook: Add help text and link to xml grade import
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neis Araujo authored and danielneis committed Jul 24, 2015
1 parent d846254 commit 9de0c83
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions grade/import/xml/grade_import_form.php
Expand Up @@ -56,6 +56,7 @@ function definition () {
$mform->addElement('text', 'url', get_string('fileurl', 'gradeimport_xml'), 'size="80"');
$mform->setType('url', PARAM_URL);
$mform->disabledIf('url', 'userfile', 'noteq', '');
$mform->addHelpButton('url', 'fileurl', 'gradeimport_xml');

if (!empty($CFG->gradepublishing)) {
$mform->addElement('header', 'publishing', get_string('publishing', 'grades'));
Expand Down
11 changes: 6 additions & 5 deletions grade/import/xml/index.php
Expand Up @@ -51,7 +51,8 @@
raise_memory_limit(MEMORY_EXTRA);

if ($text = $mform->get_file_content('userfile')) {
print_grade_page_head($COURSE->id, 'import', 'xml', get_string('importxml', 'grades'));
print_grade_page_head($COURSE->id, 'import', 'xml',
get_string('importxml', 'grades'), false, false, true, 'importxml', 'gradeimport_xml');

$error = '';
$importcode = import_xml_grades($text, $course, $error);
Expand All @@ -74,7 +75,8 @@
$data->key = create_user_key('grade/import', $USER->id, $course->id, $data->iprestriction, $data->validuntil);
}

print_grade_page_head($COURSE->id, 'import', 'xml', get_string('importxml', 'grades'));
print_grade_page_head($COURSE->id, 'import', 'xml',
get_string('importxml', 'grades'), false, false, true, 'importxml', 'gradeimport_xml');

echo '<div class="gradeexportlink">';
$link = $CFG->wwwroot.'/grade/import/xml/fetch.php?id='.$id.'&amp;feedback='.(int)($data->feedback).'&amp;url='.urlencode($data->url).'&amp;key='.$data->key;
Expand All @@ -85,10 +87,9 @@
}
}

print_grade_page_head($COURSE->id, 'import', 'xml', get_string('importxml', 'grades'));
print_grade_page_head($COURSE->id, 'import', 'xml',
get_string('importxml', 'grades'), false, false, true, 'importxml', 'gradeimport_xml');

$mform->display();

echo $OUTPUT->footer();


4 changes: 4 additions & 0 deletions grade/import/xml/lang/en/gradeimport_xml.php
Expand Up @@ -32,6 +32,10 @@
$string['error'] = 'Errors occur';
$string['errorduringimport'] = 'An error occurred when trying to import: {$a}';
$string['fileurl'] = 'Remote file URL';
$string['fileurl_help'] = 'The remote file URL field is for fetching data from a remote server, such as a student information system.';
$string['pluginname'] = 'XML file';
$string['xml:publish'] = 'Publish import grades from XML';
$string['xml:view'] = 'Import grades from XML';
$string['importxml'] = 'XML import';
$string['importxml_help'] = 'Grades can be imported via an XML file containing user ID numbers and activity ID numbers. To obtain the correct format, first export some grades to XML file then view the file.';
$string['importxml_link'] = 'grade/import/xml/index';
1 change: 1 addition & 0 deletions lang/en/grades.php
Expand Up @@ -385,6 +385,7 @@
* A fieldname containing user identity data is required - either username or ID number or email address
A file of the correct format can be obtained by first exporting some grades. The file can then be edited and saved as a CSV file.';
$string['importcsv_link'] = 'grade/import/csv/index';
$string['importcustom'] = 'Import as custom outcomes (only this course)';
$string['importerror'] = 'An error occurred, this script wasn\'t called with the right parameters.';
$string['importfailed'] = 'Import failed. No data was imported.';
Expand Down

0 comments on commit 9de0c83

Please sign in to comment.