Merge branch 'MDL-80205-main' of https://github.com/aanabit/moodle

This commit is contained in:
Sara Arjona 2023-11-29 18:40:52 +01:00
commit c3254b89ff
No known key found for this signature in database
2 changed files with 11 additions and 1 deletions

View File

@ -273,7 +273,8 @@ class mod_scorm_mod_form extends moodleform_mod {
// A SCORM module should define this within itself and is not needed here.
$suffix = $this->get_suffix();
$completionpassgradeel = 'completionpassgrade' . $suffix;
if ($mform->elementExists($completionpassgradeel)) {
// The 'completionpassgrade' is a radio element with multiple options, so we should remove all of them.
while ($mform->elementExists($completionpassgradeel)) {
$mform->removeElement($completionpassgradeel);
}

View File

@ -41,6 +41,15 @@ Feature: View activity completion in the SCORM activity
And "Music history" should have the "Receive a grade" completion condition
And "Music history" should have the "Complete or pass the activity" completion condition
@javascript
Scenario: Any grade and Passing grade options are hidden
Given I am on the "Music history" "scorm activity" page logged in as teacher1
When I navigate to "Settings" in current page administration
And I expand all fieldsets
And the field "completionusegrade" matches value "1"
Then I should not see "Any grade"
And I should not see "Passing grade"
@javascript
Scenario: View automatic completion items as a student
Given I am on the "Music history" "scorm activity" page logged in as student1