Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_lesson
2
Feature: Set the maximum number of attempts for lesson activity question
3
  In order to limit the number of attempts a student can take for lesson activity question
4
  As a teacher
5
  I should be able to set the maximum number of attempts for a lesson activity question
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | Teacher   | 1        | teacher1@example.com |
11
      | student1 | Student   | 1        | student1@example.com |
12
    And the following "courses" exist:
13
      | fullname | shortname |
14
      | Course 1 | C1        |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | teacher1 | C1     | editingteacher |
18
      | student1 | C1     | student        |
19
 
20
  Scenario: Lesson activity question maximum number of attempts can be set
21
    Given the following "activities" exist:
22
      | activity   | name             | course | modattempts | review | maxattempts | feedback |
23
      | lesson     | Test lesson name | C1     | 0           | 1      | 2           | 1        |
24
    And the following "mod_lesson > pages" exist:
25
      | lesson           | qtype     | title      | content               |
26
      | Test lesson name | truefalse | Question 1 | Dolphins are mammals. |
27
      | Test lesson name | truefalse | Question 2 | Trees are plants.     |
28
    And the following "mod_lesson > answers" exist:
29
      | page       | answer | response | jumpto    | score |
30
      | Question 1 | True   | Right    | Next page | 1     |
31
      | Question 1 | False  | Wrong    | This page | 0     |
32
      | Question 2 | True   | Right    | Next page | 1     |
33
      | Question 2 | False  | Wrong    | This page | 0     |
34
    And I am on the "Test lesson name" "lesson activity" page logged in as student1
35
    # Answer lesson activity question 1 incorrectly.
36
    When I set the following fields to these values:
37
      | False | 1 |
38
    And I press "Submit"
39
    # Confirm you can still re-attempt the question 1.
40
    Then I should see "You have 1 attempt(s) remaining"
41
    And I press "Yes, I'd like to try again"
42
    # Answer question 1 incorrectly again.
43
    And I set the following fields to these values:
44
      | False | 1 |
45
    And I press "Submit"
46
    # Confirm you can't re-attempt the question 1 anymore.
47
    And I should not see "Yes, I'd like to try again"
48
    And I press "Continue"
49
    # Answer question 2 correctly.
50
    And I set the following fields to these values:
51
      | True  | 1 |
52
    And I press "Submit"
53
    And I should not see "Yes, I'd like to try again"
54
    # Complete attempt.
55
    And I press "Continue"
56
    And I am on the "Test lesson name" "lesson activity" page
57
    # Confirm you can't see the question anymore.
58
    And I should see "You are not allowed to retake this lesson."