[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/choice/tests/behat/ -> publish_results.feature (source)

   1  @mod @mod_choice
   2  Feature: A teacher can choose one of 4 options for publishing choice results
   3    In order to display choice activities outcomes
   4    As a teacher
   5    I need to publish the choice activity results in different ways
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | teacher1 | Teacher | 1 | [email protected] |
  11        | student1 | Student | 1 | [email protected] |
  12      And the following "courses" exist:
  13        | fullname | shortname | category |
  14        | Course 1 | C1 | 0 |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19      And I log in as "teacher1"
  20      And I follow "Course 1"
  21      And I turn editing mode on
  22  
  23    @javascript
  24    Scenario: Do not publish results to students
  25      Given I add a "Choice" to section "1" and I fill the form with:
  26        | Choice name | Choice 1 |
  27        | Description | Choice Description |
  28        | Publish results | Do not publish results to students |
  29        | option[0] | Option 1 |
  30        | option[1] | Option 2 |
  31      And I log out
  32      And I log in as "student1"
  33      And I follow "Course 1"
  34      When I choose "Option 1" from "Choice 1" choice activity
  35      Then I should see "Your selection: Option 1"
  36      And I should not see "Responses"
  37      And I should not see "Graph display"
  38  
  39    @javascript
  40    Scenario: Show results to students after they answer
  41      Given I add a "Choice" to section "1" and I fill the form with:
  42        | Choice name | Choice 1 |
  43        | Description | Choice Description |
  44        | option[0] | Option 1 |
  45        | option[1] | Option 2 |
  46        | Publish results | Show results to students after they answer |
  47      And I log out
  48      And I log in as "student1"
  49      And I follow "Course 1"
  50      When I follow "Choice 1"
  51      Then I should not see "Responses"
  52      And I should not see "Graph display"
  53      And I follow "Course 1"
  54      And I choose "Option 1" from "Choice 1" choice activity
  55      And I should see "Your selection: Option 1"
  56      And I should see "Responses"
  57      And I should see "Graph display"
  58  
  59    @javascript
  60    Scenario: Show results to students only after the choice is closed
  61      Given I add a "Choice" to section "1" and I fill the form with:
  62        | Choice name | Choice 1 |
  63        | Description | Choice Description |
  64        | Publish results | Show results to students only after the choice is closed |
  65        | option[0] | Option 1 |
  66        | option[1] | Option 2 |
  67      And I log out
  68      And I log in as "student1"
  69      And I follow "Course 1"
  70      When I follow "Choice 1"
  71      Then I should not see "Responses"
  72      And I should not see "Graph display"
  73      And I choose "Option 1" from "Choice 1" choice activity
  74      And I log out
  75      And I log in as "teacher1"
  76      And I follow "Course 1"
  77      And I follow "Choice 1"
  78      And I follow "Edit settings"
  79      And I expand all fieldsets
  80      And I set the following fields to these values:
  81        | Restrict answering to this time period | 1 |
  82        | timeclose[year] | 2010 |
  83      And I press "Save and return to course"
  84      And I log out
  85      And I log in as "student1"
  86      And I follow "Course 1"
  87      And I follow "Choice 1"
  88      And I should see "Responses"
  89      And I should see "Graph display"
  90  
  91    @javascript
  92    Scenario: Always show results to students
  93      Given I add a "Choice" to section "1" and I fill the form with:
  94        | Choice name | Choice 1 |
  95        | Description | Choice Description |
  96        | option[0] | Option 1 |
  97        | option[1] | Option 2 |
  98        | Publish results | Always show results to students |
  99      And I log out
 100      And I log in as "student1"
 101      And I follow "Course 1"
 102      When I follow "Choice 1"
 103      And I should see "Responses"
 104      And I should see "Graph display"


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