diff --git a/mod_form.php b/mod_form.php index 87cc9602..174ec6ca 100644 --- a/mod_form.php +++ b/mod_form.php @@ -305,7 +305,6 @@ private function get_settingsfield_identifier($strategy, $key) { */ public function add_completion_rules() { $mform = $this->_form; - $suffix = $this->get_suffix(); $mform->addElement('advcheckbox', $this->get_suffixed_name('vote'), ' ', get_string('completionvote', RATINGALLOCATE_MOD_NAME)); $mform->addElement('advcheckbox', $this->get_suffixed_name('allocation'), ' ', get_string('completionallocation', RATINGALLOCATE_MOD_NAME)); diff --git a/tests/behat/completion_condition_allocation.feature b/tests/behat/completion_condition_allocation.feature index b389e6a6..75f90bd7 100644 --- a/tests/behat/completion_condition_allocation.feature +++ b/tests/behat/completion_condition_allocation.feature @@ -19,13 +19,8 @@ Feature: Set a ratingallocate activity marked as completed when a user has been | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | course | idnumber | name | - | ratingallocate | C1 | ra1 | My Fair Allocation | - And I am on the "My Fair Allocation" "ratingallocate activity editing" page - And I expand "Completion conditions" node - And I select the radio "id_completion_2" - And I check "id_completionallocation" - And I press "id_submitbutton" + | activity | course | idnumber | name | completion | completionallocation | + | ratingallocate | C1 | ra1 | My Fair Allocation | 2 | 1 | And the following choices exist: | title | explanation | maxsize | ratingallocate | | C1 | Test | 1 | My Fair Allocation | diff --git a/tests/behat/completion_condition_vote.feature b/tests/behat/completion_condition_vote.feature index af1b27fb..82a376b8 100644 --- a/tests/behat/completion_condition_vote.feature +++ b/tests/behat/completion_condition_vote.feature @@ -19,8 +19,8 @@ Feature: Set a ratingallocate activity marked as completed when a user submits a | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | course | idnumber | name | - | ratingallocate | C1 | ra1 | My Fair Allocation | + | activity | course | idnumber | name | completion | completionvote | + | ratingallocate | C1 | ra1 | My Fair Allocation | 2 | 1 | And I log in as "teacher1" And I am on the "My Fair Allocation" "ratingallocate activity" page And I press "Edit Choices" @@ -28,11 +28,6 @@ Feature: Set a ratingallocate activity marked as completed when a user submits a | title | My first choice | | Description (optional) | Test 1 | | maxsize | 2 | - And I am on the "My Fair Allocation" "ratingallocate activity editing" page - And I expand "Completion conditions" node - And I select the radio "id_completion_2" - And I check "id_completionvote" - And I press "id_submitbutton" @javascript Scenario: User completes ratingallocate only if they voted diff --git a/tests/behat/completion_manual.feature b/tests/behat/completion_manual.feature index 7698507d..057ecd60 100644 --- a/tests/behat/completion_manual.feature +++ b/tests/behat/completion_manual.feature @@ -17,8 +17,8 @@ Feature: Manually mark a ratingallocate activity as completed | teacher1 | C1 | editingteacher | | student1 | C1 | student | And the following "activities" exist: - | activity | course | idnumber | name | - | ratingallocate | C1 | ra1 | My Fair Allocation | + | activity | course | idnumber | name | completion | + | ratingallocate | C1 | ra1 | My Fair Allocation | 1 | And I log in as "teacher1" And I am on the "My Fair Allocation" "ratingallocate activity" page And I press "Edit Choices" @@ -26,10 +26,6 @@ Feature: Manually mark a ratingallocate activity as completed | title | My first choice | | Description (optional) | Test 1 | | maxsize | 2 | - And I am on the "My Fair Allocation" "ratingallocate activity editing" page - And I expand "Completion conditions" node - And I select the radio "id_completion_1" - And I press "id_submitbutton" @javascript Scenario: Use manual completion diff --git a/tests/mod_generator_test.php b/tests/mod_generator_test.php index f0331ce4..f4b16450 100644 --- a/tests/mod_generator_test.php +++ b/tests/mod_generator_test.php @@ -71,7 +71,9 @@ public function test_create_instance() { 'notificationsend' => '0', 'algorithmstarttime' => null, 'algorithmstatus' => '0', - 'runalgorithmbycron' => '1' + 'runalgorithmbycron' => '1', + 'completionvote' => '0', + 'completionallocation' => '0' ); $this->assertEquals(json_decode(json_encode($expectedvaluesdb, false)), reset($records));