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".
This commit is contained in:
@@ -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 {
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user