mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
fixing broken headers
This commit is contained in:
parent
b9dba084ea
commit
b263e53907
7 changed files with 76 additions and 32 deletions
|
@ -28,8 +28,12 @@ require_once('grade_export_ods.php');
|
||||||
$id = required_param('id', PARAM_INT); // course id
|
$id = required_param('id', PARAM_INT); // course id
|
||||||
$course = get_record('course', 'id', $id);
|
$course = get_record('course', 'id', $id);
|
||||||
$feedback = optional_param('feedback', '', PARAM_ALPHA);
|
$feedback = optional_param('feedback', '', PARAM_ALPHA);
|
||||||
$action = 'exportods';
|
$strgrades = get_string('grades', 'grades');
|
||||||
print_header($course->shortname.': '.get_string('grades'), $course->fullname, grade_nav($course, $action));
|
$actionstr = get_string('exportods', 'grades');
|
||||||
|
$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
|
||||||
|
$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
|
||||||
|
$gradenav .= " -> $actionstr";
|
||||||
|
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
|
||||||
// process post information
|
// process post information
|
||||||
if (($data = data_submitted()) && confirm_sesskey()) {
|
if (($data = data_submitted()) && confirm_sesskey()) {
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,12 @@ require_once('grade_export_txt.php');
|
||||||
$id = required_param('id', PARAM_INT); // course id
|
$id = required_param('id', PARAM_INT); // course id
|
||||||
$feedback = optional_param('feedback', '', PARAM_ALPHA);
|
$feedback = optional_param('feedback', '', PARAM_ALPHA);
|
||||||
$course = get_record('course', 'id', $id);
|
$course = get_record('course', 'id', $id);
|
||||||
$action = 'exporttxt'; // for printing header
|
$strgrades = get_string('grades', 'grades');
|
||||||
print_header($course->shortname.': '.get_string('grades'), $course->fullname, grade_nav($course, $action));
|
$actionstr = get_string('exporttxt', 'grades');
|
||||||
|
$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
|
||||||
|
$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
|
||||||
|
$gradenav .= " -> $actionstr";
|
||||||
|
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
|
||||||
|
|
||||||
// process post information
|
// process post information
|
||||||
if (($data = data_submitted()) && confirm_sesskey()) {
|
if (($data = data_submitted()) && confirm_sesskey()) {
|
||||||
|
|
|
@ -29,8 +29,12 @@ $id = required_param('id', PARAM_INT); // course id
|
||||||
$course = get_record('course', 'id', $id);
|
$course = get_record('course', 'id', $id);
|
||||||
$feedback = optional_param('feedback', '', PARAM_ALPHA);
|
$feedback = optional_param('feedback', '', PARAM_ALPHA);
|
||||||
|
|
||||||
$action = 'exporttxt';
|
$strgrades = get_string('grades', 'grades');
|
||||||
print_header($course->shortname.': '.get_string('grades'), $course->fullname, grade_nav($course, $action));
|
$actionstr = get_string('exportxls', 'grades');
|
||||||
|
$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
|
||||||
|
$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
|
||||||
|
$gradenav .= " -> $actionstr";
|
||||||
|
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
|
||||||
|
|
||||||
// process post information
|
// process post information
|
||||||
if (($data = data_submitted()) && confirm_sesskey()) {
|
if (($data = data_submitted()) && confirm_sesskey()) {
|
||||||
|
|
|
@ -29,8 +29,12 @@ $id = required_param('id', PARAM_INT); // course id
|
||||||
$course = get_record('course', 'id', $id);
|
$course = get_record('course', 'id', $id);
|
||||||
$feedback = optional_param('feedback', '', PARAM_ALPHA);
|
$feedback = optional_param('feedback', '', PARAM_ALPHA);
|
||||||
|
|
||||||
$action = 'exportxml';
|
$strgrades = get_string('grades', 'grades');
|
||||||
print_header($course->shortname.': '.get_string('grades'), $course->fullname, grade_nav($course, $action));
|
$actionstr = get_string('exportxml', 'grades');
|
||||||
|
$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
|
||||||
|
$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
|
||||||
|
$gradenav .= " -> $actionstr";
|
||||||
|
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
|
||||||
|
|
||||||
// process post information
|
// process post information
|
||||||
if (($data = data_submitted()) && confirm_sesskey()) {
|
if (($data = data_submitted()) && confirm_sesskey()) {
|
||||||
|
|
|
@ -28,8 +28,12 @@ if (isset($CFG->CSV_DELIMITER)) {
|
||||||
$csv_delimiter2 = ",";
|
$csv_delimiter2 = ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = 'importcsv';
|
$strgrades = get_string('grades', 'grades');
|
||||||
print_header($course->shortname.': '.get_string('grades'), $course->fullname, grade_nav($course, $action));
|
$actionstr = get_string('importcsv', 'grades');
|
||||||
|
$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
|
||||||
|
$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
|
||||||
|
$gradenav .= " -> $actionstr";
|
||||||
|
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
|
||||||
|
|
||||||
$mform = new grade_import_form();
|
$mform = new grade_import_form();
|
||||||
//$mform2 = new grade_import_mapping_form();
|
//$mform2 = new grade_import_mapping_form();
|
||||||
|
@ -52,6 +56,7 @@ if (($formdata = data_submitted()) && !empty($formdata->map)) {
|
||||||
error ('could not open file '.$filename);
|
error ('could not open file '.$filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$map = array();
|
||||||
// loops mapping_0, mapping_1 .. mapping_n and construct $map array
|
// loops mapping_0, mapping_1 .. mapping_n and construct $map array
|
||||||
foreach ($header as $i => $head) {
|
foreach ($header as $i => $head) {
|
||||||
$map[$i] = $formdata->{'mapping_'.$i};
|
$map[$i] = $formdata->{'mapping_'.$i};
|
||||||
|
@ -211,6 +216,14 @@ if (($formdata = data_submitted()) && !empty($formdata->map)) {
|
||||||
break 3;
|
break 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if grade item is locked if so, abort
|
||||||
|
if ($gradeitem->locked) {
|
||||||
|
$status = false;
|
||||||
|
import_cleanup($importcode);
|
||||||
|
notify(get_string('gradeitemlocked', 'grades'));
|
||||||
|
break 3;
|
||||||
|
}
|
||||||
|
|
||||||
unset($newgrade);
|
unset($newgrade);
|
||||||
$newgrade -> itemid = $gradeitem->id;
|
$newgrade -> itemid = $gradeitem->id;
|
||||||
$newgrade -> finalgrade = $value;
|
$newgrade -> finalgrade = $value;
|
||||||
|
@ -234,6 +247,18 @@ if (($formdata = data_submitted()) && !empty($formdata->map)) {
|
||||||
if (!empty($newgrades)) {
|
if (!empty($newgrades)) {
|
||||||
|
|
||||||
foreach ($newgrades as $newgrade) {
|
foreach ($newgrades as $newgrade) {
|
||||||
|
|
||||||
|
// check if grade_grades is locked and if so, abort
|
||||||
|
if ($grade_grades = new grade_grades(array('itemid'=>$newgrade->itemid, 'userid'=>$studentid))) {
|
||||||
|
if ($grade_grades->locked) {
|
||||||
|
// individual grade locked
|
||||||
|
$status = false;
|
||||||
|
import_cleanup($importcode);
|
||||||
|
notify(get_string('gradegradeslocked', 'grades'));
|
||||||
|
break 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$newgrade->import_code = $importcode;
|
$newgrade->import_code = $importcode;
|
||||||
$newgrade->userid = $studentid;
|
$newgrade->userid = $studentid;
|
||||||
if (!insert_record('grade_import_values', $newgrade)) {
|
if (!insert_record('grade_import_values', $newgrade)) {
|
||||||
|
@ -260,7 +285,6 @@ if (($formdata = data_submitted()) && !empty($formdata->map)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// at this stage if things are all ok, we commit the changes from temp table
|
/// at this stage if things are all ok, we commit the changes from temp table
|
||||||
|
|
|
@ -16,8 +16,12 @@ require_once('../lib.php');
|
||||||
require_once('../grade_import_form.php');
|
require_once('../grade_import_form.php');
|
||||||
require_once($CFG->dirroot.'/grade/lib.php');
|
require_once($CFG->dirroot.'/grade/lib.php');
|
||||||
|
|
||||||
$action = 'importxml';
|
$strgrades = get_string('grades', 'grades');
|
||||||
print_header($course->shortname.': '.get_string('grades'), $course->fullname, grade_nav($course, $action));
|
$actionstr = get_string('importxml', 'grades');
|
||||||
|
$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
|
||||||
|
$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
|
||||||
|
$gradenav .= " -> $actionstr";
|
||||||
|
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
|
||||||
|
|
||||||
$mform = new grade_import_form();
|
$mform = new grade_import_form();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue