1 |
efrain |
1 |
@mod @mod_questionnaire @core_completion
|
|
|
2 |
Feature: View activity completion information in the questionnaire activity
|
|
|
3 |
In order to have visibility of questionnaire completion requirements
|
|
|
4 |
As a student
|
|
|
5 |
I need to be able to view my questionnaire completion progress
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student1 | Student | 1 | student1@example.com |
|
|
|
11 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | enablecompletion |
|
|
|
14 |
| Course 1 | C1 | 1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| student1 | C1 | student |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | introduction | course | idnumber | completion | completionview | completionpostsenabled | completionposts |
|
|
|
21 |
| questionnaire | Test questionnaire completion | Test questionnaire description | C1 | questionnaire2 | 2 | 1 | 1 | 1 |
|
|
|
22 |
|
|
|
23 |
@javascript
|
|
|
24 |
Scenario: Check questionnaire completion feature in web.
|
|
|
25 |
Given I log in as "teacher1"
|
|
|
26 |
And I am on "Course 1" course homepage
|
|
|
27 |
And I follow "Test questionnaire completion"
|
|
|
28 |
Then I click on "Add questions" "link"
|
|
|
29 |
And I add a "Yes/No" question and I fill the form with:
|
|
|
30 |
| Question Name | Q1 |
|
|
|
31 |
| Yes | y |
|
|
|
32 |
| Question Text | Are you still in School? |
|
|
|
33 |
Then I should see "[Yes/No] (Q1)"
|
|
|
34 |
And I add a "Radio Buttons" question and I fill the form with:
|
|
|
35 |
| Question Name | Q2 |
|
|
|
36 |
| Yes | y |
|
|
|
37 |
| Horizontal | Checked |
|
|
|
38 |
| Question Text | Select one choice |
|
|
|
39 |
| Possible answers | 1=One,2=Two,3=Three,4=Four |
|
|
|
40 |
Then I should see "[Radio Buttons] (Q2)"
|
|
|
41 |
And I add a "Text Box" question and I fill the form with:
|
|
|
42 |
| Question Name | Q8 |
|
|
|
43 |
| No | n |
|
|
|
44 |
| Input box length | 10 |
|
|
|
45 |
| Max. text length | 15 |
|
|
|
46 |
| Question Text | Enter some text |
|
|
|
47 |
Then I should see "[Text Box] (Q8)"
|
|
|
48 |
And I am on the "Test questionnaire completion" "questionnaire activity editing" page
|
|
|
49 |
And I set the following fields to these values:
|
|
|
50 |
| Completion tracking | Show activity as complete when conditions are met |
|
|
|
51 |
And I click on "Student must submit this questionnaire to complete it" "checkbox"
|
|
|
52 |
And I press "Save and display"
|
|
|
53 |
|
|
|
54 |
And I am on the "Test questionnaire completion" "questionnaire activity" page
|
|
|
55 |
Then I should see "You are not eligible to take this questionnaire."
|
|
|
56 |
|
|
|
57 |
And I am on the "Test questionnaire completion" "questionnaire activity" page logged in as "student1"
|
|
|
58 |
And I click on "Answer the questions..." "link"
|
|
|
59 |
Then I should see "Are you still in School?"
|
|
|
60 |
And I should see "Select one choice"
|
|
|
61 |
And I should see "Enter some text"
|
|
|
62 |
And I click on "Yes" "radio"
|
|
|
63 |
And I click on "Three" "radio"
|
|
|
64 |
And I press "Submit questionnaire"
|
|
|
65 |
Then I should see "Thank you for completing this Questionnaire."
|
|
|
66 |
And I press "Continue"
|
|
|
67 |
Then I should see "View your response(s)"
|