And I follow "Preferences" in the user menu
And I follow "Edit profile"
- @javascript
Scenario: Use nasty strings on steps arguments
When I set the field "Surname" to "$NASTYSTRING1"
And I set the field "Description" to "$NASTYSTRING2"
And the field "Surname" matches value "$NASTYSTRING1"
And the field "City/town" matches value "$NASTYSTRING3"
- @javascript
Scenario: Use nasty strings on table nodes
When I set the following fields to these values:
| Surname | $NASTYSTRING1 |
And the field "Surname" matches value "$NASTYSTRING1"
And the field "City/town" matches value "$NASTYSTRING3"
- @javascript
Scenario: Use double quotes
When I set the following fields to these values:
| First name | va"lue1 |
And the field "Description" matches value "va\\"lue2"
And the field "City/town" matches value "va\"lue3"
- @javascript
Scenario: Nasty strings with other contents
When I set the field "First name" to "My Firstname $NASTYSTRING1"
And I set the following fields to these values:
And I press "Update profile"
And I log out
- @javascript
Scenario: Add Tags block on a front page
When I log in as "admin"
And I am on site homepage
And I click on "Dogs" "link" in the "Tags" "block"
And I should see "Log in to the site" in the ".breadcrumb" "css_element"
- @javascript
Scenario: Add Tags block in a course
When I log in as "teacher1"
And I follow "Course 1"
And I press "Save changes"
And I log out
- @javascript
Scenario: A student can not see another student's blog entries.
Given I log in as "testuser"
And I follow "Course 1"
$maxtime = cache::now() - $ttl;
}
$readfile = false;
- if ($this->prescan && array_key_exists($key, $this->keys)) {
- if (!$ttl || $this->keys[$filename] >= $maxtime && file_exists($file)) {
+ if ($this->prescan && array_key_exists($filename, $this->keys)) {
+ if ((!$ttl || $this->keys[$filename] >= $maxtime) && file_exists($file)) {
$readfile = true;
} else {
$this->delete($key);
protected function get_class_name() {
return 'cachestore_file';
}
+
+ /**
+ * Testing cachestore_file::get with prescan enabled and with
+ * deleting the cache between the prescan and the call to get.
+ *
+ * The deleting of cache simulates some other process purging
+ * the cache.
+ */
+ public function test_cache_get_with_prescan_and_purge() {
+ global $CFG;
+
+ $definition = cache_definition::load_adhoc(cache_store::MODE_REQUEST, 'cachestore_file', 'phpunit_test');
+ $name = 'File test';
+
+ $path = make_cache_directory('cachestore_file_test');
+ $cache = new cachestore_file($name, array('path' => $path, 'prescan' => true));
+ $cache->initialise($definition);
+
+ $cache->set('testing', 'value');
+
+ $path = make_cache_directory('cachestore_file_test');
+ $cache = new cachestore_file($name, array('path' => $path, 'prescan' => true));
+ $cache->initialise($definition);
+
+ // Let's pretend that some other process purged caches.
+ remove_dir($CFG->cachedir.'/cachestore_file_test', true);
+ make_cache_directory('cachestore_file_test');
+
+ $cache->get('testing');
+ }
}
\ No newline at end of file
if (empty($subscriptions)) {
$cell = new html_table_cell(get_string('nocalendarsubscriptions', 'calendar'));
- $cell->colspan = 4;
+ $cell->colspan = 5;
$table->data[] = new html_table_row(array($cell));
}
$strnever = new lang_string('never', 'calendar');
require_once('../config.php');
require_once($CFG->dirroot.'/calendar/lib.php');
-require_sesskey();
-
$var = required_param('var', PARAM_ALPHA);
$return = clean_param(base64_decode(required_param('return', PARAM_RAW)), PARAM_LOCALURL);
$courseid = optional_param('id', -1, PARAM_INT);
} else {
$return = new moodle_url($return);
}
+
+if (!confirm_sesskey()) {
+ // Do not call require_sesskey() since this page may be accessed without session (for example by bots).
+ redirect($return);
+}
+
$url = new moodle_url('/calendar/set.php', array('return'=>base64_encode($return->out_as_local_url(false)), 'course' => $courseid, 'var'=>$var, 'sesskey'=>sesskey()));
$PAGE->set_url($url);
$PAGE->set_context(context_system::instance());
require_once(__DIR__ . '/../../../lib/behat/behat_base.php');
-use Behat\Behat\Context\Step\Given as Given,
+use Behat\Behat\Context\Step\Given,
+ Behat\Behat\Context\Step\Then,
Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException;
/**
return array(
new Given('I go to the current course activity completion report'),
- new Given('I hover "' . $this->escape($xpath) . '" "xpath_element"')
+ new Then('"' . $this->escape($xpath) . '" "xpath_element" should exist')
);
}
"/descendant::img[contains(@title, $titleliteral)]";
return array(
new Given('I go to the current course activity completion report'),
- new Given('I hover "' . $this->escape($xpath) . '" "xpath_element"')
+ new Then('"' . $this->escape($xpath) . '" "xpath_element" should exist')
);
return $steps;
| Sample course | C1 | 0 |
| Course 1 | COURSE1 | CAT1 |
- @javascript
Scenario: A user can return to the category page from enrolment page
When I log in as "user2"
And I click on "Courses" "link" in the "Navigation" "block"
*/
protected static function sync_with_parent_course(stdClass $instance, $userid) {
global $DB, $CFG;
+ require_once($CFG->dirroot . '/group/lib.php');
$plugin = enrol_get_plugin('meta');
And I set the field "Grade display type" to "Real (percentage)"
And I press "Save changes"
- @javascript
Scenario: Mean of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Mean of grades |
And I follow "Grades" in the user menu
And I should see "30.42 (30.42 %)" in the "overview-grade" "table"
- @javascript
Scenario: Weighted mean of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Weighted mean of grades |
And I follow "Grades" in the user menu
And I should see "26.94 (26.94 %)" in the "overview-grade" "table"
- @javascript
Scenario: Simple weighted mean of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Simple weighted mean of grades |
And I follow "Grades" in the user menu
And I should see "48.57 (48.57 %)" in the "overview-grade" "table"
- @javascript
Scenario: Mean of grades (with extra credits) aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Mean of grades (with extra credits) |
And I follow "Grades" in the user menu
And I should see "47.22 (47.22 %)" in the "overview-grade" "table"
- @javascript
Scenario: Median of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Median of grades |
And I follow "Grades" in the user menu
And I should see "25.83 (25.83 %)" in the "overview-grade" "table"
- @javascript
Scenario: Lowest grade aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Lowest grade |
And I follow "Grades" in the user menu
And I should see "0.00 (0.00 %)" in the "overview-grade" "table"
- @javascript
Scenario: Highest grade aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Highest grade |
And I follow "Grades" in the user menu
And I should see "50.00 (50.00 %)" in the "overview-grade" "table"
- @javascript
Scenario: Mode of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Mode of grades |
And I follow "Grades" in the user menu
And I should see "50.00 (50.00 %)" in the "overview-grade" "table"
- @javascript
Scenario: Natural aggregation on outcome items with natural weights
And the following config values are set as admin:
| enableoutcomes | 1 |
And I follow "Course 1"
And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"
- @javascript
Scenario: Natural aggregation on outcome items with modified weights
And the following config values are set as admin:
| enableoutcomes | 1 |
And I follow "Course 1"
And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"
- @javascript
Scenario: Natural aggregation
And I set the following settings for grade item "Sub category 1":
| Aggregation | Natural |
And I set the field "Show contribution to course total" to "Show"
And I set the field "Show weightings" to "Show"
And I press "Save changes"
- And I set the field "Grade report" to "User report"
- And I set the field "Select all or one user" to "Student 1"
+ And I select "User report" from the "Grade report" singleselect
+ And I select "Student 1" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Range | Contribution to course total |
| Test assignment five | 28.57 % | 10.00 (50.00 %) | 0–20 | 1.03 % |
| Test assignment three | 30.93 %( Extra credit ) | 40.00 (26.67 %) | 0–150 | 8.25 % |
| Test assignment four | 30.93 % | - | 0–150 | 0.00 % |
- @javascript
Scenario: Natural aggregation with drop lowest
When I log out
And I log in as "admin"
| Exclude empty grades | 0 |
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I press "Add category"
- And I click on "Show more" "link"
And I set the following fields to these values:
| Category name | Sub category 3 |
| Aggregation | Natural |
@javascript
Scenario: Natural aggregation from the setup screen
- And I set the field "Grade report" to "Categories and items"
+ And I select "Categories and items" from the "Grade report" singleselect
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
And I set the following settings for grade item "Sub category 1":
| Aggregation | Natural |
| Exclude empty grades | 0 |
And I turn editing mode off
- And I set the field "Grade report" to "Categories and items"
+ And I select "Categories and items" from the "Grade report" singleselect
And I set the field "Override weight of Test assignment one" to "1"
And I set the field "Weight of Test assignment one" to "0"
And I set the field "Override weight of Test assignment six" to "1"
And I set the field "Show weightings" to "Show"
And I press "Save changes"
Then I should see "75.00 (16.85 %)" in the ".course" "css_element"
- And I set the field "Grade report" to "User report"
- And I set the field "Select all or one user" to "Student 1"
+ And I select "User report" from the "Grade report" singleselect
+ And I select "Student 1" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Contribution to course total |
| Test assignment five | 57.14 % | 10.00 (50.00 %) | 2.25 % |
And I follow "Grader report"
And I turn editing mode on
- @javascript
Scenario: Test displaying scales in gradebook in aggregation method Natural
When I turn editing mode off
Then the following should exist in the "user-grades" table:
| Range | F–A | 0.00–5.00 | 0.00–5.00 |
| Overall average | C | 3.00 | 3.00 |
And I follow "User report"
- And I set the field "Select all or one user" to "Student 3"
- And I click on "Select all or one user" "select"
+ And I select "Student 3" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table:
| Grade item | Grade | Range | Percentage | Contribution to course total |
| Test assignment one | C | F–A | 50.00 % | 60.00 % |
| Sub category 1 total | 3.00 | 0–5 | 60.00 % | - |
| Course total | 3.00 | 0–5 | 60.00 % | - |
- And I set the field "jump" to "Categories and items"
+ And I select "Categories and items" from the "Grade report" singleselect
And the following should exist in the "grade_edit_tree_table" table:
| Name | Max grade |
| Test assignment one | 5.00 |
| Sub category 1 total | 4.00 | 0–5 | 80.00 % | - |
| Course total | 4.00 | 0–5 | 80.00 % | - |
- @javascript
Scenario Outline: Test displaying scales in gradebook in all other aggregation methods
When I follow "Edit Course 1"
And I set the field "Aggregation" to "<aggregation>"
| Range | F–A | 1.00–5.00 | 0.00–100.00 |
| Overall average | C | 3.00 | <overallavg> |
And I follow "User report"
- And I set the field "Select all or one user" to "Student 3"
- And I click on "Select all or one user" "select"
+ And I select "Student 3" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table:
| Grade item | Grade | Range | Percentage | Contribution to course total |
| Test assignment one | C | F–A | 50.00 % | <contrib3> |
| Sub category (<aggregation>) total<aggregation>. | 3.00 | 1–5 | 50.00 % | - |
| Course total<aggregation>. | <coursetotal3> | 0–100 | <courseperc3> | - |
- And I set the field "jump" to "Categories and items"
+ And I select "Categories and items" from the "Grade report" singleselect
And the following should exist in the "grade_edit_tree_table" table:
| Name | Max grade |
| Test assignment one | A (5) |
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment name 2"
And I press "Save changes"
- @javascript
Scenario: Grade a grade item and ensure the results display correctly in the gradebook
- When I set the field "Grade report" to "User report"
+ When I select "User report" from the "Grade report" singleselect
And the "Grade report" select box should contain "Grader report"
And the "Grade report" select box should contain "Outcomes report"
And the "Grade report" select box should contain "User report"
And "Course 1" row "Grade" column of "overview-grade" table should contain "170.00"
And "Course 1" row "Grade" column of "overview-grade" table should not contain "90.00"
- @javascript
Scenario: We can add a weighting to a grade item and it is displayed properly in the user report
- When I set the field "Grade report" to "Categories and items"
+ When I select "Categories and items" from the "Grade report" singleselect
And I set the following settings for grade item "Course 1":
| Aggregation | Weighted mean of grades |
And I set the field "Extra credit value for Test assignment name" to "0.72"
And I press "Save changes"
- And I set the field "Grade report" to "User report"
+ And I select "User report" from the "Grade report" singleselect
And I navigate to "Course grade settings" node in "Grade administration > Setup"
And I set the following fields to these values:
| Show weightings | Show |
$wheresql = ' WHERE u.id ' . $earnedsql;
}
list($enrolledsql, $enrolledparams) = get_enrolled_sql($this->get_context(), 'moodle/badges:earnbadge', 0, true);
- $sql = "SELECT u.id
+ $sql = "SELECT DISTINCT u.id
FROM {user} u
{$extrajoin}
JOIN ({$enrolledsql}) je ON je.id = u.id " . $wheresql . $extrawhere;
// Before doing the comparison, make sure that the paths are correct (Windows uses slashes in the other direction).
$attachpath = str_replace('\\', '/', $attachmentpath);
// Make sure both variables are normalised before comparing.
- $temppath = str_replace('\\', '/', $CFG->tempdir);
+ $temppath = str_replace('\\', '/', realpath($CFG->tempdir));
// If the attachment is a full path to a file in the tempdir, use it as is,
// otherwise assume it is a relative path from the dataroot (for backwards compatibility reasons).
- if (strpos($attachpath, realpath($temppath)) !== 0) {
+ if (strpos($attachpath, $temppath) !== 0) {
$attachmentpath = $CFG->dataroot . '/' . $attachmentpath;
}
filter_manager::reset_caches();
core_filetypes::reset_caches();
+ // Reset static unit test options.
+ if (class_exists('\availability_date\condition', false)) {
+ \availability_date\condition::set_current_time_for_test(0);
+ }
+
// Reset internal users.
core_user::reset_internal_users();
* Click on an entry in the user menu.
* @Given /^I follow "(?P<nodetext_string>(?:[^"]|\\")*)" in the user menu$/
*
- * @throws ExpectationException
* @param string $nodetext
* @return bool|void
*/
public function i_follow_in_the_user_menu($nodetext) {
+ $steps = array();
- // The user menu is broken without javascript.
- if (!$this->running_javascript()) {
- throw new DriverException('I follow in the user menu step is not available with Javascript disabled');
+ if ($this->running_javascript()) {
+ // The user menu must be expanded when JS is enabled.
+ $xpath = "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]";
+ $steps[] = new When('I click on "'.$xpath.'" "xpath_element"');
}
- $steps = array();
-
- $xpath = "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]";
+ // Now select the link.
+ // The CSS path is always present, with or without JS.
$csspath = ".usermenu [data-rel='menu-content']";
-
- $steps[] = new When('I click on "'.$xpath.'" "xpath_element"');
$steps[] = new When('I click on "'.$nodetext.'" "link" in the "'.$csspath.'" "css_element"');
return $steps;
-
}
/**
-@core @core_message @javascript
+@core @core_message
Feature: Message history displays correctly
In order to read messages between two users
As a user
-@core @core_message @javascrript
+@core @core_message
Feature: Manage contacts
In order to easily access the users I interact more with
As a user
As a teacher
I need to message them all
- @javascript
Scenario: An user can message multiple course participants including him/her self
Given the following "users" exist:
| username | firstname | lastname | email |
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Participants"
- When I click on "input[type='checkbox']" "css_element" in the "Teacher 1" "table_row"
- And I click on "input[type='checkbox']" "css_element" in the "Student 1" "table_row"
+ When I set the field with xpath "//tr[contains(normalize-space(.), 'Teacher 1')]//input[@type='checkbox']" to "1"
+ And I set the field with xpath "//tr[contains(normalize-space(.), 'Student 1')]//input[@type='checkbox']" to "1"
And I set the field "With selected users..." to "Send a message"
+ And I press "OK"
And I set the following fields to these values:
| messagebody | Here it is, the message content |
And I press "Preview"
And I press "Send message"
And I follow "Messages" in the user menu
- And I set the field "Message navigation:" to "Recent conversations"
+ And I select "Recent conversations" from the "Message navigation:" singleselect
Then I should see "Here it is, the message content"
And I should see "Student 1"
And I click on "this conversation" "link" in the "//div[@class='singlemessage'][contains(., 'Teacher 1')]" "xpath_element"
-@core @core_message @javascript
+@core @core_message
Feature: Recent conversations contains my recent conversations
In order to view my recent conversations
As a user
Scenario: View that I don't have recent conversations
Given I log in as "user1"
And I follow "Messages" in the user menu
- When I set the field "Message navigation:" to "Recent conversations"
+ When I select "Recent conversations" from the "Message navigation:" singleselect
Then I should not see "User Two"
And I should not see "User Three"
And I send "Message from user1 to user2" message to "User Two" user
And I send "Message from user1 to user3" message to "User Three" user
And I follow "Messages" in the user menu
- When I set the field "Message navigation:" to "Recent conversations"
+ When I select "Recent conversations" from the "Message navigation:" singleselect
Then I should see "User Two"
And I should see "User Three"
And I should see "Message from user1 to user2"
And I log out
And I log in as "user2"
And I follow "Messages" in the user menu
- And I set the field "Message navigation:" to "Recent conversations"
+ And I select "Recent conversations" from the "Message navigation:" singleselect
And I should see "Message from user1 to user2"
And I should not see "Message from user1 to user3"
-@core @core_message @javascript
+@core @core_message
Feature: Users can search their message history
In order to read old messages
As a user
And I log in as "student1"
And I follow "Course 1"
- @javascript
Scenario: Display replies flat, with oldest first
Given I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 2 to discussion 1 |
| Message | Discussion contents 1, third message |
- When I set the field "mode" to "Display replies flat, with oldest first"
+ When I select "Display replies flat, with oldest first" from the "mode" singleselect
Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
And I should see "Discussion contents 1, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
And I reply "Discussion 2" post from "Test forum name" forum with:
And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
And I should see "Discussion contents 2, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
- @javascript
Scenario: Display replies flat, with newest first
Given I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 2 to discussion 1 |
| Message | Discussion contents 1, third message |
- When I set the field "mode" to "Display replies flat, with newest first"
+ When I select "Display replies flat, with newest first" from the "mode" singleselect
Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
And I should see "Discussion contents 1, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
And I reply "Discussion 2" post from "Test forum name" forum with:
And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
And I should see "Discussion contents 2, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
- @javascript
Scenario: Display replies in threaded form
Given I follow "Test forum name"
And I follow "Discussion 1"
- When I set the field "mode" to "Display replies in threaded form"
+ When I select "Display replies in threaded form" from the "mode" singleselect
Then I should see "Discussion contents 1, first message"
And I should see "Reply 1 to discussion 1" in the "span.forumthread" "css_element"
And I follow "Test forum name"
And I should see "Discussion contents 2, first message"
And I should see "Reply 1 to discussion 2" in the "span.forumthread" "css_element"
- @javascript
Scenario: Display replies in nested form
Given I follow "Test forum name"
And I follow "Discussion 1"
- When I set the field "mode" to "Display replies in nested form"
+ When I select "Display replies in nested form" from the "mode" singleselect
Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
And I should see "Discussion contents 1, second message" in the "div.indent div.forumpost" "css_element"
And I follow "Test forum name"
Background:
Given the following "users" exist:
- | username | firstname | lastname | email |
- | student1 | Student | 1 | student1@example.com |
- | student2 | Student | 2 | student2@example.com |
+ | username | firstname | lastname | email |
+ | teacher1 | Teacher | 1 | teacher1@example.com |
+ | student1 | Student | 1 | student1@example.com |
+ | student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
- | fullname | shortname | category |
- | Course 1 | C1 | 0 |
+ | fullname | shortname | category |
+ | Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
+ | teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
- And I log in as "admin"
- And I am on site homepage
- And I follow "Course 1"
- And I navigate to "Groups" node in "Users"
- And I press "Create group"
- And I set the following fields to these values:
- | Group name | Group 1 |
- And I press "Save changes"
- And I press "Create group"
- And I set the following fields to these values:
- | Group name | Group 2 |
- And I press "Save changes"
- And I add "Student 1" user to "Group 1" group members
- And I add "Student 2" user to "Group 2" group members
- And I am on site homepage
- And I follow "Course 1"
- And I turn editing mode on
+ And the following "groups" exist:
+ | name | course | idnumber |
+ | Group 1 | C1 | G1 |
+ | Group 2 | C1 | G2 |
+ And the following "group members" exist:
+ | user | group |
+ | teacher1 | G1 |
+ | teacher1 | G2 |
+ | student1 | G1 |
+ | student2 | G2 |
- @javascript
Scenario: A user can navigate between discussions
- Given I add a "Forum" to section "1" and I fill the form with:
- | Forum name | Test forum name |
- | Description | Test forum description |
+ Given the following "activities" exist:
+ | activity | name | intro | course | idnumber | groupmode |
+ | forum | Test forum name | Test forum name | C1 | forum | 0 |
+ And I log in as "teacher1"
+ And I follow "Course 1"
+ And I follow "Test forum name"
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 1 |
| Message | Test post message |
And I set the following fields to these values:
| Message | Answer to discussion |
And I press "Post to forum"
+ And I wait to be redirected
And I should not see "Discussion 2"
And I should see "Discussion 3"
And I follow "Discussion 3"
And I should not see "Discussion 1"
And I should see "Discussion 3"
- @javascript
Scenario: A user can navigate between discussions with visible groups
- Given I add a "Forum" to section "1" and I fill the form with:
- | Forum name | Test forum name |
- | Description | Test forum description |
- | Group mode | Visible groups |
+ Given the following "activities" exist:
+ | activity | name | intro | course | idnumber | groupmode |
+ | forum | Test forum name | Test forum name | C1 | forum | 2 |
+ And I log in as "teacher1"
+ And I follow "Course 1"
+ And I follow "Test forum name"
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 1 Group 0 |
| Message | Test post message |
When I log in as "student1"
And I follow "Course 1"
And I follow "Test forum name"
- And I set the field "Visible groups" to "All participants"
+ And I select "All participants" from the "Visible groups" singleselect
And I follow "Discussion 1 Group 0"
Then I should see "Discussion 2 Group 0"
And I should not see "Group 1"
And I should see "Discussion 2 Group 1"
And I should see "Discussion 2 Group 2"
And I follow "Test forum name"
- And I set the field "Visible groups" to "Group 1"
+ And I select "Group 1" from the "Visible groups" singleselect
And I follow "Discussion 1 Group 1"
Then I should see "Discussion 2 Group 0"
And I should see "Discussion 2 Group 1"
And I should see "Discussion 1 Group 1"
And I should not see "Group 2"
- @javascript
Scenario: A user can navigate between discussions with separate groups
- Given I add a "Forum" to section "1" and I fill the form with:
- | Forum name | Test forum name |
- | Description | Test forum description |
- | Group mode | Separate groups |
+ Given the following "activities" exist:
+ | activity | name | intro | course | idnumber | groupmode |
+ | forum | Test forum name | Test forum name | C1 | forum | 1 |
+ And I log in as "teacher1"
+ And I follow "Course 1"
+ And I follow "Test forum name"
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 1 Group 0 |
| Message | Test post message |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
- And I log in as "admin"
- And I expand "Site administration" node
- And I expand "Security" node
- And I follow "Site policies"
- And I set the field "Maximum time to edit posts" to "1 minutes"
- And I press "Save changes"
- And I am on site homepage
- And I follow "Course 1"
- And I turn editing mode on
- And I add a "Forum" to section "1" and I fill the form with:
- | Forum name | Test forum name |
- | Forum type | Standard forum for general use |
- | Description | Test forum description |
- And I log out
- And I follow "Course 1"
+ And the following "activities" exist:
+ | activity | name | intro | course | idnumber |
+ | forum | Test forum name | Test forum description | C1 | forum |
And I log in as "student1"
+ And I follow "Course 1"
And I add a new discussion to "Test forum name" forum with:
| Subject | Forum post subject |
| Message | This is the body |
Scenario: Edit forum post
- When I follow "Forum post subject"
+ Given I follow "Forum post subject"
And I follow "Edit"
- And I set the following fields to these values:
+ When I set the following fields to these values:
| Subject | Edited post subject |
| Message | Edited post body |
And I press "Save changes"
Then I should see "Edited post subject"
And I should see "Edited post body"
- @javascript
Scenario: Delete forum post
- When I follow "Forum post subject"
- And I follow "Delete"
+ Given I follow "Forum post subject"
+ When I follow "Delete"
And I press "Continue"
Then I should not see "Forum post subject"
@javascript
Scenario: Time limit expires
- When I wait "70" seconds
+ Given I log out
+ And I log in as "admin"
+ And I expand "Site administration" node
+ And I expand "Security" node
+ And I follow "Site policies"
+ And I set the field "Maximum time to edit posts" to "1 minutes"
+ And I press "Save changes"
+ And I am on site homepage
+ And I follow "Course 1"
+ And I turn editing mode on
+ And I add a "Forum" to section "1" and I fill the form with:
+ | Forum name | Test forum name |
+ | Forum type | Standard forum for general use |
+ | Description | Test forum description |
+ And I log out
+ And I log in as "student1"
+ And I follow "Course 1"
+ When I wait "61" seconds
And I follow "Forum post subject"
Then I should not see "Edit" in the "region-main" "region"
And I should not see "Delete" in the "region-main" "region"
| Subject | Student post subject |
| Message | Student post message |
- @javascript
Scenario: A teacher can delete another user's posts
Given I log out
And I log in as "teacher1"
Then I should not see "Student post subject"
And I should not see "Student post message"
- @javascript
Scenario: A teacher can edit another user's posts
Given I log out
And I log in as "teacher1"
Then I should see "Edited student subject"
And I should see "Edited by Teacher 1 - original submission"
- @javascript
Scenario: A student can't edit or delete another user's posts
When I follow "Teacher post subject"
Then I should not see "Edit" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Teacher post subject')]" "xpath_element"
-@mod @mod_forum @javascript
+@mod @mod_forum
Feature: A user can view their posts and discussions
In order to ensure a user can view their posts and discussions
As a student
Scenario: View the student's posts and discussions
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 I log in as "teacher1"
- And I follow "Course 1"
- And I turn editing mode on
- And I add a "Forum" to section "1" and I fill the form with:
- | Forum name | Test forum name |
- | Forum type | Standard forum for general use |
- | Description | Test forum description |
- And I log out
+ And the following "activities" exist:
+ | activity | name | intro | course | idnumber | groupmode |
+ | forum | Test forum name | Test forum | C1 | forum | 0 |
And I log in as "student1"
And I follow "Course 1"
And I add a new discussion to "Test forum name" forum with:
| grouping | group |
| G1 | C2G1 |
| G1 | C2G2 |
- And I log in as "teacher1"
- And I follow "Course 1"
- And I turn editing mode on
- And I add a "Forum" to section "1" and I fill the form with:
- | Forum name | Separate group forum |
- | Forum type | Standard forum for general use |
- | Description | Standard forum description |
- | Group mode | Separate groups |
- And I add a "Forum" to section "2" and I fill the form with:
- | Forum name | Visible group forum |
- | Forum type | Standard forum for general use |
- | Description | Standard forum description |
- | Group mode | Visible groups |
- And I add a "Forum" to section "3" and I fill the form with:
- | Forum name | No group forum |
- | Forum type | Standard forum for general use |
- | Description | Standard forum description |
- | Group mode | No groups |
- And I log out
- And I log in as "teacher1"
- And I follow "Course 2"
- And I turn editing mode on
- And I add a "Forum" to section "1" and I fill the form with:
- | Forum name | Groupings forum |
- | Forum type | Standard forum for general use |
- | Description | Standard forum description |
- | Group mode | Separate groups |
- | Grouping | G1 |
- And I log out
+ And the following "activities" exist:
+ | activity | name | intro | course | idnumber | groupmode | grouping |
+ | forum | No group forum | Test forum name | C1 | forum | 0 | |
+ | forum | Separate group forum | Test forum name | C1 | forum | 1 | |
+ | forum | Visible group forum | Test forum name | C1 | forum | 2 | |
+ | forum | Groupings forum | Test forum name | C2 | forum | 1 | G1 |
- @javascript
Scenario: Teacher is able to post a copy of a message to all groups in a separate group forum
Given I log in as "teacher1"
And I follow "Course 1"
And I follow "Separate group forum"
And I should see "Discussion 1"
- @javascript
Scenario: Teacher is able to post a copy of a message to all groups in a visible group forum
Given I log in as "teacher1"
And I follow "Course 1"
And I follow "Visible group forum"
And I should see "Discussion 1"
- @javascript
Scenario: Teacher is unable to post a copy of a message to all groups in a no group forum
Given I log in as "teacher1"
And I follow "Course 1"
And I press "Add a new discussion topic"
Then I should not see "Post a copy to all groups"
- @javascript
Scenario: Posts to all groups that have groupings should only display within the grouping and not to other groups
Given I log in as "teacher1"
And I follow "Course 2"
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
- And I log in as "teacher1"
- And I follow "Course 1"
- And I turn editing mode on
- And I add a "Forum" to section "1" and I fill the form with:
- | Forum name | Single discussion forum name |
- | Forum type | A single simple discussion |
- | Description | Single discussion forum description |
+ And the following "activities" exist:
+ | activity | name | intro | type | course | idnumber |
+ | forum | Single discussion forum name | Single discussion forum description | single | C1 | forum |
- @javascript
Scenario: Teacher can start the single simple discussion
+ Given I log in as "teacher1"
+ And I follow "Course 1"
When I follow "Single discussion forum name"
Then I should see "Single discussion forum description" in the "div.firstpost.starter" "css_element"
And I should not see "Add a new discussion topic"
- @javascript
Scenario: Student can not add more discussions
- Given I log out
And I log in as "student1"
And I follow "Course 1"
When I reply "Single discussion forum name" post from "Single discussion forum name" forum with:
And I follow "Course 1"
And I turn editing mode on
- @javascript
Scenario: Tracking forum posts off
Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
And I follow "Test forum name"
And I should not see "Track unread posts"
- @javascript
Scenario: Tracking forum posts optional with user tracking on
Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
And I follow "Course 1"
And I should not see "1 unread post"
- @javascript
Scenario: Tracking forum posts optional with user tracking off
Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
And I follow "Test forum name"
And I should not see "Track unread posts"
- @javascript
Scenario: Tracking forum posts forced with user tracking on
Given the following config values are set as admin:
| forum_allowforcedreadtracking | 1 |
And I follow "Course 1"
And I should not see "1 unread post"
- @javascript
Scenario: Tracking forum posts forced with user tracking off
Given the following config values are set as admin:
| forum_allowforcedreadtracking | 1 |
And I follow "Course 1"
And I should not see "1 unread post"
- @javascript
Scenario: Tracking forum posts forced (with force disabled) with user tracking on
Given the following config values are set as admin:
| forum_allowforcedreadtracking | 1 |
And I follow "Course 1"
And I should not see "1 unread post"
- @javascript
Scenario: Tracking forum posts forced (with force disabled) with user tracking off
Given the following config values are set as admin:
| forum_allowforcedreadtracking | 1 |
| id_answer_editor_1 | False |
And I press "Save page"
- @javascript
Scenario: Non-practice lesson records grades in the gradebook
Given I follow "Test lesson name"
And I navigate to "Edit settings" node in "Lesson administration"
And I follow "Course 1"
And I should see "Non-practice lesson"
- @javascript
Scenario: Practice lesson doesn't record grades in the gradebook
Given I follow "Test lesson name"
And I navigate to "Edit settings" node in "Lesson administration"
And I follow "Course 1"
And I should not see "Practice lesson"
- @javascript
Scenario: Practice lesson with scale doesn't record grades in the gradebook
Given I follow "Test lesson name"
And I navigate to "Edit settings" node in "Lesson administration"
#page-mod-quiz-edit .totalpoints {
display: block;
float: right;
- margin: -2.5em 0 0;
+ margin: -2.85em 0 0;
padding: .2em;
}
#page-mod-quiz-edit.dir-rtl .maxgrade,
page-break-inside: avoid;
}
}
+/* Ajustments for mobile devices */
+@media only screen and (max-width:565px) {
+ #page-mod-quiz-edit .rpcontainerclass {
+ margin-top: 3em;
+ }
+ #page-mod-quiz-edit .maxgrade {
+ margin-top: 0.1em;
+ }
+ #page-mod-quiz-edit .statusbar {
+ padding: 0;
+ }
+}
| Description | URL description |
| External URL | http://www.google.com |
- @javascript
Scenario: View the user page when only the legacy log reader is enabled
Given I navigate to "Manage log stores" node in "Site administration > Plugins > Logging"
And I click on "Enable" "link" in the "Legacy log" "table_row"
And I follow "URL name"
And I follow "URL name"
And I follow "URL name"
- And I click on "Student 1" "link"
- And I follow "Profile" in the open menu
+ And I follow "Profile" in the user menu
And I follow "Course 1"
When I follow "Outline report"
Then I should see "4 views" in the "Folder name" "table_row"
And I should see "3 views" in the "URL name" "table_row"
- And I click on "Student 1" "link"
- And I follow "Profile" in the open menu
+ And I follow "Profile" in the user menu
And I follow "Course 1"
- When I follow "Complete report"
+ And I follow "Complete report"
And I should see "4 views"
And I should see "3 views"
- @javascript
Scenario: View the user page when only the standard log reader is enabled
Given I navigate to "Manage log stores" node in "Site administration > Plugins > Logging"
And "Enable" "link" should exist in the "Legacy log" "table_row"
And I should see "4 views"
And I should see "3 views"
- @javascript
Scenario: View the user page when both the standard and legacy log readers are enabled
Given I navigate to "Manage log stores" node in "Site administration > Plugins > Logging"
And I click on "Enable" "link" in the "Legacy log" "table_row"
}
/** Overide for RTL layout **/
+.dir-rtl .block .header h2 {
+ padding: .2em .2em 0 0;
+}
+
.dir-rtl .block .header,
.dir-rtl .block h2.header {text-align:right;}
.dir-rtl .block .header .block_action { float: left; margin-left: 4px; margin-left: 0;}