--- /dev/null
+<?php //$Id$
+
+echo "not implemented yet";
+
+
+?>
\ No newline at end of file
<?php //$Id$
-require_once '../../../config.php';
+require_once '../../config.php';
require_once $CFG->libdir.'/gradelib.php';
require_once 'edit_category_form.php';
//require_capability() here!!
// default return url
-$returnurl = 'category.php?id='.$course->id;
+$returnurl = 'edit_tree.php?id='.$course->id;
$mform = new edit_category_form();
$strcategoriesedit = get_string('categoriesedit', 'grades');
$nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
- array('name'=>$strgraderreport, 'link'=>$CFG->wwwroot.'/grade/report.php?id='.$courseid.'&report=grader', 'type'=>'misc'),
array('name'=>$strcategoriesedit, 'link'=>'', 'type'=>'misc'));
$navigation = build_navigation($nav);
<?php //$Id$
-require_once '../../../config.php';
+require_once '../../config.php';
require_once $CFG->libdir.'/gradelib.php';
require_once 'edit_grade_form.php';
require_capability('gradereport/grader:manage', $context);
// default return url
+//TODO: implement proper return support
$returnurl = $CFG->wwwroot.'/grade/report.php?report=grader&id='.$course->id;
$grade_grades = get_record('grade_grades', 'id', $id);
$mform = new edit_grade_form(qualified_me(), array('gradeitem'=>$gradeitem));
if ($grade_grades = get_record('grade_grades', 'id', $id)) {
if ($grade_text = get_record('grade_grades_text', 'gradeid', $id)) {
- $mform->set_data($grade_text);
- }
-
+ $mform->set_data($grade_text);
+ }
+
$grade_grades->locked = $grade_grades->locked > 0 ? 1:0;
$grade_grades->courseid = $courseid;
$mform->set_data($grade_grades);
redirect($returnurl);
// form processing
} else if ($data = $mform->get_data()) {
-
+
$grade_grades = new grade_grades(array('id'=>$id));
$grade_item = new grade_item(array('id'=>$grade_grades->itemid));
$grade_item->update_final_grade($grade_grades->userid, $data->finalgrade, NULL, NULL, $data->feedback);
-
+
// set locked
$grade_grades->set_locked($data->locked);
// set hidden
$grade_grades->set_hidden($data->hidden);
-
+
// set locktime
$grade_grades->set_locktime($data->locktime);
}
$nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
- array('name'=>$strgraderreport, 'link'=>$CFG->wwwroot.'/grade/report.php?id='.$courseid.'&report=grader', 'type'=>'misc'),
array('name'=>$heading, 'link'=>'', 'type'=>'misc'));
$navigation = build_navigation($nav);
global $CFG, $USER;
$mform =& $this->_form;
-
- $gradeitem = $this->_customdata['gradeitem'];
-
+
+ $gradeitem = $this->_customdata['gradeitem'];
+
/// actual grade - numeric or scale
if ($gradeitem->gradetype == 1) {
// numeric grade
} else if ($gradeitem->gradetype == 2) {
// scale grade
$scaleopt[-1] = get_string('nograde');
-
+
$i = 1;
if ($scale = get_record('scale', 'id', $gradeitem->scaleid)) {
foreach (split(",", $scale->scale) as $option) {
$i++;
}
}
-
+
$mform->addElement('select', 'finalgrade', get_string('finalgrade', 'grades'), $scaleopt);
}
-
+
/// hidden
- $mform->addElement('advcheckbox', 'hidden', get_string('hidden', 'grades'));
-
+ $mform->addElement('advcheckbox', 'hidden', get_string('hidden', 'grades'));
+
/// locked
$mform->addElement('advcheckbox', 'locked', get_string('locked', 'grades'));
$mform->addElement('date_time_selector', 'locktime', get_string('locktime', 'grades'), array('optional'=>true));
$mform->disabledIf('locktime', 'gradetype', 'eq', GRADE_TYPE_NONE);
/// hidden/visible
-
+
/// feedback
$feedbackformat = get_user_preferences('grade_report_feedbackformat', $CFG->grade_report_feedbackformat);
<?php //$Id$
-require_once '../../../config.php';
+require_once '../../config.php';
require_once $CFG->libdir.'/gradelib.php';
require_once 'edit_item_form.php';
//require_capability() here!!
// default return url
-$returnurl = 'category.php?id='.$course->id;
+$returnurl = 'edit_tree.php?id='.$course->id;
$mform = new edit_item_form();
if ($item = get_record('grade_items', 'id', $id, 'courseid', $course->id)) {
$stritemsedit = get_string('itemsedit', 'grades');
$nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
- array('name'=>$strgraderreport, 'link'=>$CFG->wwwroot.'/grade/report.php?id='.$courseid.'&report=grader', 'type'=>'misc'),
array('name'=>$stritemsedit, 'link'=>'', 'type'=>'misc'));
$navigation = build_navigation($nav);
// //
///////////////////////////////////////////////////////////////////////////
-require_once '../../../config.php';
+require_once '../../config.php';
require_once $CFG->libdir.'/gradelib.php';
$courseid = required_param('id', PARAM_INT);
//require_capability() here!!
// default return url
-$returnurl = 'category.php?id='.$course->id;
+$returnurl = 'edit_tree.php?id='.$course->id;
// get the grading tree object
// note: total must be first for moving to work correctly, if you want it last moving code must be rewritten!
$strcategoriesedit = get_string('categoriesedit', 'grades');
$nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
- array('name'=>$strgraderreport, 'link'=>$CFG->wwwroot.'/grade/report.php?id='.$courseid.'&report=grader', 'type'=>'misc'),
array('name'=>$strcategoriesedit, 'link'=>'', 'type'=>'misc'));
$navigation = build_navigation($nav);
$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);
- notice_yesno($strdeletecheckfull, 'category.php', 'category.php', $optionsyes, $optionsno, 'post', 'get');
+ notice_yesno($strdeletecheckfull, 'edit_tree.php', 'edit_tree.php', $optionsyes, $optionsno, 'post', 'get');
print_footer($course);
die;
}
print_heading(get_string('categoriesedit', 'grades'));
// Add tabs
-$currenttab = 'editcategory';
-include('tabs.php');
+// TODO: implement return support - use tabs from the report plugin
+/*$currenttab = 'editcategory';
+include('tabs.php');*/
print_box_start('gradetreebox generalbox');
echo '<ul id="grade_tree">';
echo '<div class="buttons">';
if ($moving) {
- print_single_button('category.php', array('id'=>$course->id), get_string('cancel'), 'get');
+ print_single_button('edit_tree.php', array('id'=>$course->id), get_string('cancel'), 'get');
} else {
print_single_button('edit_category.php', array('courseid'=>$course->id), get_string('addcategory', 'grades'), 'get');
- print_single_button('edit_item.php', array('courseid'=>$course->id), get_string('additem', 'grades'), 'get'); // TODO: localize
- print_single_button('category.php', array('id'=>$course->id, 'action'=>'autosort'), get_string('autosort', 'grades'), 'get'); //TODO: localize
- print_single_button('category.php', array('id'=>$course->id, 'action'=>'synclegacy'), get_string('synclegacygrades', 'grades'), 'get'); //TODO: localize
+ print_single_button('edit_item.php', array('courseid'=>$course->id), get_string('additem', 'grades'), 'get');
+ print_single_button('edit_tree.php', array('id'=>$course->id, 'action'=>'autosort'), get_string('autosort', 'grades'), 'get');
+ print_single_button('edit_tree.php', array('id'=>$course->id, 'action'=>'synclegacy'), get_string('synclegacygrades', 'grades'), 'get');
}
echo '</div>';
print_footer($course);
$eid = $element['eid'];
/// prepare actions
- $actions = '<a href="category.php?id='.$COURSE->id.'&action=edit&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'.$stredit.'" title="'.$stredit.'"/></a>';
+ $actions = '<a href="edit_tree.php?id='.$COURSE->id.'&action=edit&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'.$stredit.'" title="'.$stredit.'"/></a>';
if ($element['type'] == 'item' or ($element['type'] == 'category' and $element['depth'] > 1)) {
- $actions .= '<a href="category.php?id='.$COURSE->id.'&action=delete&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'.$strdelete.'" title="'.$strdelete.'"/></a>';
- $actions .= '<a href="category.php?id='.$COURSE->id.'&action=moveselect&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/move.gif" class="iconsmall" alt="'.$strmove.'" title="'.$strmove.'"/></a>';
+ $actions .= '<a href="edit_tree.php?id='.$COURSE->id.'&action=delete&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'.$strdelete.'" title="'.$strdelete.'"/></a>';
+ $actions .= '<a href="edit_tree.php?id='.$COURSE->id.'&action=moveselect&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/move.gif" class="iconsmall" alt="'.$strmove.'" title="'.$strmove.'"/></a>';
}
if ($object->is_locked()) {
- $actions .= '<a href="category.php?id='.$COURSE->id.'&action=unlock&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/unlock.gif" class="iconsmall" alt="'.$strunlock.'" title="'.$strunlock.'"/></a>';
+ $actions .= '<a href="edit_tree.php?id='.$COURSE->id.'&action=unlock&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/unlock.gif" class="iconsmall" alt="'.$strunlock.'" title="'.$strunlock.'"/></a>';
} else {
- $actions .= '<a href="category.php?id='.$COURSE->id.'&action=lock&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/lock.gif" class="iconsmall" alt="'.$strlock.'" title="'.$strlock.'"/></a>';
+ $actions .= '<a href="edit_tree.php?id='.$COURSE->id.'&action=lock&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/lock.gif" class="iconsmall" alt="'.$strlock.'" title="'.$strlock.'"/></a>';
}
if ($object->is_hidden()) {
$name = '<span class="dimmed_text">'.$object->get_name().'</span>';
- $actions .= '<a href="category.php?id='.$COURSE->id.'&action=show&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/show.gif" class="iconsmall" alt="'.$strshow.'" title="'.$strshow.'"/></a>';
+ $actions .= '<a href="edit_tree.php?id='.$COURSE->id.'&action=show&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/show.gif" class="iconsmall" alt="'.$strshow.'" title="'.$strshow.'"/></a>';
} else {
$name = $object->get_name();
- $actions .= '<a href="category.php?id='.$COURSE->id.'&action=hide&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/hide.gif" class="iconsmall" alt="'.$strhide.'" title="'.$strhide.'"/></a>';
+ $actions .= '<a href="edit_tree.php?id='.$COURSE->id.'&action=hide&eid='.$eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/hide.gif" class="iconsmall" alt="'.$strhide.'" title="'.$strhide.'"/></a>';
}
/// prepare icon
$moveto = '';
if ($moving) {
$actions = ''; // no action icons when moving
- $moveto = '<li><a href="category.php?id='.$COURSE->id.'&action=move&eid='.$moving.'&moveafter='.$eid.'&sesskey='.sesskey().'"><img class="movetarget" src="'.$CFG->wwwroot.'/pix/movehere.gif" alt="'.$strmovehere.'" title="'.$strmovehere.'" /></a></li>';
+ $moveto = '<li><a href="edit_tree.php?id='.$COURSE->id.'&action=move&eid='.$moving.'&moveafter='.$eid.'&sesskey='.sesskey().'"><img class="movetarget" src="'.$CFG->wwwroot.'/pix/movehere.gif" alt="'.$strmovehere.'" title="'.$strmovehere.'" /></a></li>';
}
/// print the list items now
} else { // Print confirmation dialog
$eid = $element['eid'];
$strdeletecheckfull = get_string('deletecheck', '', $element['object']->get_name());
- $linkyes = "category.php?target=$eid&action=delete&confirm=1$this->gtree->commonvars";
- $linkno = "category.php?$this->gtree->commonvars";
+ $linkyes = "edit_tree.php?target=$eid&action=delete&confirm=1$this->gtree->commonvars";
+ $linkno = "edit_tree.php?$this->gtree->commonvars";
notice_yesno($strdeletecheckfull, $linkyes, $linkno);
}
break;
}
// Prepare image strings
- $edit_category_icon = '<a href="report/grader/edit_category.php?courseid='.$object->courseid.'&id='.$object->id.'">'
+ $edit_category_icon = '<a href="'.$CFG->wwwroot.'/grade/edit/edit_category.php?courseid='.$object->courseid.'&id='.$object->id.'">'
. '<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'
. $stredit.'" title="'.$stredit.'" /></a>'. "\n";
- $edit_item_icon = '<a href="report/grader/edit_item.php?courseid='.$object->courseid.'&id='.$object->id.'">'
+ $edit_item_icon = '<a href="'.$CFG->wwwroot.'/grade/edit/edit_item.php?courseid='.$object->courseid.'&id='.$object->id.'">'
. '<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'
. $stredit.'" title="'.$stredit.'" /></a>'. "\n";
$overlib = '';
. $strfeedback.'\');" onmouseout="return nd();"';
}
- $edit_grade_icon = '<a href="report/grader/edit_grade.php?courseid='.$object->courseid.'&id='.$object->id.'">'
+ $edit_grade_icon = '<a href="'.$CFG->wwwroot.'/grade/edit/edit_grade.php?courseid='.$object->courseid.'&id='.$object->id.'">'
. '<img ' . $overlib . ' src="'.$CFG->pixpath.'/t/edit.gif"'
. 'class="iconsmall" alt="' . $stredit.'" title="'.$stredit.'" /></a>'. "\n";
if ($type == 'item' or $type == 'courseitem' or $type == 'categoryitem') {
// show calculation icon only when calculation possible
if (!$object->is_normal_item() and ($object->gradetype == GRADE_TYPE_SCALE or $object->gradetype == GRADE_TYPE_VALUE)) {
- $edit_calculation_icon = '<a href="report/grader/edit_calculation.php?courseid='.$object->courseid.'&id='.$object->id.'">'
+ $edit_calculation_icon = '<a href="'.$CFG->wwwroot.'/grade/edit/edit_calculation.php?courseid='.$object->courseid.'&id='.$object->id.'">'
. '<img src="'.$CFG->pixpath.'/t/calc.gif" class="iconsmall" alt="'
. $streditcalculation.'" title="'.$streditcalculation.'" /></a>'. "\n";
}
get_string('graderreport', 'grades'));
$row[] = new tabobject('editcategory',
- $CFG->wwwroot.'/grade/report/grader/category.php?id='.$courseid,
+ $CFG->wwwroot.'/grade/edit/edit_tree.php?id='.$courseid,
get_string('categoriesedit', 'grades'));
$row[] = new tabobject('preferences',
}
$table->add_data($data);
}
-
+
//echo "<div><table class='boxaligncenter'><tr><td>asdfas</td></tr></table></div>";
$table->print_html();
} else {
notify(get_string('nogradeitem', 'grades'));
}
-
+
?>
if ($locktime) {
// if current locktime is before, no need to reset
-
+
if ($this->locktime && $this->locktime <= $locktime) {
- return true;
+ return true;
}
/*
} else {
$gis = implode(',', $useditems);
-
+
$sql = "SELECT gi.*
FROM {$CFG->prefix}grade_items gi
WHERE gi.id IN ($gis) and gi.courseid={$this->courseid}"; // from the same course only!
-
+
if (!$grade_items = get_records_sql($sql)) {
$grade_items = array();
}
/* gradebook edit tree */
-#grade-report-grader-category .gradetreebox {
+#grade-edit-edit_tree .gradetreebox {
width:70%;
margin-left:auto;
margin-right:auto;
padding-bottom:15px;
}
-#grade-report-grader-category .buttons {
+#grade-edit-edit_tree .buttons {
margin: 20px;
text-align:center;
}
-#grade-report-grader-category .buttons .singlebutton {
+#grade-edit-edit_tree .buttons .singlebutton {
display: inline;
padding: 5px;
}
-#grade-report-grader-category .movetarget {
+#grade-edit-edit_tree .movetarget {
position: relative;
width: 80px;
height: 16px;
}
-#grade-report-grader-category ul#grade_tree {
+#grade-edit-edit_tree ul#grade_tree {
width: auto;
}
-#grade-report-grader-category ul#grade_tree li {
+#grade-edit-edit_tree ul#grade_tree li {
list-style: none;
}
-#grade-report-grader-category ul#grade_tree li.category {
+#grade-edit-edit_tree ul#grade_tree li.category {
margin-bottom: 6px;
}
-#grade-report-grader-category .moving {
+#grade-edit-edit_tree .moving {
background-color: #E8EEF7;
}
-#grade-report-grader-category .iconsmall {
+#grade-edit-edit_tree .iconsmall {
margin-left: 4px;
}