[ Index ] |
PHP Cross Reference of Unnamed Project |
[Source view] [Print] [Project Stats]
Steps definitions related to mod_quiz.
Copyright: | 2014 Marina Glancy |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 570 lines (28 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 2 files question/tests/behat/behat_question_base.php lib/behat/behat_base.php |
behat_mod_quiz:: (23 methods):
quiz_contains_the_following_questions()
quiz_contains_the_following_sections()
i_add_question_to_the_quiz_with()
i_set_the_max_mark_for_quiz_question()
i_open_the_add_to_quiz_menu_for()
i_follow_in_the_open_menu()
i_should_see_on_quiz_page()
i_should_not_see_on_quiz_page()
i_should_see_before_on_the_edit_quiz_page()
should_have_number_on_the_edit_quiz_page()
get_xpath_page_break_icon_after_question()
i_click_on_the_page_break_icon_after_question()
the_page_break_icon_after_question_should_exist()
the_page_break_icon_after_question_should_not_exist()
the_page_break_link_after_question_should_contain()
i_click_on_shuffle_for_section()
shuffle_for_section_should_be()
get_xpath_for_shuffle_checkbox()
i_move_question_after_item_by_clicking_the_move_icon()
i_move_question_after_item_by_dragging()
i_delete_question_by_clicking_the_delete_icon()
i_set_the_section_heading_for()
i_should_see_question_in_section_in_the_quiz_navigation()
Class: behat_mod_quiz - X-Ref
Steps definitions related to mod_quiz.quiz_contains_the_following_questions($quizname, TableNode $data) X-Ref |
Put the specified questions on the specified pages of a given quiz. The first row should be column names: | question | page | maxmark | requireprevious | The first two of those are required. The others are optional. question needs to uniquely match a question name. page is a page number. Must start at 1, and on each following row should be the same as the previous, or one more. maxmark What the question is marked out of. Defaults to question.defaultmark. requireprevious The question can only be attempted after the previous one was completed. Then there should be a number of rows of data, one for each question you want to add. For backwards-compatibility reasons, specifying the column names is optional (but strongly encouraged). If not specified, the columns are asseumed to be | question | page | maxmark |. param: string $quizname the name of the quiz to add questions to. param: TableNode $data information about the questions to add. |
quiz_contains_the_following_sections($quizname, TableNode $data) X-Ref |
Put the specified section headings to start at specified pages of a given quiz. The first row should be column names: | heading | firstslot | shufflequestions | heading is the section heading text firstslot is the slot number where the section starts shuffle whether this section is shuffled (0 or 1) Then there should be a number of rows of data, one for each section you want to add. param: string $quizname the name of the quiz to add sections to. param: TableNode $data information about the sections to add. |
i_add_question_to_the_quiz_with($questiontype, $quizname, TableNode $questiondata) X-Ref |
Adds a question to the existing quiz with filling the form. The form for creating a question should be on one page. param: string $questiontype param: string $quizname param: TableNode $questiondata with data for filling the add question form |
i_set_the_max_mark_for_quiz_question($questionname, $newmark) X-Ref |
Set the max mark for a question on the Edit quiz page. param: string $questionname the name of the question to set the max mark for. param: string $newmark the mark to set |
i_open_the_add_to_quiz_menu_for($pageorlast) X-Ref |
Open the add menu on a given page, or at the end of the Edit quiz page. param: string $pageorlast either "Page n" or "last". |
i_follow_in_the_open_menu($linkstring) X-Ref |
Click on a given link in the moodle-actionmenu that is currently open. param: string $linkstring the text (or id, etc.) of the link to click. |
i_should_see_on_quiz_page($questionname, $pagenumber) X-Ref |
Check whether a particular question is on a particular page of the quiz on the Edit quiz page. param: string $questionname the name of the question we are looking for. param: number $pagenumber the page it should be found on. |
i_should_not_see_on_quiz_page($questionname, $pagenumber) X-Ref |
Check whether a particular question is not on a particular page of the quiz on the Edit quiz page. param: string $questionname the name of the question we are looking for. param: number $pagenumber the page it should be found on. |
i_should_see_before_on_the_edit_quiz_page($firstquestionname, $secondquestionname) X-Ref |
Check whether one question comes before another on the Edit quiz page. The two questions must be on the same page. param: string $firstquestionname the name of the question that should come first in order. param: string $secondquestionname the name of the question that should come immediately after it in order. |
should_have_number_on_the_edit_quiz_page($questionname, $number) X-Ref |
Check the number displayed alongside a question on the Edit quiz page. param: string $questionname the name of the question we are looking for. param: number $number the number (or 'i') that should be displayed beside that question. |
get_xpath_page_break_icon_after_question($addorremoves, $questionname) X-Ref |
Get the xpath for a partcular add/remove page-break icon. param: string $addorremoves 'Add' or 'Remove'. param: string $questionname the name of the question before the icon. return: string the requried xpath. |
i_click_on_the_page_break_icon_after_question($addorremoves, $questionname) X-Ref |
Click the add or remove page-break icon after a particular question. param: string $addorremoves 'Add' or 'Remove'. param: string $questionname the name of the question before the icon to click. |
the_page_break_icon_after_question_should_exist($addorremoves, $questionname) X-Ref |
Assert the add or remove page-break icon after a particular question exists. param: string $addorremoves 'Add' or 'Remove'. param: string $questionname the name of the question before the icon to click. return: array of steps. |
the_page_break_icon_after_question_should_not_exist($addorremoves, $questionname) X-Ref |
Assert the add or remove page-break icon after a particular question does not exist. param: string $addorremoves 'Add' or 'Remove'. param: string $questionname the name of the question before the icon to click. return: array of steps. |
the_page_break_link_after_question_should_contain($addorremoves, $questionname, $paramdata) X-Ref |
Check the add or remove page-break link after a particular question contains the given parameters in its url. param: string $addorremoves 'Add' or 'Remove'. param: string $questionname the name of the question before the icon to click. param: TableNode $paramdata with data for checking the page break url return: array of steps. |
i_click_on_shuffle_for_section($heading) X-Ref |
Set Shuffle for shuffling questions within sections param: string $heading the heading of the section to change shuffle for. |
shuffle_for_section_should_be($heading, $value) X-Ref |
Check the shuffle checkbox for a particular section. param: string $heading the heading of the section to check shuffle for param: int $value whether the shuffle checkbox should be on or off. |
get_xpath_for_shuffle_checkbox($heading) X-Ref |
Return the xpath for shuffle checkbox in section heading param: string $heading return: string |
i_move_question_after_item_by_clicking_the_move_icon($questionname, $target) X-Ref |
Move a question on the Edit quiz page by first clicking on the Move icon, then clicking one of the "After ..." links. param: string $questionname the name of the question we are looking for. param: string $target the target place to move to. One of the links in the pop-up like |
i_move_question_after_item_by_dragging($questionname, $target) X-Ref |
Move a question on the Edit quiz page by dragging a given question on top of another item. param: string $questionname the name of the question we are looking for. param: string $target the target place to move to. Ether a question name, or "Page N" |
i_delete_question_by_clicking_the_delete_icon($questionname) X-Ref |
Delete a question on the Edit quiz page by first clicking on the Delete icon, then clicking one of the "After ..." links. param: string $questionname the name of the question we are looking for. return: array of steps. |
i_set_the_section_heading_for($sectionname, $sectionheading) X-Ref |
Set the section heading for a given section on the Edit quiz page param: string $sectionname the heading to change. param: string $sectionheading the new heading to set. |
i_should_see_question_in_section_in_the_quiz_navigation($questionnumber, $sectionheading) X-Ref |
Check that a given question comes after a given section heading in the quiz navigation block. param: int $questionnumber the number of the question to check. param: string $sectionheading which section heading it should appear after. |
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |