';
$string['sessiontypeshort'] = 'Type';
$string['sessionupdated'] = 'Session successfully updated';
+$string['setallstatuses'] = 'Set status for all users';
$string['setallstatusesto'] = 'Set status for all users to «{$a}»';
$string['settings'] = 'Settings';
$string['showdefaults'] = 'Show defaults';
$table->size[] = '20px';
$table->attributes['class'] = 'generaltable takelist';
+ // Show a 'select all' row of radio buttons.
+ $row = new html_table_row();
+ $row->cells[] = '';
+ $row->cells[] = html_writer::div(get_string('setallstatuses', 'attendance'), 'setallstatuses');
+ foreach ($takedata->statuses as $st) {
+ $attribs = array(
+ 'type' => 'radio',
+ 'title' => get_string('setallstatusesto', 'attendance', $st->description),
+ 'onclick' => "select_all_in(null, 'st" . $st->id . "', null);",
+ 'name' => 'setallstatuses',
+ 'class' => "st{$st->id}",
+ );
+ $row->cells[] = html_writer::empty_tag('input', $attribs);
+ }
+ $row->cells[] = '';
+ $table->data[] = $row;
+
$i = 0;
foreach ($takedata->users as $user) {
$i++;
}
#page-mod-attendance-sessions input[type="checkbox"] {
margin-right: 2px;
-}
\ No newline at end of file
+}
+
+.path-mod-attendance .setallstatuses {
+ text-align: right;
+}
+
And "Set status for all users to «OK»" "link" should exist
And "Set status for all users to «Bad»" "link" should exist
+ Scenario: A teacher can use the radio buttons to set attendance values for all users
+ Given I log in as "teacher1"
+ And I follow "Course 1"
+ And I follow "Test attendance"
+ And I follow "Add"
+ And I set the following fields to these values:
+ | Create multiple sessions | 0 |
+ And I click on "submitbutton" "button"
+ And I follow "Sessions"
+ And I click on "Take attendance" "link"
+
+ When I click on "setallstatuses" "field" in the ".takelist tbody td.c3" "css_element"
+ And I press "Save attendance"
+ And I follow "Report"
+ Then "L" "text" should exist in the "Student 1" "table_row"
+ And "L" "text" should exist in the "Student 2" "table_row"
+ And "L" "text" should exist in the "Student 3" "table_row"