MDL-70719 quiz overrides: only show Actions column header if needed

This commit is contained in:
Mahmoud Kassaei
2021-02-05 15:46:37 +00:00
parent 4e398ff3f7
commit d2f8ea2073
2 changed files with 13 additions and 6 deletions
+9 -6
View File
@@ -147,17 +147,20 @@ if ($groupmode) {
// Initialise table.
$table = new html_table();
$table->head = $headers;
$table->colclasses = $colclasses;
$table->headspan = array_fill(0, count($headers), 1);
$table->head[] = get_string('overrides', 'quiz');
$table->colclasses[] = 'colsetting';
$table->colclasses[] = 'colvalue';
$table->colclasses[] = 'colaction';
$table->headspan = array_fill(0, count($headers), 1);
$table->headspan[] = 2;
$table->headspan[] = 1;
$table->head = $headers;
$table->head[] = get_string('overrides', 'quiz');
$table->head[] = get_string('action');
if ($canedit) {
$table->head[] = get_string('action');
$table->colclasses[] = 'colaction';
$table->headspan[] = 1;
}
$userurl = new moodle_url('/user/view.php', []);
$groupurl = new moodle_url('/group/overview.php', ['id' => $cm->course]);
@@ -44,6 +44,7 @@ Feature: Quiz user override
And I set the following fields to these values:
| timeclose[year] | 2030 |
And I press "Save"
And I should see "Action"
And I should see "Tuesday, 1 January 2030, 8:00" in the "Student One" "table_row"
And I should see "student1@example.com" in the "Student One" "table_row"
@@ -64,6 +65,7 @@ Feature: Quiz user override
| Attempts allowed | 1 |
And I press "Save"
Then I should see "This override is inactive"
And I should see "Action"
And "Edit" "icon" should exist in the "Student One" "table_row"
And "copy" "icon" should exist in the "Student One" "table_row"
And "Delete" "icon" should exist in the "Student One" "table_row"
@@ -82,6 +84,7 @@ Feature: Quiz user override
| Override user | Student One |
| Attempts allowed | 1 |
And I press "Save"
And I should see "Action"
And I should not see "student1@example.com"
And "Edit" "icon" should exist in the "Student One" "table_row"
And "copy" "icon" should exist in the "Student One" "table_row"
@@ -139,6 +142,7 @@ Feature: Quiz user override
Then "Student One" "table_row" should exist
And "Student Two" "table_row" should exist
And "Add user override" "button" should not exist
And I should not see "Action"
And "Edit" "link" should not exist in the "Student One" "table_row"
And "Copy" "link" should not exist in the "Student One" "table_row"
And "Delete" "link" should not exist in the "Student One" "table_row"