mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-65950 core_user: Use new core/checkbox-toggleall
This commit is contained in:
parent
8e9e9a5f7e
commit
df92be9d67
7 changed files with 177 additions and 162 deletions
2
user/amd/build/participants.min.js
vendored
2
user/amd/build/participants.min.js
vendored
|
@ -1,2 +1,2 @@
|
|||
define ("core_user/participants",["jquery","core/str","core/modal_factory","core/modal_events","core/templates","core/notification","core/ajax"],function(a,b,c,d,e,f,g){var h={BULKACTIONSELECT:"#formactionid",BULKUSERCHECKBOXES:"input.usercheckbox",BULKUSERNOSCHECKBOXES:"input.usercheckbox[value='0']",BULKUSERSELECTEDCHECKBOXES:"input.usercheckbox:checked",BULKACTIONFORM:"#participantsform",CHECKALLBUTTON:"#checkall",CHECKALLNOSBUTTON:"#checkallnos",CHECKALLONPAGEBUTTON:"#checkallonpage",CHECKNONEBUTTON:"#checknone"},i=function(a){this.courseId=a.courseid;this.noteStateNames=a.noteStateNames;this.stateHelpIcon=a.stateHelpIcon;this.attachEventListeners()};i.prototype.modal=null;i.prototype.courseId=-1;i.prototype.noteStateNames={};i.prototype.stateHelpIcon="";i.prototype.attachEventListeners=function(){a(h.BULKACTIONSELECT).on("change",function(b){var c=a(b.target).val();if(-1!==c.indexOf("#")){b.preventDefault();var d=[];a(h.BULKUSERSELECTEDCHECKBOXES).each(function(b,c){var e=a(c).attr("name"),f=e.replace("user","");d.push(f)});if("#messageselect"==c){this.showSendMessage(d).fail(f.exception)}else if("#addgroupnote"==c){this.showAddNote(d).fail(f.exception)}a(h.BULKACTIONSELECT+" option[value=\"\"]").prop("selected","selected")}else if(""!==c){if(0<a(h.BULKUSERSELECTEDCHECKBOXES).length){a(h.BULKACTIONFORM).submit()}else{a(h.BULKACTIONSELECT+" option[value=\"\"]").prop("selected","selected")}}}.bind(this));a(h.CHECKALLBUTTON).on("click",function(){var b=a(this).data("showallink");if(b){window.location=b}});a(h.CHECKALLNOSBUTTON).on("click",function(){a(h.BULKUSERNOSCHECKBOXES).prop("checked",!0)});a(h.CHECKALLONPAGEBUTTON).on("click",function(){a(h.BULKUSERCHECKBOXES).prop("checked",!0)});a(h.CHECKNONEBUTTON).on("click",function(){a(h.BULKUSERCHECKBOXES).prop("checked",!1)})};i.prototype.showAddNote=function(f){if(0==f.length){return a.Deferred().resolve().promise()}var g=[];for(var i in this.noteStateNames){switch(i){case"draft":g.push({value:"personal",label:this.noteStateNames[i]});break;case"public":g.push({value:"course",label:this.noteStateNames[i],selected:1});break;case"site":g.push({value:i,label:this.noteStateNames[i]});break;}}var j={stateNames:g,stateHelpIcon:this.stateHelpIcon},k=null;if(1==f.length){k=b.get_string("addbulknotesingle","core_notes")}else{k=b.get_string("addbulknote","core_notes",f.length)}return a.when(c.create({type:c.types.SAVE_CANCEL,body:e.render("core_user/add_bulk_note",j)}),k).then(function(b,c){this.modal=b;this.modal.setTitle(c);this.modal.setSaveButtonText(c);this.modal.getRoot().on(d.hidden,function(){var b=a("#user-notifications [role=alert]");if(b.length){b.focus()}else{a(h.BULKACTIONSELECT).focus()}this.modal.getRoot().remove()}.bind(this));this.modal.getRoot().on(d.save,this.submitAddNote.bind(this,f));this.modal.show();return this.modal}.bind(this))};i.prototype.submitAddNote=function(a){var c=this.modal.getRoot().find("form textarea").val(),d=this.modal.getRoot().find("form select").val(),e=[],h=0;for(h=0;h<a.length;h++){e.push({userid:a[h],text:c,courseid:this.courseId,publishstate:d})}return g.call([{methodname:"core_notes_create_notes",args:{notes:e}}])[0].then(function(a){if(1==a.length){return b.get_string("addbulknotedonesingle","core_notes")}else{return b.get_string("addbulknotedone","core_notes",a.length)}}).then(function(a){f.addNotification({message:a,type:"success"});return!0}).catch(f.exception)};i.prototype.showSendMessage=function(f){if(0==f.length){return a.Deferred().resolve().promise()}var g=null;if(1==f.length){g=b.get_string("sendbulkmessagesingle","core_message")}else{g=b.get_string("sendbulkmessage","core_message",f.length)}return a.when(c.create({type:c.types.SAVE_CANCEL,body:e.render("core_user/send_bulk_message",{})}),g).then(function(b,c){this.modal=b;this.modal.setTitle(c);this.modal.setSaveButtonText(c);this.modal.getRoot().on(d.hidden,function(){a(h.BULKACTIONSELECT).focus();this.modal.getRoot().remove()}.bind(this));this.modal.getRoot().on(d.save,this.submitSendMessage.bind(this,f));this.modal.show();return this.modal}.bind(this))};i.prototype.submitSendMessage=function(a){var c=this.modal.getRoot().find("form textarea").val(),d=[],e=0;for(e=0;e<a.length;e++){d.push({touserid:a[e],text:c})}return g.call([{methodname:"core_message_send_instant_messages",args:{messages:d}}])[0].then(function(a){if(1==a.length){return b.get_string("sendbulkmessagesentsingle","core_message")}else{return b.get_string("sendbulkmessagesent","core_message",a.length)}}).then(function(a){f.addNotification({message:a,type:"success"});return!0}).catch(f.exception)};return{init:function init(a){return new i(a)}}});
|
||||
define ("core_user/participants",["jquery","core/str","core/modal_factory","core/modal_events","core/templates","core/notification","core/ajax"],function(a,b,c,d,e,f,g){var h={BULKACTIONSELECT:"#formactionid",BULKUSERCHECKBOXES:"input.usercheckbox",BULKUSERNOSCHECKBOXES:"input.usercheckbox[value='0']",BULKUSERSELECTEDCHECKBOXES:"input.usercheckbox:checked",BULKACTIONFORM:"#participantsform",CHECKALLBUTTON:"#checkall",CHECKALLNOSBUTTON:"#checkallnos"},i=function(a){this.courseId=a.courseid;this.noteStateNames=a.noteStateNames;this.stateHelpIcon=a.stateHelpIcon;this.attachEventListeners()};i.prototype.modal=null;i.prototype.courseId=-1;i.prototype.noteStateNames={};i.prototype.stateHelpIcon="";i.prototype.attachEventListeners=function(){a(h.BULKACTIONSELECT).on("change",function(b){var c=a(b.target).val();if(-1!==c.indexOf("#")){b.preventDefault();var d=[];a(h.BULKUSERSELECTEDCHECKBOXES).each(function(b,c){var e=a(c).attr("name"),f=e.replace("user","");d.push(f)});if("#messageselect"==c){this.showSendMessage(d).fail(f.exception)}else if("#addgroupnote"==c){this.showAddNote(d).fail(f.exception)}a(h.BULKACTIONSELECT+" option[value=\"\"]").prop("selected","selected")}else if(""!==c){if(0<a(h.BULKUSERSELECTEDCHECKBOXES).length){a(h.BULKACTIONFORM).submit()}else{a(h.BULKACTIONSELECT+" option[value=\"\"]").prop("selected","selected")}}}.bind(this));a(h.CHECKALLBUTTON).on("click",function(){var b=a(this).data("showallink");if(b){window.location=b}});a(h.CHECKALLNOSBUTTON).on("click",function(){a(h.BULKUSERNOSCHECKBOXES).prop("checked",!0)})};i.prototype.showAddNote=function(f){if(0==f.length){return a.Deferred().resolve().promise()}var g=[];for(var i in this.noteStateNames){switch(i){case"draft":g.push({value:"personal",label:this.noteStateNames[i]});break;case"public":g.push({value:"course",label:this.noteStateNames[i],selected:1});break;case"site":g.push({value:i,label:this.noteStateNames[i]});break;}}var j={stateNames:g,stateHelpIcon:this.stateHelpIcon},k=null;if(1==f.length){k=b.get_string("addbulknotesingle","core_notes")}else{k=b.get_string("addbulknote","core_notes",f.length)}return a.when(c.create({type:c.types.SAVE_CANCEL,body:e.render("core_user/add_bulk_note",j)}),k).then(function(b,c){this.modal=b;this.modal.setTitle(c);this.modal.setSaveButtonText(c);this.modal.getRoot().on(d.hidden,function(){var b=a("#user-notifications [role=alert]");if(b.length){b.focus()}else{a(h.BULKACTIONSELECT).focus()}this.modal.getRoot().remove()}.bind(this));this.modal.getRoot().on(d.save,this.submitAddNote.bind(this,f));this.modal.show();return this.modal}.bind(this))};i.prototype.submitAddNote=function(a){var c=this.modal.getRoot().find("form textarea").val(),d=this.modal.getRoot().find("form select").val(),e=[],h=0;for(h=0;h<a.length;h++){e.push({userid:a[h],text:c,courseid:this.courseId,publishstate:d})}return g.call([{methodname:"core_notes_create_notes",args:{notes:e}}])[0].then(function(a){if(1==a.length){return b.get_string("addbulknotedonesingle","core_notes")}else{return b.get_string("addbulknotedone","core_notes",a.length)}}).then(function(a){f.addNotification({message:a,type:"success"});return!0}).catch(f.exception)};i.prototype.showSendMessage=function(f){if(0==f.length){return a.Deferred().resolve().promise()}var g=null;if(1==f.length){g=b.get_string("sendbulkmessagesingle","core_message")}else{g=b.get_string("sendbulkmessage","core_message",f.length)}return a.when(c.create({type:c.types.SAVE_CANCEL,body:e.render("core_user/send_bulk_message",{})}),g).then(function(b,c){this.modal=b;this.modal.setTitle(c);this.modal.setSaveButtonText(c);this.modal.getRoot().on(d.hidden,function(){a(h.BULKACTIONSELECT).focus();this.modal.getRoot().remove()}.bind(this));this.modal.getRoot().on(d.save,this.submitSendMessage.bind(this,f));this.modal.show();return this.modal}.bind(this))};i.prototype.submitSendMessage=function(a){var c=this.modal.getRoot().find("form textarea").val(),d=[],e=0;for(e=0;e<a.length;e++){d.push({touserid:a[e],text:c})}return g.call([{methodname:"core_message_send_instant_messages",args:{messages:d}}])[0].then(function(a){if(1==a.length){return b.get_string("sendbulkmessagesentsingle","core_message")}else{return b.get_string("sendbulkmessagesent","core_message",a.length)}}).then(function(a){f.addNotification({message:a,type:"success"});return!0}).catch(f.exception)};return{init:function init(a){return new i(a)}}});
|
||||
//# sourceMappingURL=participants.min.js.map
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -32,9 +32,7 @@ define(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/t
|
|||
BULKUSERSELECTEDCHECKBOXES: "input.usercheckbox:checked",
|
||||
BULKACTIONFORM: "#participantsform",
|
||||
CHECKALLBUTTON: "#checkall",
|
||||
CHECKALLNOSBUTTON: "#checkallnos",
|
||||
CHECKALLONPAGEBUTTON: "#checkallonpage",
|
||||
CHECKNONEBUTTON: "#checknone"
|
||||
CHECKALLNOSBUTTON: "#checkallnos"
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -121,13 +119,6 @@ define(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/t
|
|||
$(SELECTORS.CHECKALLNOSBUTTON).on('click', function() {
|
||||
$(SELECTORS.BULKUSERNOSCHECKBOXES).prop('checked', true);
|
||||
});
|
||||
$(SELECTORS.CHECKALLONPAGEBUTTON).on('click', function() {
|
||||
$(SELECTORS.BULKUSERCHECKBOXES).prop('checked', true);
|
||||
});
|
||||
|
||||
$(SELECTORS.CHECKNONEBUTTON).on('click', function() {
|
||||
$(SELECTORS.BULKUSERCHECKBOXES).prop('checked', false);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -147,10 +147,12 @@ class participants_table extends \table_sql {
|
|||
*/
|
||||
public function __construct($courseid, $currentgroup, $accesssince, $roleid, $enrolid, $status, $search,
|
||||
$bulkoperations, $selectall) {
|
||||
global $CFG;
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
parent::__construct('user-index-participants-' . $courseid);
|
||||
|
||||
$this->selectall = $selectall;
|
||||
|
||||
// Get the context.
|
||||
$this->course = get_course($courseid);
|
||||
$context = \context_course::instance($courseid, MUST_EXIST);
|
||||
|
@ -161,7 +163,15 @@ class participants_table extends \table_sql {
|
|||
$columns = [];
|
||||
|
||||
if ($bulkoperations) {
|
||||
$headers[] = get_string('select');
|
||||
$mastercheckbox = new \core\output\checkbox_toggleall('participants-table', true, [
|
||||
'id' => 'select-all-participants',
|
||||
'name' => 'select-all-participants',
|
||||
'label' => $this->selectall ? get_string('deselectall') : get_string('selectall'),
|
||||
'labelclasses' => 'sr-only',
|
||||
'classes' => 'm-1',
|
||||
'checked' => $this->selectall
|
||||
]);
|
||||
$headers[] = $OUTPUT->render($mastercheckbox);
|
||||
$columns[] = 'select';
|
||||
}
|
||||
|
||||
|
@ -228,7 +238,6 @@ class participants_table extends \table_sql {
|
|||
$this->search = $search;
|
||||
$this->enrolid = $enrolid;
|
||||
$this->status = $status;
|
||||
$this->selectall = $selectall;
|
||||
$this->countries = get_string_manager()->get_list_of_countries(true);
|
||||
$this->extrafields = $extrafields;
|
||||
$this->context = $context;
|
||||
|
@ -266,12 +275,15 @@ class participants_table extends \table_sql {
|
|||
* @return string
|
||||
*/
|
||||
public function col_select($data) {
|
||||
if ($this->selectall) {
|
||||
$checked = 'checked="true"';
|
||||
} else {
|
||||
$checked = '';
|
||||
}
|
||||
return '<input type="checkbox" class="usercheckbox" name="user' . $data->id . '" ' . $checked . '/>';
|
||||
global $OUTPUT;
|
||||
|
||||
$checkbox = new \core\output\checkbox_toggleall('participants-table', false, [
|
||||
'classes' => 'usercheckbox m-1',
|
||||
'name' => 'user' . $data->id,
|
||||
'checked' => $this->selectall
|
||||
]);
|
||||
|
||||
return $OUTPUT->render($checkbox);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -469,5 +481,19 @@ class participants_table extends \table_sql {
|
|||
$this->initialbars(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the table show_hide_link to not show for select column.
|
||||
*
|
||||
* @param string $column the column name, index into various names.
|
||||
* @param int $index numerical index of the column.
|
||||
* @return string HTML fragment.
|
||||
*/
|
||||
protected function show_hide_link($column, $index) {
|
||||
if ($index > 0) {
|
||||
return parent::show_hide_link($column, $index);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -280,16 +280,7 @@ if ($bulkoperations) {
|
|||
$label = get_string('selectalluserswithcount', 'moodle', $participanttable->totalrows);
|
||||
echo html_writer::tag('input', "", array('type' => 'button', 'id' => 'checkall', 'class' => 'btn btn-secondary',
|
||||
'value' => $label, 'data-showallink' => $showalllink));
|
||||
// Select all users, mark all users on page as selected.
|
||||
echo html_writer::tag('input', "", array('type' => 'button', 'id' => 'checkallonpage', 'class' => 'btn btn-secondary',
|
||||
'value' => get_string('selectallusersonpage')));
|
||||
} else {
|
||||
echo html_writer::tag('input', "", array('type' => 'button', 'id' => 'checkallonpage', 'class' => 'btn btn-secondary',
|
||||
'value' => get_string('selectall')));
|
||||
}
|
||||
|
||||
echo html_writer::tag('input', "", array('type' => 'button', 'id' => 'checknone', 'class' => 'btn btn-secondary',
|
||||
'value' => get_string('deselectall')));
|
||||
echo html_writer::end_tag('div');
|
||||
$displaylist = array();
|
||||
if (!empty($CFG->messaging)) {
|
||||
|
@ -339,10 +330,17 @@ if ($bulkoperations) {
|
|||
}
|
||||
}
|
||||
|
||||
$selectactionparams = array(
|
||||
'id' => 'formactionid',
|
||||
'class' => 'ml-2',
|
||||
'data-action' => 'toggle',
|
||||
'data-togglegroup' => 'participants-table',
|
||||
'data-toggle' => 'action',
|
||||
'disabled' => empty($selectall)
|
||||
);
|
||||
echo html_writer::tag('div', html_writer::tag('label', get_string("withselectedusers"),
|
||||
array('for' => 'formactionid', 'class' => 'col-form-label d-inline')) .
|
||||
html_writer::select($displaylist, 'formaction', '', array('' => 'choosedots'), array('id' => 'formactionid')),
|
||||
array('class' => 'ml-2'));
|
||||
html_writer::select($displaylist, 'formaction', '', array('' => 'choosedots'), $selectactionparams));
|
||||
|
||||
echo '<input type="hidden" name="id" value="'.$course->id.'" />';
|
||||
echo '<noscript style="display:inline">';
|
||||
|
|
|
@ -27,7 +27,7 @@ Feature: Bulk enrolments
|
|||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to course participants
|
||||
And I press "Select all"
|
||||
And I click on "Select all" "checkbox"
|
||||
And I set the field "With selected users..." to "Edit selected user enrolments"
|
||||
And I set the field "Alter status" to "Suspended"
|
||||
And I press "Save changes"
|
||||
|
@ -40,7 +40,7 @@ Feature: Bulk enrolments
|
|||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to course participants
|
||||
And I press "Select all"
|
||||
And I click on "Select all" "checkbox"
|
||||
And I set the field "With selected users..." to "Delete selected user enrolments"
|
||||
And I press "Unenrol users"
|
||||
Then I should not see "Student 1"
|
||||
|
|
|
@ -59,49 +59,49 @@ Feature: View course participants
|
|||
Given I log in as "teacher1x"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to course participants
|
||||
When I press "Select all"
|
||||
Then the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "1"
|
||||
When I click on "Select all" "checkbox"
|
||||
Then the field with xpath "//tbody//tr[1]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[2]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[3]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[4]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[5]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[6]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[7]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[8]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[9]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[10]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[11]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[12]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[13]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[14]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[15]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[16]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[17]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[18]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[19]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[20]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
|
||||
And I press "Deselect all"
|
||||
And the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "0"
|
||||
And I click on "Deselect all" "checkbox"
|
||||
And the field with xpath "//tbody//tr[1]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[2]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[3]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[4]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[5]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[6]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[7]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[8]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[9]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[10]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[11]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[12]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[13]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[14]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[15]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[16]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[17]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[18]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[19]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[20]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
|
||||
Scenario: Sort and paginate the list of users
|
||||
Given I log in as "teacher1x"
|
||||
|
@ -123,7 +123,7 @@ Feature: View course participants
|
|||
And I should see "student0x@example.com"
|
||||
|
||||
@javascript
|
||||
Scenario: Use select all users on this page, select all n users and deselect all
|
||||
Scenario: Use select all users on this page, select all users and deselect all
|
||||
Given the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| student19x | C1 | student |
|
||||
|
@ -131,97 +131,97 @@ Feature: View course participants
|
|||
And I am on "Course 1" course homepage
|
||||
And I navigate to course participants
|
||||
And I follow "Surname"
|
||||
And I press "Select all users on this page"
|
||||
And I click on "Select all" "checkbox"
|
||||
Then I should not see "Student 9x"
|
||||
And the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[1]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[2]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[3]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[4]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[5]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[6]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[7]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[8]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[9]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[10]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[11]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[12]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[13]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[14]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[15]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[16]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[17]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[18]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[19]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[20]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
|
||||
And I press "Deselect all"
|
||||
And the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "0"
|
||||
And I click on "Deselect all" "checkbox"
|
||||
And the field with xpath "//tbody//tr[1]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[2]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[3]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[4]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[5]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[6]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[7]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[8]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[9]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[10]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[11]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[12]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[13]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[14]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[15]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[16]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[17]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[18]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[19]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[20]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
|
||||
And I press "Select all 21 users"
|
||||
And I should see "Student 9x"
|
||||
And the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[21]//input[@class='usercheckbox']" matches value "1"
|
||||
And the field with xpath "//tbody//tr[1]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[2]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[3]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[4]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[5]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[6]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[7]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[8]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[9]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[10]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[11]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[12]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[13]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[14]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[15]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[16]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[17]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[18]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[19]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[20]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
And the field with xpath "//tbody//tr[21]//input[contains(@class, 'usercheckbox')]" matches value "1"
|
||||
|
||||
And I press "Deselect all"
|
||||
And the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "0"
|
||||
And the field with xpath "//tbody//tr[21]//input[@class='usercheckbox']" matches value "0"
|
||||
And I click on "Deselect all" "checkbox"
|
||||
And the field with xpath "//tbody//tr[1]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[2]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[3]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[4]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[5]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[6]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[7]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[8]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[9]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[10]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[11]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[12]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[13]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[14]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[15]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[16]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[17]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[18]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[19]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[20]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
And the field with xpath "//tbody//tr[21]//input[contains(@class, 'usercheckbox')]" matches value "0"
|
||||
|
||||
Scenario: View the participants page as a teacher
|
||||
Given I log in as "teacher1x"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue