]> git.mjollnir.org Git - moodle.git/commitdiff
Renaming {load|save}_grading_form() methods
authorDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 17:44:30 +0000 (17:44 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 17:44:30 +0000 (17:44 +0000)
After I started work on assessment support, I realized that "grading
form" would not be consistent with "assessment form".

mod/workshop/editform.php [moved from mod/workshop/editgradingform.php with 95% similarity]
mod/workshop/grading/accumulative/strategy.php
mod/workshop/grading/noerrors/strategy.php
mod/workshop/grading/strategy.php
mod/workshop/view.php

similarity index 95%
rename from mod/workshop/editgradingform.php
rename to mod/workshop/editform.php
index c7710dbd1f93ad5257108d61090b37432c0164f5..bac7e319a0ad10034d6a2180a653d09bde5f99a1 100644 (file)
@@ -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 {
index 15d56db7b41ecb59e885c7d417d1898ae8873cba..3c1ac32eae7131d04d64c1d4ac23797cc67f0ab8 100644 (file)
@@ -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
index 0c97faf3e0aa768def2e4e8691460c043490f148..0243f9e91cf70267cf4dc94dfb677de673f56c01 100644 (file)
@@ -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
index 72feb70a178a90e776641dd0101f9b76b7aecfc7..47ed371b80ed5d224528a3706c6be1d37135f144 100644 (file)
@@ -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
index 0cb64ee18a2ba9c700cd957bb0ba8d0760501c95..3cbd05d6f56e4282632b3f585f5cce18e41e5654 100644 (file)
@@ -82,9 +82,9 @@ print_header_simple(format_string($workshop->name), '', $navigation, '', '', tru
 
 /// Print the main part of the page
 
-echo "<a href=\"editgradingform.php?cmid={$cm->id}\">Edit grading form (".get_string('strategy' . $workshop->strategy, 'workshop').")</a>";
-echo " | ";
-echo "<a href=\"submission.php?cmid={$cm->id}\">My submission</a>";
+echo "<a href=\"editform.php?cmid={$cm->id}\">Edit grading form (".get_string('strategy' . $workshop->strategy, 'workshop').")</a>";
+echo " | <a href=\"submission.php?cmid={$cm->id}\">My submission</a>";
+echo " | <a href=\"assessment.php?asid=1\">Assessment ID 1</a>";
 
 /// Finish the page
 print_footer($course);