[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/lesson/tests/behat/ -> lesson_complete_report.feature (source)

   1  @mod @mod_lesson
   2  Feature: Teachers can review student progress on all lessons in a course by viewing the complete report
   3    As a Teacher
   4    I need to view the complete report for one of my students.
   5  
   6    Background:
   7      Given the following "users" exist:
   8        | username | firstname | lastname | email |
   9        | teacher1 | Teacher | 1 | teacher1@example.com |
  10        | student1 | Student | 1 | student1@example.com |
  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        | student1 | C1 | student |
  18      And I log in as "teacher1"
  19      And I follow "Course 1"
  20      And I turn editing mode on
  21      And I add a "Lesson" to section "1"
  22      And I set the following fields to these values:
  23        | Name | Test lesson name |
  24        | Description | Test lesson description |
  25        | Re-takes allowed | Yes |
  26      And I press "Save and return to course"
  27      And I follow "Test lesson name"
  28  
  29    Scenario: View student progress for lesson that was never attempted
  30      Given I follow "Add a content page"
  31      And I set the following fields to these values:
  32        | Page title | First page name |
  33        | Page contents | First page contents |
  34        | id_answer_editor_0 | Next page |
  35        | id_jumpto_0 | Next page |
  36      And I press "Save page"
  37      And I select "Question" from the "qtype" singleselect
  38      And I set the field "Select a question type" to "True/false"
  39      And I press "Add a question page"
  40      And I set the following fields to these values:
  41        | Page title | True/false question 1 |
  42        | Page contents | Paper is made from trees. |
  43        | id_answer_editor_0 | True |
  44        | id_response_editor_0 | Correct |
  45        | id_jumpto_0 | Next page |
  46        | id_answer_editor_1 | False |
  47        | id_response_editor_1 | Wrong |
  48        | id_jumpto_1 | This page |
  49      And I press "Save page"
  50      When I follow "Course 1"
  51      And I follow "Participants"
  52      And I follow "Student 1"
  53      And I follow "Complete report"
  54      Then I should see "No attempts have been made on this lesson"
  55  
  56    Scenario: View student progress for an incomplete lesson containing both content and question pages
  57      Given I follow "Add a content page"
  58      And I set the following fields to these values:
  59        | Page title | First page name |
  60        | Page contents | First page contents |
  61        | id_answer_editor_0 | Next page |
  62        | id_jumpto_0 | Next page |
  63      And I press "Save page"
  64      And I select "Question" from the "qtype" singleselect
  65      And I set the field "Select a question type" to "True/false"
  66      And I press "Add a question page"
  67      And I set the following fields to these values:
  68        | Page title | True/false question 1 |
  69        | Page contents | Paper is made from trees. |
  70        | id_answer_editor_0 | True |
  71        | id_response_editor_0 | Correct |
  72        | id_jumpto_0 | Next page |
  73        | id_answer_editor_1 | False |
  74        | id_response_editor_1 | Wrong |
  75        | id_jumpto_1 | This page |
  76      And I press "Save page"
  77      And I select "Add a content page" from the "qtype" singleselect
  78      And I set the following fields to these values:
  79        | Page title | Second page name |
  80        | Page contents | Second page contents |
  81        | id_answer_editor_0 | Previous page |
  82        | id_jumpto_0 | Previous page |
  83        | id_answer_editor_1 | Next page |
  84        | id_jumpto_1 | Next page |
  85      And I press "Save page"
  86      And I log out
  87      When I log in as "student1"
  88      And I follow "Course 1"
  89      And I follow "Test lesson name"
  90      And I should see "First page contents"
  91      And I press "Next page"
  92      And I log out
  93      Then I log in as "teacher1"
  94      And I follow "Course 1"
  95      And I follow "Participants"
  96      And I follow "Student 1"
  97      And I follow "Complete report"
  98      And I should see "Lesson has been started, but not yet completed"
  99      And I should see "1" in the ".cell.c1" "css_element"
 100      And I should see "0" in the ".cell.c2" "css_element"
 101  
 102    Scenario: View student progress for a lesson containing both content and question pages
 103      Given I follow "Add a content page"
 104      And I set the following fields to these values:
 105        | Page title | First page name |
 106        | Page contents | First page contents |
 107        | id_answer_editor_0 | Next page |
 108        | id_jumpto_0 | Next page |
 109      And I press "Save page"
 110      And I select "Question" from the "qtype" singleselect
 111      And I set the field "Select a question type" to "True/false"
 112      And I press "Add a question page"
 113      And I set the following fields to these values:
 114        | Page title | True/false question 1 |
 115        | Page contents | The sky is Pink. |
 116        | id_answer_editor_0 | False |
 117        | id_response_editor_0 | Correct |
 118        | id_jumpto_0 | Next page |
 119        | id_answer_editor_1 | True |
 120        | id_response_editor_1 | Wrong |
 121        | id_jumpto_1 | This page |
 122      And I press "Save page"
 123      And I select "Question" from the "qtype" singleselect
 124      And I set the field "Select a question type" to "True/false"
 125      And I press "Add a question page"
 126      And I set the following fields to these values:
 127        | Page title | True/false question 1 |
 128        | Page contents | Paper is made from trees. |
 129        | id_answer_editor_0 | True |
 130        | id_response_editor_0 | Correct |
 131        | id_jumpto_0 | Next page |
 132        | id_answer_editor_1 | False |
 133        | id_response_editor_1 | Wrong |
 134        | id_jumpto_1 | This page |
 135      And I press "Save page"
 136      And I select "Add a content page" from the "qtype" singleselect
 137      And I set the following fields to these values:
 138        | Page title | Second page name |
 139        | Page contents | Second page contents |
 140        | id_answer_editor_0 | Previous page |
 141        | id_jumpto_0 | Previous page |
 142        | id_answer_editor_1 | Next page |
 143        | id_jumpto_1 | Next page |
 144      And I press "Save page"
 145      And I log out
 146      When I log in as "student1"
 147      And I follow "Course 1"
 148      And I follow "Test lesson name"
 149      And I should see "First page contents"
 150      And I press "Next page"
 151      And I should see "Second page contents"
 152      And I press "Next page"
 153      And I should see "Paper is made from trees."
 154      And I set the following fields to these values:
 155        | True | 1 |
 156      And I press "Submit"
 157      And I press "Continue"
 158      And I should see "The sky is Pink."
 159      And I set the following fields to these values:
 160        | True | 1 |
 161      And I press "Submit"
 162      And I press "Continue"
 163      And I should see "Congratulations - end of lesson reached"
 164      And I log out
 165      Then I log in as "teacher1"
 166      And I follow "Course 1"
 167      And I follow "Participants"
 168      And I follow "Student 1"
 169      And I follow "Complete report"
 170      And I should see "Grade: 50.00 / 100.00"
 171      And I should see "4" in the ".cell.c1" "css_element"
 172      And I should see "2" in the ".cell.c2" "css_element"
 173      And I should see "1" in the ".cell.c3" "css_element"
 174  
 175    Scenario: View student attempts in a lesson containing only content pages
 176      Given I follow "Add a content page"
 177      And I set the following fields to these values:
 178        | Page title | First page name |
 179        | Page contents | First page contents |
 180        | id_answer_editor_0 | Next page |
 181        | id_jumpto_0 | Next page |
 182      And I press "Save page"
 183      And I select "Add a content page" from the "qtype" singleselect
 184      And I set the following fields to these values:
 185        | Page title | Second page name |
 186        | Page contents | Second page contents |
 187        | id_answer_editor_0 | Previous page |
 188        | id_jumpto_0 | Previous page |
 189        | id_answer_editor_1 | End of lesson |
 190        | id_jumpto_1 | End of lesson |
 191      And I press "Save page"
 192      And I log out
 193      When I log in as "student1"
 194      And I follow "Course 1"
 195      And I follow "Test lesson name"
 196      And I should see "First page contents"
 197      And I press "Next page"
 198      And I should see "Second page contents"
 199      And I press "End of lesson"
 200      And I log out
 201      Then I log in as "teacher1"
 202      And I follow "Course 1"
 203      And I follow "Participants"
 204      And I follow "Student 1"
 205      And I follow "Complete report"
 206      And I should see "Completed"
 207      And I should see "2" in the ".cell.c1" "css_element"
 208      And I should see "0" in the ".cell.c2" "css_element"
 209      And I should see "0" in the ".cell.c3" "css_element"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1