mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-69017 user: Show all links should work for students
This commit is contained in:
parent
71a34a039f
commit
d3bfae8fcc
2 changed files with 39 additions and 31 deletions
|
@ -171,7 +171,6 @@ $participanttable->out($perpage, true);
|
||||||
$participanttablehtml = ob_get_contents();
|
$participanttablehtml = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
||||||
if ($bulkoperations) {
|
|
||||||
echo html_writer::start_tag('form', [
|
echo html_writer::start_tag('form', [
|
||||||
'action' => 'action_redir.php',
|
'action' => 'action_redir.php',
|
||||||
'method' => 'post',
|
'method' => 'post',
|
||||||
|
@ -183,7 +182,6 @@ if ($bulkoperations) {
|
||||||
echo '<div>';
|
echo '<div>';
|
||||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||||
echo '<input type="hidden" name="returnto" value="'.s($PAGE->url->out(false)).'" />';
|
echo '<input type="hidden" name="returnto" value="'.s($PAGE->url->out(false)).'" />';
|
||||||
}
|
|
||||||
|
|
||||||
echo html_writer::tag(
|
echo html_writer::tag(
|
||||||
'p',
|
'p',
|
||||||
|
@ -229,6 +227,10 @@ echo $OUTPUT->container(html_writer::link(
|
||||||
]
|
]
|
||||||
), [], 'showall');
|
), [], 'showall');
|
||||||
|
|
||||||
|
$bulkoptions = (object) [
|
||||||
|
'uniqueid' => $participanttable->uniqueid,
|
||||||
|
];
|
||||||
|
|
||||||
if ($bulkoperations) {
|
if ($bulkoperations) {
|
||||||
echo '<br /><div class="buttons"><div class="form-inline">';
|
echo '<br /><div class="buttons"><div class="form-inline">';
|
||||||
|
|
||||||
|
@ -310,15 +312,12 @@ if ($bulkoperations) {
|
||||||
echo '<input type="hidden" name="id" value="' . $course->id . '" />';
|
echo '<input type="hidden" name="id" value="' . $course->id . '" />';
|
||||||
echo '<div class="d-none" data-region="state-help-icon">' . $OUTPUT->help_icon('publishstate', 'notes') . '</div>';
|
echo '<div class="d-none" data-region="state-help-icon">' . $OUTPUT->help_icon('publishstate', 'notes') . '</div>';
|
||||||
echo '</div></div></div>';
|
echo '</div></div></div>';
|
||||||
|
|
||||||
|
$bulkoptions->noteStateNames = note_get_state_names();
|
||||||
|
}
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
||||||
$options = (object) [
|
$PAGE->requires->js_call_amd('core_user/participants', 'init', [$bulkoptions]);
|
||||||
'uniqueid' => $participanttable->uniqueid,
|
|
||||||
'noteStateNames' => note_get_state_names(),
|
|
||||||
];
|
|
||||||
$PAGE->requires->js_call_amd('core_user/participants', 'init', [$options]);
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '</div>'; // Userlist.
|
echo '</div>'; // Userlist.
|
||||||
|
|
||||||
$enrolrenderer = $PAGE->get_renderer('core_enrol');
|
$enrolrenderer = $PAGE->get_renderer('core_enrol');
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
@core @core_user
|
@core @core_user
|
||||||
|
|
||||||
Feature: Course participants can be filtered to display all the users
|
Feature: Course participants can be filtered to display all the users
|
||||||
In order to filter the list of course participants
|
In order to filter the list of course participants
|
||||||
As a user
|
As a user
|
||||||
|
@ -6,9 +7,9 @@ Feature: Course participants can be filtered to display all the users
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the following "courses" exist:
|
Given the following "courses" exist:
|
||||||
| fullname | shortname | groupmode |
|
| fullname | shortname |
|
||||||
| Course 1 | C1 | 1 |
|
| Course 1 | C1 |
|
||||||
| Course 2 | C2 | 0 |
|
| Course 2 | C2 |
|
||||||
And the following "users" exist:
|
And the following "users" exist:
|
||||||
| username | firstname | lastname | email |
|
| username | firstname | lastname | email |
|
||||||
| student1 | Student | 1 | student1@example.com |
|
| student1 | Student | 1 | student1@example.com |
|
||||||
|
@ -67,15 +68,6 @@ Feature: Course participants can be filtered to display all the users
|
||||||
| student3 | C2 | student | 0 | |
|
| student3 | C2 | student | 0 | |
|
||||||
| teacher1 | C1 | editingteacher | 0 | |
|
| teacher1 | C1 | editingteacher | 0 | |
|
||||||
| teacher1 | C2 | editingteacher | 0 | |
|
| teacher1 | C2 | editingteacher | 0 | |
|
||||||
And the following "groups" exist:
|
|
||||||
| name | course | idnumber |
|
|
||||||
| Group 1 | C1 | G1 |
|
|
||||||
| Group 2 | C1 | G2 |
|
|
||||||
And the following "group members" exist:
|
|
||||||
| user | group |
|
|
||||||
| student2 | G1 |
|
|
||||||
| student2 | G2 |
|
|
||||||
| student3 | G2 |
|
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Show all users in a course that match a single filter value
|
Scenario: Show all users in a course that match a single filter value
|
||||||
|
@ -95,6 +87,23 @@ Feature: Course participants can be filtered to display all the users
|
||||||
And I should see "Show 20 per page"
|
And I should see "Show 20 per page"
|
||||||
And I should not see "Show all 24"
|
And I should not see "Show all 24"
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: Show all users as a student
|
||||||
|
Given I log in as "student1"
|
||||||
|
And I am on "Course 1" course homepage
|
||||||
|
And I navigate to course participants
|
||||||
|
And I set the field "Match" in the "Filter 1" "fieldset" to "All"
|
||||||
|
And I set the field "type" in the "Filter 1" "fieldset" to "Roles"
|
||||||
|
And I click on ".form-autocomplete-downarrow" "css_element" in the "Filter 1" "fieldset"
|
||||||
|
And I click on "Student" "list_item"
|
||||||
|
When I click on "Apply filters" "button"
|
||||||
|
Then I should see "24 participants found"
|
||||||
|
And I should see "Show all 24"
|
||||||
|
And I should not see "Show 20 per page"
|
||||||
|
And I click on "Show all 24" "link"
|
||||||
|
And I should see "Show 20 per page"
|
||||||
|
And I should not see "Show all 24"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Apply one value for more than one filter and show all matching users
|
Scenario: Apply one value for more than one filter and show all matching users
|
||||||
Given I log in as "teacher1"
|
Given I log in as "teacher1"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue