Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

show tree outcomes list

  • Loading branch information...
commit 3724d9d921a75d62272726af79d492eaa2117a95 1 parent 159bb63
zhendi.wang zhendi authored
Showing with 21 additions and 5 deletions.
  1. +10 −5 grade/edit/outcome/edit_form.php
  2. +11 −0 grade/edit/outcome/index.php
15 grade/edit/outcome/edit_form.php
View
@@ -48,12 +48,17 @@ public function definition() {
$mform->addHelpButton('standard', 'outcomestandard', 'grades');
$options = array();
-
- $out_array = $DB->get_records_menu('grade_outcomes', array(), '', 'id, fullname');
- foreach($out_array as $id => $fullname) {
- $out_array[$id] = strip_tags(format_string($fullname));
+
+ $out_array = array();
+ $outcome_array = $DB->get_records_menu('grade_outcomes', array('parent'=>0), '', 'id, fullname');
+
+ foreach($outcome_array as $id => $fullname) {
+ $curr_out_id = $_GET['id'];
+ if ($curr_out_id != $id) {
+ $out_array[$id] = strip_tags(format_string($fullname));
+ }
}
-
+ array_unshift($out_array, "None");
$mform->addElement('select', 'parent', 'Parent', $out_array);
$mform->addElement('selectwithlink', 'scaleid', get_string('scale'), $options, null,
11 grade/edit/outcome/index.php
View
@@ -240,6 +240,17 @@
print_grade_page_head($courseid, 'outcome', 'edit', $heading);
}
+echo "<ul style='list-style:none;'>";
+$out_array = $DB->get_records_menu('grade_outcomes', array('parent' => 0), '', 'id, fullname');
+foreach($out_array as $id => $fullname) {
+ echo "<li style='padding:5px;'><a href='/grade/edit/outcome/edit.php?&id='".$id.">".$fullname."</a></li>";
+ $p_recs = $DB->get_records_menu('grade_outcomes', array('parent' => $id), '', 'id, fullname');
+ foreach($p_recs as $id => $fullname) {
+ echo "<li style='padding:5px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='/grade/edit/outcome/edit.php?&id='".$id.">".$fullname."</a></li>";
+ }
+}
+echo "</ul>";
+
foreach($outcomes_tables as $table) {
echo $table;
}
Please sign in to comment.
Something went wrong with that request. Please try again.