[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/quiz/tests/behat/ -> editing_click_move_icon.feature (source)

   1  @mod @mod_quiz
   2  Feature: Edit quiz page - drag-and-drop
   3    In order to change the layout of a quiz I built
   4    As a teacher
   5    I need to be able to drag and drop questions to reorder them.
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email               |
  10        | teacher1 | T1        | Teacher1 | [email protected] |
  11      And the following "courses" exist:
  12        | fullname | shortname | category |
  13        | Course 1 | C1        | 0        |
  14      And the following "course enrolments" exist:
  15        | user     | course | role           |
  16        | teacher1 | C1     | editingteacher |
  17      And the following "activities" exist:
  18        | activity   | name   | course | idnumber |
  19        | quiz       | Quiz 1 | C1     | quiz1    |
  20      And I log in as "teacher1"
  21      And I follow "Course 1"
  22      And I add a "True/False" question to the "Quiz 1" quiz with:
  23        | Question name | Question A |
  24        | Question text | Answer me  |
  25      And I add a "True/False" question to the "Quiz 1" quiz with:
  26        | Question name | Question B   |
  27        | Question text | Answer again |
  28      And I add a "True/False" question to the "Quiz 1" quiz with:
  29        | Question name | Question C |
  30        | Question text | And again  |
  31      And I click on the "Add" page break icon after question "Question B"
  32  
  33    @javascript
  34    Scenario: Re-order questions by clicking on the move icon.
  35      Then I should see "Question A" on quiz page "1"
  36      And I should see "Question B" on quiz page "1"
  37      And I should see "Question C" on quiz page "2"
  38  
  39      When I move "Question A" to "After Question 2" in the quiz by clicking the move icon
  40      Then I should see "Question B" on quiz page "1"
  41      And I should see "Question A" on quiz page "1"
  42      And I should see "Question B" before "Question A" on the edit quiz page
  43      And I should see "Question C" on quiz page "2"
  44  
  45      When I move "Question A" to "After Page 2" in the quiz by clicking the move icon
  46      Then I should see "Question B" on quiz page "1"
  47      And I should see "Question A" on quiz page "2"
  48      And I should see "Question C" on quiz page "2"
  49      And I should see "Question A" before "Question C" on the edit quiz page
  50  
  51      When I move "Question B" to "After Question 2" in the quiz by clicking the move icon
  52      Then I should see "Question A" on quiz page "1"
  53      And I should see "Question B" on quiz page "1"
  54      And I should see "Question C" on quiz page "1"
  55      And I should see "Question A" before "Question B" on the edit quiz page
  56      And I should see "Question B" before "Question C" on the edit quiz page
  57  
  58      When I move "Question B" to "After Page 1" in the quiz by clicking the move icon
  59      Then I should see "Question B" on quiz page "1"
  60      And I should see "Question A" on quiz page "1"
  61      And I should see "Question C" on quiz page "1"
  62      And I should see "Question B" before "Question A" on the edit quiz page
  63      And I should see "Question A" before "Question C" on the edit quiz page
  64  
  65      When I click on the "Add" page break icon after question "Question A"
  66      When I open the "Page 2" add to quiz menu
  67      And I follow "a new question" in the open menu
  68      And I set the field "qtype_qtype_description" to "1"
  69      And I press "submitbutton"
  70      Then I should see "Adding a description"
  71      And I set the following fields to these values:
  72        | Question name | Question D  |
  73        | Question text | Useful info |
  74      And I press "id_submitbutton"
  75      Then I should see "Question B" on quiz page "1"
  76      And I should see "Question A" on quiz page "1"
  77      And I should see "Question C" on quiz page "2"
  78      And I should see "Question D" on quiz page "2"
  79      And I should see "Question B" before "Question A" on the edit quiz page
  80      And I should see "Question C" before "Question D" on the edit quiz page
  81  
  82      And "Question B" should have number "1" on the edit quiz page
  83      And "Question A" should have number "2" on the edit quiz page
  84      And "Question C" should have number "3" on the edit quiz page
  85      And "Question D" should have number "i" on the edit quiz page
  86  
  87      When I move "Question D" to "After Question 2" in the quiz by clicking the move icon
  88      Then I should see "Question B" on quiz page "1"
  89      And I should see "Question D" on quiz page "1"
  90      And I should see "Question A" on quiz page "1"
  91      And I should see "Question C" on quiz page "2"
  92      And I should see "Question B" before "Question A" on the edit quiz page
  93      And I should see "Question A" before "Question D" on the edit quiz page
  94  
  95      And "Question B" should have number "1" on the edit quiz page
  96      And "Question D" should have number "i" on the edit quiz page
  97      And "Question A" should have number "2" on the edit quiz page
  98      And "Question C" should have number "3" on the edit quiz page


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1