2 // Allows a creator to edit custom scales, and also display help about scales
4 require_once("../config.php");
5 require_once("lib.php");
7 $id = required_param('id', PARAM_INT
); // course id
9 if (! $course = get_record("course", "id", $id)) {
10 error("Course ID was incorrect");
13 require_login($course);
14 $context = get_context_instance(CONTEXT_COURSE
, $course->id
);
15 require_capability('moodle/course:viewscales', $context);
17 $strscale = get_string("scale");
18 $strscales = get_string("scales");
19 $strcustomscale = get_string("scalescustom");
20 $strstandardscale = get_string("scalesstandard");
21 $strcustomscales = get_string("scalescustom");
22 $strstandardscales = get_string("scalesstandard");
23 $strname = get_string("name");
24 $strdescription = get_string("description");
25 $strhelptext = get_string("helptext");
26 $stractivities = get_string("activities");
29 print_header($strscales);
31 if ($scales = get_records("scale", "courseid", "$course->id", "name ASC")) {
32 print_heading($strcustomscales);
34 if (has_capability('moodle/course:managescales', $context)) {
35 echo "<p align=\"center\">(";
36 print_string("scalestip");
40 foreach ($scales as $scale) {
41 $scalemenu = make_menu_from_list($scale->scale
);
43 print_simple_box_start("center");
44 print_heading($scale->name
);
46 choose_from_menu($scalemenu, "", "", "");
48 echo text_to_html($scale->description
);
49 print_simple_box_end();
54 if (has_capability('moodle/course:managescales', $context)) {
55 echo "<p align=\"center\">(";
56 print_string("scalestip");
61 if ($scales = get_records("scale", "courseid", "0", "name ASC")) {
62 print_heading($strstandardscales);
63 foreach ($scales as $scale) {
64 $scalemenu = make_menu_from_list($scale->scale
);
66 print_simple_box_start("center");
67 print_heading($scale->name
);
69 choose_from_menu($scalemenu, "", "", "");
71 echo text_to_html($scale->description
);
72 print_simple_box_end();
77 close_window_button();