|
@@ -20,6 +20,7 @@ require_once($CFG->libdir.'/filelib.php');
|
|
require_once('locallib.php');
|
|
require_once('locallib.php');
|
|
require_once('libs/student_viewlib.php');
|
|
require_once('libs/student_viewlib.php');
|
|
require_once('libs/teacher_viewlib.php');
|
|
require_once('libs/teacher_viewlib.php');
|
|
|
|
+require_once('libs/locallib.php');
|
|
|
|
|
|
global $DB;
|
|
global $DB;
|
|
$id = optional_param('id', 0, PARAM_INT); // Course_module ID.
|
|
$id = optional_param('id', 0, PARAM_INT); // Course_module ID.
|
|
@@ -27,6 +28,7 @@ $g = optional_param('g', 0, PARAM_INT); // Gradeimporter instance ID, should b
|
|
$action = optional_param('action', 0, PARAM_INT);
|
|
$action = optional_param('action', 0, PARAM_INT);
|
|
$fileid = optional_param('fileid', 0, PARAM_INT);
|
|
$fileid = optional_param('fileid', 0, PARAM_INT);
|
|
$filename = optional_param('filename', 'a', PARAM_TEXT);
|
|
$filename = optional_param('filename', 'a', PARAM_TEXT);
|
|
|
|
+$edit = optional_param('edit', 0, PARAM_INT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -76,12 +78,13 @@ if ($action == 1 && has_capability('mod/gradeimporter:view', $context)) {
|
|
exportcsv($context);
|
|
exportcsv($context);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// Print the page header.
|
|
// Print the page header.
|
|
$PAGE->set_cm($cm);
|
|
$PAGE->set_cm($cm);
|
|
$PAGE->set_url('/mod/gradeimporter/view.php', array('id' => $cm->id));
|
|
$PAGE->set_url('/mod/gradeimporter/view.php', array('id' => $cm->id));
|
|
$PAGE->set_title(format_string($gradeimporter->name));
|
|
$PAGE->set_title(format_string($gradeimporter->name));
|
|
$PAGE->set_heading(format_string($course->fullname));
|
|
$PAGE->set_heading(format_string($course->fullname));
|
|
|
|
+$button = $OUTPUT->render(get_editing_button($id, $edit));
|
|
|
|
+$PAGE->set_button($button);
|
|
$PAGE->set_context($context);
|
|
$PAGE->set_context($context);
|
|
|
|
|
|
$output = $PAGE->get_renderer('mod_folder');
|
|
$output = $PAGE->get_renderer('mod_folder');
|
|
@@ -110,6 +113,7 @@ if (has_capability('mod/gradeimporter:edit', $context)) {
|
|
'<input type="submit" Value="'.get_string('downloadconfigcsv', 'gradeimporter').'" />'.
|
|
'<input type="submit" Value="'.get_string('downloadconfigcsv', 'gradeimporter').'" />'.
|
|
'</form>';
|
|
'</form>';
|
|
echo $newbutton;
|
|
echo $newbutton;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
// Tabela com as notas vem aqui.
|
|
// Tabela com as notas vem aqui.
|
|
@@ -120,7 +124,7 @@ require_once(dirname(__FILE__).'/locallib.php');
|
|
if (has_capability('mod/gradeimporter:edit', $context)) {
|
|
if (has_capability('mod/gradeimporter:edit', $context)) {
|
|
// Loads teacher view.
|
|
// Loads teacher view.
|
|
// get_teacher_view($cm->id, $gradeimporter->id);
|
|
// get_teacher_view($cm->id, $gradeimporter->id);
|
|
- $teacherview = new Teacherview($cm->id, $gradeimporter->id);
|
|
|
|
|
|
+ $teacherview = new Teacherview($cm->id, $gradeimporter->id, $edit);
|
|
$teachertable = $teacherview->make_table();
|
|
$teachertable = $teacherview->make_table();
|
|
echo $teachertable;
|
|
echo $teachertable;
|
|
} else {
|
|
} else {
|