Browse Source

Improve test to hide status from view.

MOODLE_34_STABLE
Dan Marsden 8 years ago
parent
commit
24ebc7b423
  1. 16
      renderer.php
  2. 16
      tests/behat/attendance_mod.feature

16
renderer.php

@ -1650,17 +1650,19 @@ class mod_attendance_renderer extends plugin_renderer_base {
$emptydescription = $this->construct_notice(get_string('emptydescription', 'mod_attendance') , 'notifyproblem');
}
}
$table->data[$i][] = $i;
$table->data[$i][] = $this->construct_text_input('acronym['.$st->id.']', 2, 2, $st->acronym) . $emptyacronym;
$table->data[$i][] = $this->construct_text_input('description['.$st->id.']', 30, 30, $st->description) .
$cells = array();
$cells[] = $i;
$cells[] = $this->construct_text_input('acronym['.$st->id.']', 2, 2, $st->acronym) . $emptyacronym;
$cells[] = $this->construct_text_input('description['.$st->id.']', 30, 30, $st->description) .
$emptydescription;
$table->data[$i][] = $this->construct_text_input('grade['.$st->id.']', 4, 4, $st->grade);
$cells[] = $this->construct_text_input('grade['.$st->id.']', 4, 4, $st->grade);
if ($studentscanmark) {
$table->data[$i][] = $this->construct_text_input('studentavailability['.$st->id.']', 4, 5, $st->studentavailability);
$cells[] = $this->construct_text_input('studentavailability['.$st->id.']', 4, 5, $st->studentavailability);
}
$table->data[$i][] = $this->construct_preferences_actions_icons($st, $prefdata);
$cells[] = $this->construct_preferences_actions_icons($st, $prefdata);
$table->data[$i] = new html_table_row($cells);
$table->data[$i]->style = "statusrow".$i;
$i++;
}

16
tests/behat/attendance_mod.feature

@ -37,7 +37,7 @@ Feature: Teachers and Students can record session attendance
And I should see "Attendance"
And I log out
Scenario: Students can mark their own attendance
Scenario: Students can mark their own attendance and teacher can hide specific status from students.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Attendance"
@ -53,6 +53,20 @@ Feature: Teachers and Students can record session attendance
And I am on "Course 1" course homepage
And I follow "Attendance"
And I follow "Submit attendance"
And I should see "Excused"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Attendance"
And I follow "Status set"
And I set the field with the ".statusrow2 .c4" "css_element" to "0"
And I press "Update"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Attendance"
And I follow "Submit attendance"
And I should not see "Excused"
And I set the field "Present" to "1"
And I press "Save changes"
And I should see "Self-recorded"

Loading…
Cancel
Save