-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into enhancement/postform
- Loading branch information
Showing
13 changed files
with
222 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
@mod @mod_moodleoverflow @javascript | ||
Feature: Teachers can move a discussion in one moodleoverflow forum to another moodleoverflow. | ||
|
||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| student1 | Student | 1 | student1@example.com | | ||
And the following "courses" exist: | ||
| fullname | shortname | category | | ||
| Course 1 | C1 | 0 | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| student1 | C1 | student | | ||
And the following "activities" exist: | ||
| activity | name | intro | course | anonymous | idnumber | | ||
| moodleoverflow | public moodleoverflow one | Test moodleoverflow description | C1 | 0 | 1 | | ||
| moodleoverflow | public moodleoverflow two | Test moodleoverflow description | C1 | 0 | 2 | | ||
| moodleoverflow | question anonymous | Test moodleoverflow description | C1 | 1 | 3 | | ||
| moodleoverflow | everything anonymous | Test moodleoverflow description | C1 | 2 | 4 | | ||
And I log in as "admin" | ||
|
||
|
||
Scenario: Move topic from public forum | ||
Given I am on "Course 1" course homepage | ||
And I add a new discussion to "public moodleoverflow one" moodleoverflow with: | ||
| Subject | Public Message | | ||
| Message | This is the public message | | ||
And I follow "public moodleoverflow one" | ||
And I click on "Move this discussion to another moodleoverflow" "link" | ||
Then I should see "public moodleoverflow two" | ||
And I should see "question anonymous" | ||
And I should see "everything anonymous" | ||
And I should not see "Move discussion to public moodleoverflow one" | ||
When I click on "Move discussion to public moodleoverflow two" "link" | ||
And I am on "Course 1" course homepage | ||
And I follow "public moodleoverflow two" | ||
Then I should see "Public Message" | ||
|
||
Scenario: Move topic from question anonymous forum | ||
Given I am on "Course 1" course homepage | ||
And I add a new discussion to "question anonymous" moodleoverflow with: | ||
| Subject | Question Message | | ||
| Message | This is the question anonymous message | | ||
And I follow "question anonymous" | ||
And I click on "Move this discussion to another moodleoverflow" "link" | ||
And I should not see "Move discussion to public moodleoverflow one" | ||
And I should not see "Move discussion to public moodleoverflow two" | ||
And I should see "question anonymous" | ||
And I should see "everything anonymous" | ||
When I click on "Move discussion to everything anonymous" "link" | ||
And I am on "Course 1" course homepage | ||
And I follow "everything anonymous" | ||
Then I should see "Question Message" | ||
|
||
Scenario: Move topic from question anonymous forum | ||
Given I am on "Course 1" course homepage | ||
And I add a new discussion to "everything anonymous" moodleoverflow with: | ||
| Subject | Everything Message | | ||
| Message | This is the everything anonymous message | | ||
And I follow "everything anonymous" | ||
And I click on "Move this discussion to another moodleoverflow" "link" | ||
And I should not see "Move discussion to public moodleoverflow one" | ||
And I should not see "Move discussion to public moodleoverflow two" | ||
And I should not see "Move discussion to question anonymous" | ||
And I should not see "Move discussion to everything anonymous" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
@mod @mod_moodleoverflow @javascript | ||
Feature: If the admin enabled user statistics, the teacher can see the activity of students in the course | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| teacher1 | Teacher | 1 | teacher1@example.com | | ||
| student1 | Student | 1 | student1@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 | name | intro | course | idnumber | | ||
| moodleoverflow | Test Moodleoverflow | Test moodleoverflow description | C1 | 1 | | ||
And I log in as "teacher1" | ||
And I am on "Course 1" course homepage | ||
And I add a new discussion to "Test Moodleoverflow" moodleoverflow with: | ||
| Subject | Topic question | | ||
| Message | This is a question | | ||
|
||
Scenario: Userstats are not enabled per default. The teacher should not see the user statistics | ||
And I follow "Test Moodleoverflow" | ||
Then I should not see "View user statistics" | ||
|
||
Scenario: Userstats are enabled. The teacher should see the user statistics. The teacher should already have an acitivty point | ||
for writing a post. | ||
Given the following config values are set as admin: | ||
| showuserstats | 1 | moodleoverflow | | ||
And I follow "Test Moodleoverflow" | ||
Then I should see "View user statistics" | ||
When I press "View user statistics" | ||
Then the following should exist in the "statisticstable" table: | ||
| User full name | Received upvotes | Received downvotes | Activity (this forum) | Activity (coursewide) | | ||
| Teacher 1 | 0 | 0 | 1 | 1 | | ||
| Student 1 | 0 | 0 | 0 | 0 | | ||
|
||
|
||
Scenario: Test if reputation appears in the user statistics | ||
Given the following config values are set as admin: | ||
| showuserstats | 1 | moodleoverflow | | ||
And I log in as "student1" | ||
And I am on "Course 1" course homepage | ||
And I follow "Test Moodleoverflow" | ||
And I follow "Topic question" | ||
And I click on "Answer" "link" | ||
And I set the following fields to these values: | ||
| Message | This is an answer | | ||
And I press "Post to forum" | ||
And I log out | ||
And I log in as "teacher1" | ||
And I am on "Course 1" course homepage | ||
And I follow "Test Moodleoverflow" | ||
And I follow "Topic question" | ||
And I click on "Mark as solution" "text" | ||
And I follow "Test Moodleoverflow" | ||
And I press "View user statistics" | ||
Then the following should exist in the "statisticstable" table: | ||
| User full name | Received upvotes | Received downvotes | Activity (this forum) | Activity (coursewide) | Reputation (this forum) | | ||
| Teacher 1 | 0 | 0 | 2 | 2 | 0 | | ||
| Student 1 | 0 | 0 | 1 | 1 | 30 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="lib/phpunit/phpunit.xsd" | ||
bootstrap="lib/phpunit/bootstrap.php" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
cacheResult="false" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
beStrictAboutTestsThatDoNotTestAnything="false" | ||
beStrictAboutOutputDuringTests="true" | ||
> | ||
|
||
<php> | ||
<!--<const name="PHPUNIT_LONGTEST" value="1"/> uncomment to execute also slow or otherwise expensive tests--> | ||
<const name="PHPUNIT_SEQUENCE_START" value="195000"/> | ||
|
||
<!--Following constants instruct tests to fetch external test files from alternative location | ||
or skip tests if empty, clone https://github.com/moodlehq/moodle-exttests to local web server--> | ||
<!--<const name="TEST_EXTERNAL_FILES_HTTP_URL" value="http://download.moodle.org/unittest"/> | ||
uncomment and alter to fetch external test files from alternative location--> | ||
<!--<const name="TEST_EXTERNAL_FILES_HTTPS_URL" value="https://download.moodle.org/unittest"/> | ||
uncomment and alter to fetch external test files from alternative location--> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="mod_moodleoverflow_testsuite"> | ||
<directory suffix="_test.php">mod/moodleoverflow/tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters