From 17e5f3fc9d4e45992ddfcf98d263a17da5cf4ec6 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Wed, 8 Feb 2006 04:56:44 +0000 Subject: [PATCH] adding 3 more fields to mod.html, and modified data_update_instance --- mod/data/lib.php | 4 +++ mod/data/mod.html | 67 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/mod/data/lib.php b/mod/data/lib.php index df5d539f299..18846c390b3 100755 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -551,6 +551,10 @@ function data_update_instance($data) { $data->id = $data->instance; + if (empty($data->ratings)) { + $data->ratings = 0; + } + $data->timemodified = time(); if (!empty($data->availablefromenable)) { diff --git a/mod/data/mod.html b/mod/data/mod.html index a11fa880d97..857c109bb77 100644 --- a/mod/data/mod.html +++ b/mod/data/mod.html @@ -53,6 +53,15 @@ if (!isset($form->approval)) { $form->approval = 0; } + if (!isset($form->scale)) { + $form->scale = 0; + } + if (!isset($form->assessed)) { + $form->assessed = 1; + } + if (!isset($form->assesspublic)) { + $form->assesspublic = 1; + } ?> '; + echo 'ratings) { + echo ' checked="checked" '; + } + echo ' />'; + echo ' '.get_string('ratingsuse', 'forum').':'; + echo ''; + echo ''; + // The odd order below was to maintain backward compatibility + unset($options); + $options[2] = get_string('ratingonlyteachers', 'forum', moodle_strtolower($course->teachers)); + $options[1] = get_string('ratingeveryone', 'forum'); + echo get_string('users').': '; + echo ''; + choose_from_menu($options, 'assessed', $form->assessed, ''); + echo ''; + + echo ''; + unset($options); + $options[0] = get_string('ratingpublicnot', 'forum', $course->students); + $options[1] = get_string('ratingpublic', 'forum', $course->students); + echo get_string('view').': '; + echo ''; + choose_from_menu($options, 'assesspublic', $form->assesspublic, ''); + echo ''; + + echo ''; + echo get_string('grade').': '; + echo ''; + print_grade_menu($course->id, 'scale', $form->scale, false); + echo ''; + + echo ''; + + echo ''; + echo ''; + echo ''; + + echo ''; + + ?> + + @@ -255,7 +320,7 @@ - +