Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_quiz
2
Feature: Backup and restore of quizzes
3
  In order to reuse my quizzes
4
  As a teacher
5
  I need to be able to back them up and restore them.
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category |
10
      | Course 1 | C1        | 0        |
1441 ariadna 11
    And the following "activities" exist:
12
      | activity   | name   | intro              | course | idnumber |
13
      | quiz       | Quiz 1 | For testing backup | C1     | quiz1    |
1 efrain 14
    And the following "question categories" exist:
1441 ariadna 15
      | contextlevel    | reference | name           |
16
      | Activity module | quiz1     | Test questions |
1 efrain 17
    And the following config values are set as admin:
18
      | enableasyncbackup | 0 |
19
    And I log in as "admin"
20
 
21
  @javascript
22
  Scenario: Duplicate a quiz with two questions
23
    And the following "questions" exist:
24
      | questioncategory | qtype       | name | questiontext    |
25
      | Test questions   | truefalse   | TF1  | First question  |
26
      | Test questions   | truefalse   | TF2  | Second question |
27
    And quiz "Quiz 1" contains the following questions:
28
      | question | page |
29
      | TF1      | 1    |
30
      | TF2      | 2    |
31
    When I am on "Course 1" course homepage with editing mode on
32
    And I duplicate "Quiz 1" activity editing the new copy with:
33
      | Name | Quiz 2 |
34
    And I am on the "Quiz 1" "mod_quiz > Edit" page
35
    Then I should see "TF1"
36
    And I should see "TF2"
37
 
38
  @javascript
39
  Scenario: Backup and restore a course containing a quiz with user data.
40
    And the following "questions" exist:
41
      | questioncategory | qtype       | name | questiontext    |
42
      | Test questions   | truefalse   | TF1  | First question  |
43
      | Test questions   | truefalse   | TF2  | Second question |
44
    And quiz "Quiz 1" contains the following questions:
45
      | question | page |
46
      | TF1      | 1    |
47
      | TF2      | 2    |
48
    And the following "users" exist:
49
      | username |
50
      | student  |
51
    And the following "course enrolments" exist:
52
      | user    | course | role    |
53
      | student | C1     | student |
54
    And user "student" has attempted "Quiz 1" with responses:
55
      | slot | response |
56
      | 1    | True     |
57
      | 2    | False    |
58
    When I backup "Course 1" course using this options:
59
      | Confirmation | Filename | test_backup.mbz |
60
    And I restore "test_backup.mbz" backup into a new course using this options:
61
      | Schema | Course name | Restored course |
62
    Then I should see "Restored course"
63
    And I click on "Quiz 1" "link" in the "region-main" "region"
64
    And I should see "Attempts: 1"
65
 
66
  @javascript @_file_upload
67
  Scenario: Restore a Moodle 2.8 quiz backup
68
    When I am on the "Course 1" "restore" page
69
    And I press "Manage course backups"
70
    And I upload "mod/quiz/tests/fixtures/moodle_28_quiz.mbz" file to "Files" filemanager
71
    And I press "Save changes"
72
    And I restore "moodle_28_quiz.mbz" backup into "Course 1" course using this options:
73
    And I am on the "Restored Moodle 2.8 quiz" "mod_quiz > Edit" page
74
    Then I should see "TF1"
75
    And I should see "TF2"