first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,90 @@
@mod @mod_resource
Feature: Teacher can specify different display options for the resource
In order to provide more information about a file
As a teacher
I need to be able to show size, type and modified date
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name | intro | defaultfilename | uploaded |
| resource | C1 | Myfile | My cool file | mod/resource/tests/fixtures/samplefile.txt | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Specifying no additional display options for a file resource
When I am on the "Myfile" "resource activity editing" page
And I set the following fields to these values:
| Show upload/modified date | 0 |
| showsize | 0 |
| showtype | 0 |
And I press "Save and display"
Then ".resourcedetails" "css_element" should not exist
And I am on "Course 1" course homepage
And ".activity.resource .resourcelinkdetails" "css_element" should not exist
Scenario Outline: Specifying different display options for a file resource
When I am on the "Myfile" "resource activity editing" page
And I set the following fields to these values:
| display | 5 |
| Show size | <showsize> |
| Show type | <showtype> |
| Show upload/modified date | <showdate> |
And I press "Save and display"
Then I <seesize> see "6 bytes" in the ".resourcedetails" "css_element"
And I <seetype> see "TXT" in the ".resourcedetails" "css_element"
And I <seedate> see "Uploaded" in the ".resourcedetails" "css_element"
And I am on "Course 1" course homepage
And I <seesize> see "6 bytes" in the ".activity.resource .resourcelinkdetails" "css_element"
And I <seetype> see "TXT" in the ".activity.resource .activitybadge" "css_element"
And I <seedate> see "Uploaded" in the ".activity.resource .resourcelinkdetails" "css_element"
Examples:
| showsize | showtype | showdate | seesize | seetype | seedate |
| 1 | 0 | 0 | should | should not | should not |
| 0 | 0 | 1 | should not | should not | should |
| 1 | 1 | 0 | should | should | should not |
| 1 | 0 | 1 | should | should not | should |
| 0 | 1 | 1 | should not | should | should |
| 1 | 1 | 1 | should | should | should |
Scenario Outline: Specify different display options for an embedded file resource
When I am on the "Myfile" "resource activity editing" page
And I set the following fields to these values:
| display | Embed |
| Show type | <showtype> |
| Display resource description | <showdesc> |
And I press "Save and display"
Then I <seetype> see "TXT" in the "region-main" "region"
And I <seedesc> see "My cool file" in the "region-main" "region"
Examples:
| showtype | showdesc | seetype | seedesc |
| 1 | 0 | should | should not |
| 1 | 1 | should | should |
| 0 | 1 | should not | should |
| 0 | 0 | should not | should not |
Scenario: Specifying only show type for a file resource
When I am on the "Myfile" "resource activity editing" page
And I set the following fields to these values:
| display | 5 |
| Show size | 0 |
| Show type | 1 |
| Show upload/modified date | 0 |
And I press "Save and display"
Then I should see "TXT" in the ".resourcedetails" "css_element"
Then I should not see "6 bytes" in the ".resourcedetails" "css_element"
And I should see "TXT" in the ".resourcedetails" "css_element"
And I should not see "Uploaded" in the ".resourcedetails" "css_element"
And I am on "Course 1" course homepage
And I should see "TXT" in the ".activity.resource .activitybadge" "css_element"
And ".activity.resource .resourcelinkdetails" "css_element" should not exist
@@ -0,0 +1,89 @@
@mod @mod_resource @core_completion @_file_upload
Feature: View activity completion information for file resources
In order to have visibility of file resource completion requirements
As a student
I need to be able to view my file resource completion progress
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category | enablecompletion |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following config values are set as admin:
| displayoptions | 0,1,2,3,4,5,6 | resource |
@javascript
Scenario Outline: The manual completion button will be shown on the course page for Open, In pop-up, New window and Force download display mode if Show activity completion conditions is set to No
Given the following "activities" exist:
| activity | course | name | display | showsize | showtype | showdate | completion | defaultfilename | popupwidth | popupheight | uploaded |
| resource | C1 | Myfile | <display> | 0 | 0 | 0 | 1 | mod/resource/tests/fixtures/samplefile.txt | 620 | 450 | 1 |
And I am on the "Course 1" course page logged in as teacher1
# Teacher view.
And "Myfile" should have the "Mark as done" completion condition
# Student view.
When I am on the "Course 1" course page logged in as student1
Then the manual completion button for "Myfile" should exist
And the manual completion button of "Myfile" is displayed as "Mark as done"
And I toggle the manual completion state of "Myfile"
And the manual completion button of "Myfile" is displayed as "Done"
Examples:
| display |
| 5 |
| 6 |
| 4 |
| 3 |
@javascript
Scenario: The manual completion button will be shown on the activity page and course page if Show activity completion conditions is set to Yes
Given the following "activities" exist:
| activity | course | name | display | defaultfilename | uploaded |
| resource | C1 | Myfile | 1 | mod/resource/tests/fixtures/samplefile.txt | 1 |
And I am on the "Course 1" "course editing" page logged in as "teacher1"
And I expand all fieldsets
And I set the field "Show activity completion conditions" to "Yes"
And I press "Save and display"
And I am on the "Myfile" "resource activity editing" page
And I set the following fields to these values:
| Students must manually mark the activity as done | 1 |
And I click on "Save and return to course" "button"
# Teacher view.
And "Myfile" should have the "Mark as done" completion condition
And I am on the "Myfile" "resource activity" page
And the manual completion button for "Myfile" should exist
And the manual completion button for "Myfile" should be disabled
# Student view.
When I am on the "Course 1" course page logged in as student1
Then the manual completion button for "Myfile" should exist
And I am on the "Myfile" "resource activity" page
And the manual completion button of "Myfile" is displayed as "Mark as done"
And I toggle the manual completion state of "Myfile"
And the manual completion button of "Myfile" is displayed as "Done"
@javascript
Scenario: View automatic completion items
Given the following "activities" exist:
| activity | course | name | display | defaultfilename | uploaded |
| resource | C1 | Myfile | 1 | mod/resource/tests/fixtures/samplefile.txt | 1 |
And I am on the "Course 1" "course editing" page logged in as "teacher1"
And I expand all fieldsets
And I set the field "Show activity completion conditions" to "Yes"
And I press "Save and display"
And I am on the "Myfile" "resource activity editing" page
And I set the following fields to these values:
| Add requirements | 1 |
| View the activity | 1 |
And I press "Save and display"
# Teacher view.
And I am on the "Myfile" "resource activity" page
And "Myfile" should have the "View" completion condition
# Student view.
When I am on the "Myfile" "resource activity" page logged in as student1
Then the "View" completion condition of "Myfile" is displayed as "done"