2009-07-07 02:26:36 +00:00
|
|
|
<?php
|
2007-05-30 08:48:11 +00:00
|
|
|
|
2009-07-07 02:26:36 +00:00
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-08-24 15:10:36 +00:00
|
|
|
/**
|
|
|
|
* Edit and review page for grade categories and items.
|
|
|
|
*
|
|
|
|
* @package moodlecore
|
|
|
|
* @copyright 2008 Nicolas Connault
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
|
|
|
|
2007-07-29 23:02:03 +00:00
|
|
|
require_once '../../../config.php';
|
2007-07-16 18:58:09 +00:00
|
|
|
require_once $CFG->dirroot.'/grade/lib.php';
|
2007-08-06 09:01:18 +00:00
|
|
|
require_once $CFG->dirroot.'/grade/report/lib.php'; // for preferences
|
2009-02-09 10:49:41 +00:00
|
|
|
require_once $CFG->dirroot.'/grade/edit/tree/lib.php';
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-06-15 05:37:57 +00:00
|
|
|
$PAGE->requires->yui_lib('event');
|
|
|
|
$PAGE->requires->yui_lib('json');
|
|
|
|
$PAGE->requires->yui_lib('connection');
|
|
|
|
$PAGE->requires->yui_lib('dragdrop');
|
|
|
|
$PAGE->requires->yui_lib('element');
|
|
|
|
$PAGE->requires->yui_lib('container');
|
|
|
|
$PAGE->requires->yui_lib('animation');
|
|
|
|
$PAGE->requires->js('grade/edit/tree/functions.js');
|
2009-08-24 15:10:36 +00:00
|
|
|
$PAGE->requires->css('/grade/edit/tree/tree.css');
|
2007-06-26 07:45:40 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
$courseid = required_param('id', PARAM_INT);
|
|
|
|
$action = optional_param('action', 0, PARAM_ALPHA);
|
|
|
|
$eid = optional_param('eid', 0, PARAM_ALPHANUM);
|
|
|
|
$category = optional_param('category', null, PARAM_INT);
|
|
|
|
$aggregationtype = optional_param('aggregationtype', null, PARAM_INT);
|
|
|
|
$showadvanced = optional_param('showadvanced', -1, PARAM_BOOL); // sticky editting mode
|
2007-05-30 08:48:11 +00:00
|
|
|
|
2009-08-24 15:10:36 +00:00
|
|
|
$PAGE->set_url('grade/edit/tree/index.php', array('id' => $courseid));
|
|
|
|
|
2007-06-25 09:37:26 +00:00
|
|
|
/// Make sure they can even access this course
|
2008-11-20 15:44:36 +00:00
|
|
|
if (!$course = $DB->get_record('course', array('id' => $courseid))) {
|
2007-07-23 15:38:31 +00:00
|
|
|
print_error('nocourseid');
|
2007-06-25 09:37:26 +00:00
|
|
|
}
|
|
|
|
|
2007-06-30 21:12:47 +00:00
|
|
|
require_login($course);
|
2007-06-25 09:37:26 +00:00
|
|
|
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
2007-07-24 07:45:15 +00:00
|
|
|
require_capability('moodle/grade:manage', $context);
|
|
|
|
|
|
|
|
/// return tracking object
|
2007-07-29 23:02:03 +00:00
|
|
|
$gpr = new grade_plugin_return(array('type'=>'edit', 'plugin'=>'tree', 'courseid'=>$courseid));
|
2007-07-24 07:45:15 +00:00
|
|
|
$returnurl = $gpr->get_return_url(null);
|
2007-06-25 09:37:26 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
/// Build editing on/off buttons
|
|
|
|
if (!isset($USER->gradeediting)) {
|
|
|
|
$USER->gradeediting = array();
|
|
|
|
}
|
|
|
|
|
|
|
|
$current_view = '';
|
|
|
|
|
|
|
|
if (has_capability('moodle/grade:manage', $context)) {
|
|
|
|
if (!isset($USER->gradeediting[$course->id])) {
|
|
|
|
$USER->gradeediting[$course->id] = 0;
|
|
|
|
}
|
|
|
|
|
2009-05-30 13:01:20 +00:00
|
|
|
if ($showadvanced == 1) {
|
2009-02-09 10:49:41 +00:00
|
|
|
$USER->gradeediting[$course->id] = 1;
|
2009-05-30 13:01:20 +00:00
|
|
|
} else if ($showadvanced == 0) {
|
2009-02-09 10:49:41 +00:00
|
|
|
$USER->gradeediting[$course->id] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// page params for the turn editting on
|
|
|
|
$options = $gpr->get_options();
|
|
|
|
$options['sesskey'] = sesskey();
|
|
|
|
|
|
|
|
if ($USER->gradeediting[$course->id]) {
|
|
|
|
$options['showadvanced'] = 0;
|
|
|
|
$current_view = 'fullview';
|
|
|
|
} else {
|
|
|
|
$options['showadvanced'] = 1;
|
|
|
|
$current_view = 'simpleview';
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$USER->gradeediting[$course->id] = 0;
|
|
|
|
$buttons = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
// Change category aggregation if requested
|
2009-04-16 07:16:44 +00:00
|
|
|
if (!is_null($category) && !is_null($aggregationtype) && confirm_sesskey()) {
|
2009-02-09 10:49:41 +00:00
|
|
|
if (!$grade_category = grade_category::fetch(array('id'=>$category, 'courseid'=>$courseid))) {
|
|
|
|
error('Incorrect category id!');
|
|
|
|
}
|
|
|
|
$data->aggregation = $aggregationtype;
|
|
|
|
grade_category::set_properties($grade_category, $data);
|
|
|
|
$grade_category->update();
|
2009-04-16 07:16:44 +00:00
|
|
|
grade_regrade_final_grades($courseid);
|
2009-02-09 10:49:41 +00:00
|
|
|
}
|
|
|
|
|
2007-07-24 07:45:15 +00:00
|
|
|
//first make sure we have proper final grades - we need it for locking changes
|
|
|
|
grade_regrade_final_grades($courseid);
|
2007-06-25 09:37:26 +00:00
|
|
|
|
2007-06-30 21:12:47 +00:00
|
|
|
// get the grading tree object
|
2007-07-08 19:24:41 +00:00
|
|
|
// note: total must be first for moving to work correctly, if you want it last moving code must be rewritten!
|
2007-07-13 08:59:46 +00:00
|
|
|
$gtree = new grade_tree($courseid, false, false);
|
2007-06-05 08:50:24 +00:00
|
|
|
|
2007-06-30 21:12:47 +00:00
|
|
|
if (empty($eid)) {
|
|
|
|
$element = null;
|
|
|
|
$object = null;
|
2007-05-30 08:48:11 +00:00
|
|
|
|
2007-06-30 21:12:47 +00:00
|
|
|
} else {
|
|
|
|
if (!$element = $gtree->locate_element($eid)) {
|
2008-05-14 07:24:28 +00:00
|
|
|
print_error('invalidelementid', '', $returnurl);
|
2007-06-30 21:12:47 +00:00
|
|
|
}
|
2007-07-24 07:45:15 +00:00
|
|
|
$object = $element['object'];
|
2007-06-30 21:12:47 +00:00
|
|
|
}
|
2007-06-28 13:20:30 +00:00
|
|
|
|
2007-10-08 23:09:10 +00:00
|
|
|
$switch = grade_get_setting($course->id, 'aggregationposition', $CFG->grade_aggregationposition);
|
2007-06-28 13:20:30 +00:00
|
|
|
|
2007-08-01 06:47:35 +00:00
|
|
|
$strgrades = get_string('grades');
|
|
|
|
$strgraderreport = get_string('graderreport', 'grades');
|
|
|
|
$strcategoriesedit = get_string('categoriesedit', 'grades');
|
|
|
|
$strcategoriesanditems = get_string('categoriesanditems', 'grades');
|
2007-06-28 13:20:30 +00:00
|
|
|
|
2009-09-08 01:48:37 +00:00
|
|
|
grade_build_nav(__FILE__, $strcategoriesanditems, array('courseid' => $courseid));
|
2007-06-30 21:12:47 +00:00
|
|
|
$moving = false;
|
2009-08-25 07:31:13 +00:00
|
|
|
$movingeid = false;
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-08-25 07:31:13 +00:00
|
|
|
if ($action == 'moveselect') {
|
|
|
|
if ($eid and confirm_sesskey()) {
|
|
|
|
$movingeid = $eid;
|
|
|
|
$moving=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$grade_edit_tree = new grade_edit_tree($gtree, $movingeid, $gpr);
|
2009-02-09 10:49:41 +00:00
|
|
|
|
2007-06-30 21:12:47 +00:00
|
|
|
switch ($action) {
|
|
|
|
case 'delete':
|
2009-04-16 07:16:44 +00:00
|
|
|
if ($eid && confirm_sesskey()) {
|
2009-02-09 10:49:41 +00:00
|
|
|
if (!$grade_edit_tree->element_deletable($element)) {
|
2007-12-18 17:38:22 +00:00
|
|
|
// no deleting of external activities - they would be recreated anyway!
|
2008-02-17 19:12:11 +00:00
|
|
|
// exception is activity without grading or misconfigured activities
|
2007-11-01 15:09:02 +00:00
|
|
|
break;
|
|
|
|
}
|
2007-07-05 21:40:05 +00:00
|
|
|
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
|
|
|
|
2009-05-30 13:01:20 +00:00
|
|
|
if ($confirm) {
|
2007-07-05 21:40:05 +00:00
|
|
|
$object->delete('grade/report/grader/category');
|
|
|
|
redirect($returnurl);
|
|
|
|
|
|
|
|
} else {
|
2009-09-08 01:48:37 +00:00
|
|
|
$PAGE->set_title($strgrades . ': ' . $strgraderreport);
|
|
|
|
$PAGE->set_heading(': ' . $strcategoriesedit);
|
|
|
|
echo $OUTPUT->header();
|
2007-07-05 21:40:05 +00:00
|
|
|
$strdeletecheckfull = get_string('deletecheck', '', $object->get_name());
|
|
|
|
$optionsyes = array('eid'=>$eid, 'confirm'=>1, 'sesskey'=>sesskey(), 'id'=>$course->id, 'action'=>'delete');
|
|
|
|
$optionsno = array('id'=>$course->id);
|
2009-08-20 08:40:49 +00:00
|
|
|
$formcontinue = html_form::make_button('index.php', $optionsyes, get_string('yes'));
|
|
|
|
$formcancel = html_form::make_button('index.php', $optionsno, get_string('no'), 'get');
|
|
|
|
echo $OUTPUT->confirm($strdeletecheckfull, $formcontinue, $formcancel);
|
2009-08-06 14:12:17 +00:00
|
|
|
echo $OUTPUT->footer();
|
2007-07-05 21:40:05 +00:00
|
|
|
die;
|
|
|
|
}
|
|
|
|
}
|
2007-06-30 21:12:47 +00:00
|
|
|
break;
|
|
|
|
|
2007-07-01 19:45:13 +00:00
|
|
|
case 'autosort':
|
|
|
|
//TODO: implement autosorting based on order of mods on course page, categories first, manual items last
|
|
|
|
break;
|
|
|
|
|
2007-06-30 21:12:47 +00:00
|
|
|
case 'move':
|
|
|
|
if ($eid and confirm_sesskey()) {
|
|
|
|
$moveafter = required_param('moveafter', PARAM_ALPHANUM);
|
2009-02-09 10:49:41 +00:00
|
|
|
$first = optional_param('first', false, PARAM_BOOL); // If First is set to 1, it means the target is the first child of the category $moveafter
|
|
|
|
|
2007-06-30 21:12:47 +00:00
|
|
|
if(!$after_el = $gtree->locate_element($moveafter)) {
|
2008-05-14 07:24:28 +00:00
|
|
|
print_error('invalidelementid', '', $returnurl);
|
2007-06-30 21:12:47 +00:00
|
|
|
}
|
2009-02-09 10:49:41 +00:00
|
|
|
|
2007-06-30 21:12:47 +00:00
|
|
|
$after = $after_el['object'];
|
|
|
|
$sortorder = $after->get_sortorder();
|
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
if (!$first) {
|
|
|
|
$parent = $after->get_parent_category();
|
|
|
|
$object->set_parent($parent->id);
|
|
|
|
} else {
|
|
|
|
$object->set_parent($after->id);
|
|
|
|
}
|
|
|
|
|
2007-06-30 21:12:47 +00:00
|
|
|
$object->move_after_sortorder($sortorder);
|
|
|
|
|
|
|
|
redirect($returnurl);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2007-06-28 13:20:30 +00:00
|
|
|
}
|
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
// Hide advanced columns if moving
|
|
|
|
if ($grade_edit_tree->moving) {
|
|
|
|
$original_gradeediting = $USER->gradeediting[$course->id];
|
|
|
|
$USER->gradeediting[$course->id] = 0;
|
|
|
|
}
|
2007-07-03 05:25:08 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
$current_view_str = '';
|
|
|
|
if ($current_view != '') {
|
|
|
|
if ($current_view == 'simpleview') {
|
|
|
|
$current_view_str = get_string('simpleview', 'grades');
|
|
|
|
} elseif ($current_view == 'fullview') {
|
|
|
|
$current_view_str = get_string('fullview', 'grades');
|
2007-08-01 04:34:08 +00:00
|
|
|
}
|
2007-05-30 08:48:11 +00:00
|
|
|
}
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
print_grade_page_head($courseid, 'edittree', $current_view, get_string('categoriesedit', 'grades') . ': ' . $current_view_str);
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-05-30 13:01:20 +00:00
|
|
|
if ($data = data_submitted() and confirm_sesskey()) {
|
2009-02-09 10:49:41 +00:00
|
|
|
// Perform bulk actions first
|
2009-05-30 13:01:20 +00:00
|
|
|
if (!empty($data->bulkmove)) {
|
2009-02-09 10:49:41 +00:00
|
|
|
$elements = array();
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
if (preg_match('/select_(i[0-9]*)/', $key, $matches)) {
|
|
|
|
$elements[] = $matches[1];
|
|
|
|
}
|
|
|
|
}
|
2007-11-01 11:42:31 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
$grade_edit_tree->move_elements($elements, $returnurl);
|
2007-11-01 11:42:31 +00:00
|
|
|
}
|
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
// Category and item field updates
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
// Grade category text inputs
|
2009-05-30 13:01:20 +00:00
|
|
|
if (preg_match('/^(aggregation|droplow|keephigh)_([0-9]+)$/', $key, $matches)) {
|
|
|
|
$param = $matches[1];
|
|
|
|
$aid = $matches[2];
|
2009-05-08 13:31:30 +00:00
|
|
|
|
|
|
|
// Do not allow negative values
|
2009-05-30 13:01:20 +00:00
|
|
|
$value = clean_param($value, PARAM_INT);
|
2009-05-08 13:31:30 +00:00
|
|
|
$value = ($value < 0) ? 0 : $value;
|
|
|
|
|
2009-05-30 13:01:20 +00:00
|
|
|
$grade_category = grade_category::fetch(array('id'=>$aid, 'courseid'=>$courseid));
|
2009-02-10 10:40:50 +00:00
|
|
|
$grade_category->$param = $value;
|
|
|
|
|
|
|
|
$grade_category->update();
|
2009-04-16 07:16:44 +00:00
|
|
|
grade_regrade_final_grades($courseid);
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
// Grade item text inputs
|
2009-05-30 13:01:20 +00:00
|
|
|
} elseif (preg_match('/^(grademax|aggregationcoef|multfactor|plusfactor)_([0-9]+)$/', $key, $matches)) {
|
|
|
|
$param = $matches[1];
|
|
|
|
$aid = $matches[2];
|
2009-03-04 14:20:45 +00:00
|
|
|
|
2009-05-30 13:01:20 +00:00
|
|
|
$value = unformat_float($value);
|
|
|
|
$value = clean_param($value, PARAM_NUMBER);
|
2009-03-04 14:20:45 +00:00
|
|
|
|
2009-05-30 13:01:20 +00:00
|
|
|
$grade_item = grade_item::fetch(array('id'=>$aid, 'courseid'=>$courseid));
|
|
|
|
|
|
|
|
if ($param === 'grademax' and $value < $grade_item->grademin) {
|
|
|
|
// better not allow values lower than grade min
|
|
|
|
$value = $grade_item->grademin;
|
|
|
|
}
|
2009-02-10 10:40:50 +00:00
|
|
|
$grade_item->$param = $value;
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-02-10 10:40:50 +00:00
|
|
|
$grade_item->update();
|
2009-04-16 07:16:44 +00:00
|
|
|
grade_regrade_final_grades($courseid);
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
// Grade item checkbox inputs
|
2009-05-30 13:01:20 +00:00
|
|
|
} elseif (preg_match('/^extracredit_([0-9]+)$/', $key, $matches)) { // Sum extra credit checkbox
|
|
|
|
$aid = $matches[1];
|
|
|
|
$value = clean_param($value, PARAM_BOOL);
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-05-30 13:01:20 +00:00
|
|
|
$grade_item = grade_item::fetch(array('id'=>$aid, 'courseid'=>$courseid));
|
|
|
|
$grade_item->aggregationcoef = $value;
|
2009-02-10 10:40:50 +00:00
|
|
|
|
|
|
|
$grade_item->update();
|
2009-04-16 07:16:44 +00:00
|
|
|
grade_regrade_final_grades($courseid);
|
2009-02-09 10:49:41 +00:00
|
|
|
|
|
|
|
// Grade category checkbox inputs
|
2009-05-30 13:01:20 +00:00
|
|
|
} elseif (preg_match('/^aggregate(onlygraded|subcats|outcomes)_([0-9]+)$/', $key, $matches)) {
|
|
|
|
$param = 'aggregate'.$matches[1];
|
|
|
|
$aid = $matches[2];
|
|
|
|
$value = clean_param($value, PARAM_BOOL);
|
2009-02-09 10:49:41 +00:00
|
|
|
|
2009-05-30 13:01:20 +00:00
|
|
|
$grade_category = grade_category::fetch(array('id'=>$aid, 'courseid'=>$courseid));
|
|
|
|
$grade_category->$param = $value;
|
2009-02-10 10:40:50 +00:00
|
|
|
|
|
|
|
$grade_category->update();
|
2009-04-16 07:16:44 +00:00
|
|
|
grade_regrade_final_grades($courseid);
|
2007-06-30 21:12:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
// Print Table of categories and items
|
2009-08-10 04:54:32 +00:00
|
|
|
echo $OUTPUT->box_start('gradetreebox generalbox');
|
2008-02-17 19:12:11 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
echo '<form id="gradetreeform" method="post" action="'.$returnurl.'">';
|
|
|
|
echo '<div>';
|
|
|
|
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
2008-02-17 19:12:11 +00:00
|
|
|
|
2009-08-25 07:31:13 +00:00
|
|
|
echo $OUTPUT->table($grade_edit_tree->table);
|
2008-06-03 16:10:57 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
echo '<div id="gradetreesubmit">';
|
|
|
|
if (!$moving) {
|
|
|
|
echo '<input class="advanced" type="submit" value="'.get_string('savechanges').'" />';
|
|
|
|
}
|
|
|
|
|
2009-04-24 08:13:56 +00:00
|
|
|
// We don't print a bulk move menu if there are no other categories than course category
|
2009-08-25 07:31:13 +00:00
|
|
|
if (!$moving && count($grade_edit_tree->categories) > 1) {
|
2009-02-09 10:49:41 +00:00
|
|
|
echo '<br /><br />';
|
|
|
|
echo '<input type="hidden" name="bulkmove" value="0" id="bulkmoveinput" />';
|
2009-04-22 20:05:16 +00:00
|
|
|
echo get_string('moveselectedto', 'grades') . ' ';
|
2009-08-10 08:38:45 +00:00
|
|
|
$select = new html_select();
|
2009-08-25 07:31:13 +00:00
|
|
|
$select->options = $grade_edit_tree->categories;
|
2009-08-04 02:05:32 +00:00
|
|
|
$select->name = 'moveafter';
|
|
|
|
$select->disabled = true;
|
|
|
|
$select->id = 'menumoveafter';
|
|
|
|
$select->add_action('change', 'submit_bulk_move');
|
|
|
|
echo $OUTPUT->select($select);
|
2009-02-09 10:49:41 +00:00
|
|
|
echo '<div id="noscriptgradetreeform" style="display: inline;">
|
|
|
|
<input type="submit" value="'.get_string('go').'" />
|
2009-07-02 07:45:44 +00:00
|
|
|
</div>';
|
|
|
|
echo $PAGE->requires->js_function_call('hide_item', Array('noscriptgradetreeform'))->asap();
|
2009-02-09 10:49:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
echo '</div>';
|
2008-02-17 19:12:11 +00:00
|
|
|
|
2009-02-09 10:49:41 +00:00
|
|
|
echo '</div></form>';
|
|
|
|
|
2009-08-10 04:54:32 +00:00
|
|
|
echo $OUTPUT->box_end();
|
2009-02-09 10:49:41 +00:00
|
|
|
|
|
|
|
// Print action buttons
|
2009-08-20 08:40:49 +00:00
|
|
|
echo $OUTPUT->container_start('buttons');
|
2009-02-09 10:49:41 +00:00
|
|
|
|
|
|
|
if ($moving) {
|
2009-08-20 08:40:49 +00:00
|
|
|
echo $OUTPUT->button(html_form::make_button('index.php', array('id'=>$course->id), get_string('cancel'), 'get'));
|
2009-02-09 10:49:41 +00:00
|
|
|
} else {
|
2009-08-20 08:40:49 +00:00
|
|
|
echo $OUTPUT->button(html_form::make_button('category.php', array('courseid'=>$course->id), get_string('addcategory', 'grades'), 'get'));
|
|
|
|
echo $OUTPUT->button(html_form::make_button('item.php', array('courseid'=>$course->id), get_string('additem', 'grades'), 'get'));
|
2009-02-09 10:49:41 +00:00
|
|
|
|
|
|
|
if (!empty($CFG->enableoutcomes)) {
|
2009-08-20 08:40:49 +00:00
|
|
|
echo $OUTPUT->button(html_form::make_button('outcomeitem.php', array('courseid'=>$course->id), get_string('addoutcomeitem', 'grades'), 'get'));
|
2008-02-17 19:12:11 +00:00
|
|
|
}
|
|
|
|
|
2009-04-16 07:16:44 +00:00
|
|
|
//print_single_button('index.php', array('id'=>$course->id, 'action'=>'autosort'), get_string('autosort', 'grades'), 'get');
|
2008-02-17 19:12:11 +00:00
|
|
|
}
|
2007-06-30 21:12:47 +00:00
|
|
|
|
2009-08-20 08:40:49 +00:00
|
|
|
echo $OUTPUT->container_end();
|
2009-02-09 10:49:41 +00:00
|
|
|
|
2009-08-06 14:12:17 +00:00
|
|
|
echo $OUTPUT->footer();
|
2009-02-09 10:49:41 +00:00
|
|
|
|
|
|
|
// Restore original show/hide preference if moving
|
|
|
|
if ($moving) {
|
|
|
|
$USER->gradeediting[$course->id] = $original_gradeediting;
|
|
|
|
}
|
|
|
|
die;
|
|
|
|
|
2007-05-30 08:48:11 +00:00
|
|
|
?>
|