From 13778dd77db3589c759ebfb226baa12951071876 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Mon, 4 Jan 2010 17:44:30 +0000 Subject: [PATCH] Renaming {load|save}_grading_form() methods After I started work on assessment support, I realized that "grading form" would not be consistent with "assessment form". --- mod/workshop/{editgradingform.php => editform.php} | 6 +++--- mod/workshop/grading/accumulative/strategy.php | 8 ++++---- mod/workshop/grading/noerrors/strategy.php | 8 ++++---- mod/workshop/grading/strategy.php | 6 +++--- mod/workshop/view.php | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) rename mod/workshop/{editgradingform.php => editform.php} (95%) diff --git a/mod/workshop/editgradingform.php b/mod/workshop/editform.php similarity index 95% rename from mod/workshop/editgradingform.php rename to mod/workshop/editform.php index c7710dbd1f..bac7e319a0 100644 --- a/mod/workshop/editgradingform.php +++ b/mod/workshop/editform.php @@ -52,7 +52,7 @@ if (!$workshop = $DB->get_record('workshop', array('id' => $cm->instance))) { // where should the user be sent after closing the editing form $returnurl = "{$CFG->wwwroot}/mod/workshop/view.php?id={$cm->id}"; // the URL of this editing form -$selfurl = "{$CFG->wwwroot}/mod/workshop/editgradingform.php?cmid={$cm->id}"; +$selfurl = "{$CFG->wwwroot}/mod/workshop/editform.php?cmid={$cm->id}"; // load the grading strategy logic $strategylib = dirname(__FILE__) . '/grading/' . $workshop->strategy . '/strategy.php'; @@ -67,7 +67,7 @@ $strategy = new $classname($workshop); // load the assessment form definition from the database // this must be called before get_edit_strategy_form() where we have to know // the number of repeating fieldsets -$formdata = $strategy->load_grading_form(); +$formdata = $strategy->load_form(); // load the form to edit the grading strategy dimensions $mform = $strategy->get_edit_strategy_form($selfurl); @@ -78,7 +78,7 @@ $mform->set_data($formdata); if ($mform->is_cancelled()) { redirect($returnurl); } elseif ($data = $mform->get_data()) { - $strategy->save_grading_form($data); + $strategy->save_form($data); if (isset($data->saveandclose)) { redirect($returnurl); } else { diff --git a/mod/workshop/grading/accumulative/strategy.php b/mod/workshop/grading/accumulative/strategy.php index 15d56db7b4..3c1ac32eae 100644 --- a/mod/workshop/grading/accumulative/strategy.php +++ b/mod/workshop/grading/accumulative/strategy.php @@ -34,7 +34,7 @@ require_once(dirname(dirname(__FILE__)) . '/strategy.php'); // parent class */ class workshop_accumulative_strategy extends workshop_base_strategy { - public function load_grading_form() { + public function load_form() { global $DB; $dims = $DB->get_records('workshop_forms_' . $this->name, array('workshopid' => $this->workshop->id), 'sort'); @@ -46,7 +46,7 @@ class workshop_accumulative_strategy extends workshop_base_strategy { /** * Transpones the dimension data from DB so the assessment form editor can be populated by set_data * - * Called internally from load_grading_form(). Could be private but keeping protected + * Called internally from load_form(). Could be private but keeping protected * for unit testing purposes. * * @param array $raw Array of raw dimension records as fetched by get_record() @@ -81,7 +81,7 @@ class workshop_accumulative_strategy extends workshop_base_strategy { * @access public * @return void */ - public function save_grading_form(stdClass $data) { + public function save_form(stdClass $data) { global $DB; if (!isset($data->strategyname) || ($data->strategyname != $this->name)) { @@ -116,7 +116,7 @@ class workshop_accumulative_strategy extends workshop_base_strategy { * * It automatically adds some columns into every record. The sorting is * done by the order of the returned array and starts with 1. - * Called internally from save_grading_form() only. Could be private but + * Called internally from save_form() only. Could be private but * keeping protected for unit testing purposes. * * @param object $raw Raw data returned by mform diff --git a/mod/workshop/grading/noerrors/strategy.php b/mod/workshop/grading/noerrors/strategy.php index 0c97faf3e0..0243f9e91c 100644 --- a/mod/workshop/grading/noerrors/strategy.php +++ b/mod/workshop/grading/noerrors/strategy.php @@ -34,7 +34,7 @@ require_once(dirname(dirname(__FILE__)) . '/strategy.php'); // parent class */ class workshop_noerrors_strategy extends workshop_base_strategy { - public function load_grading_form() { + public function load_form() { global $DB; $dims = $DB->get_records('workshop_forms_' . $this->name, array('workshopid' => $this->workshop->id), 'sort'); @@ -47,7 +47,7 @@ class workshop_noerrors_strategy extends workshop_base_strategy { /** * Transpones the dimension data from DB so the assessment form editor can be populated by set_data * - * Called internally from load_grading_form(). Could be private but keeping protected + * Called internally from load_form(). Could be private but keeping protected * for unit testing purposes. * * @param array $dims Array of raw dimension records as fetched by get_record() @@ -89,7 +89,7 @@ class workshop_noerrors_strategy extends workshop_base_strategy { * @param object $data Raw data returned by the dimension editor form * @return void */ - public function save_grading_form(stdClass $data) { + public function save_form(stdClass $data) { global $DB; if (!isset($data->strategyname) || ($data->strategyname != $this->name)) { @@ -168,7 +168,7 @@ class workshop_noerrors_strategy extends workshop_base_strategy { * * It automatically adds some columns into every record. The sorting is * done by the order of the returned array and starts with 1. - * Called internally from save_grading_form() only. Could be private but + * Called internally from save_form() only. Could be private but * keeping protected for unit testing purposes. * * @param object $raw Raw data returned by mform diff --git a/mod/workshop/grading/strategy.php b/mod/workshop/grading/strategy.php index 72feb70a17..47ed371b80 100644 --- a/mod/workshop/grading/strategy.php +++ b/mod/workshop/grading/strategy.php @@ -56,7 +56,7 @@ interface workshop_strategy { * @access public * @return object Object representing the form fields values */ - public function load_grading_form(); + public function load_form(); /** @@ -70,7 +70,7 @@ interface workshop_strategy { * @param object $data Raw data as returned by the form editor * @return void */ - public function save_grading_form(stdClass $data); + public function save_form(stdClass $data); /** @@ -147,7 +147,7 @@ abstract class workshop_base_strategy implements workshop_strategy { /** - * By default, the number of loaded dimensions is set by load_grading_form() + * By default, the number of loaded dimensions is set by load_form() * * @access public * @return Array of records diff --git a/mod/workshop/view.php b/mod/workshop/view.php index 0cb64ee18a..3cbd05d6f5 100644 --- a/mod/workshop/view.php +++ b/mod/workshop/view.php @@ -82,9 +82,9 @@ print_header_simple(format_string($workshop->name), '', $navigation, '', '', tru /// Print the main part of the page -echo "id}\">Edit grading form (".get_string('strategy' . $workshop->strategy, 'workshop').")"; -echo " | "; -echo "id}\">My submission"; +echo "id}\">Edit grading form (".get_string('strategy' . $workshop->strategy, 'workshop').")"; +echo " | id}\">My submission"; +echo " | Assessment ID 1"; /// Finish the page print_footer($course); -- 2.39.5