~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to mod/lesson/tests/behat/lesson_review.feature

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@mod @mod_lesson
 
2
Feature: In a lesson activity, students can review the answers they gave to questions
 
3
  To review questions of a lesson
 
4
  As a student
 
5
  I need to complete a lesson answering all of the questions.
 
6
 
 
7
  @javascript
 
8
  Scenario: Student answers questions and then reviews them.
 
9
    Given the following "users" exist:
 
10
      | username | firstname | lastname | email |
 
11
      | teacher1 | Teacher | 1 | teacher1@asd.com |
 
12
      | student1 | Student | 1 | student1@asd.com |
 
13
    And the following "courses" exist:
 
14
      | fullname | shortname | category |
 
15
      | Course 1 | C1 | 0 |
 
16
    And the following "course enrolments" exist:
 
17
      | user | course | role |
 
18
      | teacher1 | C1 | editingteacher |
 
19
      | student1 | C1 | student |
 
20
    And I log in as "teacher1"
 
21
    And I follow "Course 1"
 
22
    And I turn editing mode on
 
23
    And I add a "Lesson" to section "1" and I fill the form with:
 
24
      | Name | Test lesson name |
 
25
      | Display ongoing score | Yes |
 
26
      | Slideshow | Yes |
 
27
      | Maximum number of answers | 10 |
 
28
      | Allow student review | Yes |
 
29
      | Maximum number of attempts | 3 |
 
30
      | Custom scoring | No |
 
31
      | Re-takes allowed | Yes |
 
32
    And I follow "Test lesson name"
 
33
    And I follow "Add a question page"
 
34
    And I set the field "Select a question type" to "Numerical"
 
35
    And I press "Add a question page"
 
36
    And I set the following fields to these values:
 
37
      | Page title | Hardest question ever |
 
38
      | Page contents | 1 + 1? |
 
39
      | id_answer_editor_0 | 2 |
 
40
      | id_response_editor_0 | Correct answer |
 
41
      | id_jumpto_0 | Next page |
 
42
      | id_answer_editor_1 | 1 |
 
43
      | id_response_editor_1 | Incorrect answer |
 
44
      | id_jumpto_1 | This page |
 
45
    And I press "Save page"
 
46
    And I set the field "qtype" to "Question"
 
47
    And I set the field "Select a question type" to "True/false"
 
48
    And I press "Add a question page"
 
49
    And I set the following fields to these values:
 
50
      | Page title | Next question |
 
51
      | Page contents | Paper is made from trees. |
 
52
      | id_answer_editor_0 | True |
 
53
      | id_response_editor_0 | Correct |
 
54
      | id_jumpto_0 | Next page |
 
55
      | id_answer_editor_1 | False |
 
56
      | id_response_editor_1 | Wrong |
 
57
      | id_jumpto_1 | This page |
 
58
    And I press "Save page"
 
59
    And I log out
 
60
    And I log in as "student1"
 
61
    And I follow "Course 1"
 
62
    And I follow "Test lesson name"
 
63
    And I should see "You have answered 0 correctly out of 0 attempts."
 
64
    And I set the following fields to these values:
 
65
      | Your answer | 1 |
 
66
    And I press "Submit"
 
67
    And I should see "You have answered 0 correctly out of 1 attempts."
 
68
    And I press "Continue"
 
69
    And I set the following fields to these values:
 
70
      | Your answer | 2 |
 
71
    And I press "Submit"
 
72
    And I should see "You have answered 1 correctly out of 2 attempts."
 
73
    And I press "Continue"
 
74
    And I set the following fields to these values:
 
75
      | True | 1 |
 
76
    And I press "Submit"
 
77
    And I should see "You have answered 2 correctly out of 3 attempts."
 
78
    And I press "Continue"
 
79
    When I follow "Review lesson"
 
80
    Then I should see "You have answered 2 correctly out of 3 attempts."
 
81
    And I press "Next page"
 
82
    And I should see "You have answered 2 correctly out of 3 attempts."
 
83
    And I press "Continue"
 
84
    And I should see "You have answered 2 correctly out of 3 attempts."
 
85
    And I press "Next page"
 
86
    And I should see "You have answered 2 correctly out of 3 attempts."