[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/question/tests/behat/ -> sort_questions.feature (source)

   1  @core @core_question
   2  Feature: A teacher can sort questions in the question bank
   3    In order to order the question bank's questions
   4    As a teacher
   5    I need to sort the questions list using different sort orders
   6  
   7    @javascript
   8    Scenario: Sort using question name, question type and created by sort order links
   9      Given the following "users" exist:
  10        | username | firstname | lastname | email |
  11        | teacher1 | Teacher | 1 | [email protected] |
  12      And the following "courses" exist:
  13        | fullname | shortname | format |
  14        | Course 1 | C1 | weeks |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18      And I log in as "admin"
  19      And I follow "Course 1"
  20      And I add a "Essay" question filling the form with:
  21        | Question name | A question 1 name |
  22        | Question text | A question 1 text |
  23      And I log out
  24      And I log in as "teacher1"
  25      And I follow "Course 1"
  26      And I add a "Essay" question filling the form with:
  27        | Question name | B question 2 name |
  28        | Question text | B question 2 text |
  29      And I add a "Numerical" question filling the form with:
  30        | Question name | C question 3 name |
  31        | Question text | C question 3 text |
  32        | answer[0] | 2 |
  33        | fraction[0] | 100% |
  34        | answer[1] | 1 |
  35        | fraction[1] | None |
  36      When I follow "Sort by Question ascending"
  37      Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
  38      And "B question 2 name" "checkbox" should appear before "C question 3 name" "checkbox"
  39      And I follow "Sort by Question descending"
  40      And "C question 3 name" "checkbox" should appear before "B question 2 name" "checkbox"
  41      And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
  42      And I follow "Sort by Question type ascending"
  43      And "A question 1 name" "checkbox" should appear before "C question 3 name" "checkbox"
  44      And I follow "Sort by Question type descending"
  45      And "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
  46      And I follow "Sort by First name ascending"
  47      And "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
  48      And I follow "Sort by First name descending"
  49      And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
  50      And I click on "Show question text in the question list" "checkbox"
  51      And I should see "A question 1 text"
  52      And I should see "B question 2 text"
  53      And I should see "C question 3 text"


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