diff --git a/.github/workflows/moodle-plugin-ci.yml b/.github/workflows/moodle-plugin-ci.yml new file mode 100644 index 0000000..d4f2d6e --- /dev/null +++ b/.github/workflows/moodle-plugin-ci.yml @@ -0,0 +1,169 @@ +name: Moodle Plugin CI + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-22.04 + + services: + postgres: + image: postgres:13 + env: + POSTGRES_USER: 'postgres' + POSTGRES_HOST_AUTH_METHOD: 'trust' + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3 + + mariadb: + image: mariadb:10.6 + env: + MYSQL_USER: 'root' + MYSQL_ALLOW_EMPTY_PASSWORD: "true" + MYSQL_CHARACTER_SET_SERVER: "utf8mb4" + MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci" + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3 + + strategy: + fail-fast: false + matrix: + include: + - php: 7.4 + moodle-branch: MOODLE_401_STABLE + database: mariadb + - php: 7.4 + moodle-branch: MOODLE_401_STABLE + database: pgsql + - php: 8.0 + moodle-branch: MOODLE_401_STABLE + database: mariadb + - php: 8.0 + moodle-branch: MOODLE_401_STABLE + database: pgsql + - php: 8.1 + moodle-branch: MOODLE_401_STABLE + database: mariadb + - php: 8.1 + moodle-branch: MOODLE_401_STABLE + database: pgsql + - php: 8.1 + moodle-branch: MOODLE_402_STABLE + database: mariadb + - php: 8.1 + moodle-branch: MOODLE_402_STABLE + database: pgsql + - php: 8.1 + moodle-branch: MOODLE_403_STABLE + database: mariadb + - php: 8.1 + moodle-branch: MOODLE_403_STABLE + database: pgsql + - php: 8.1 + moodle-branch: MOODLE_404_STABLE + database: mariadb + - php: 8.1 + moodle-branch: MOODLE_404_STABLE + database: pgsql + - php: 8.2 + moodle-branch: MOODLE_402_STABLE + database: mariadb + - php: 8.2 + moodle-branch: MOODLE_402_STABLE + database: pgsql + - php: 8.2 + moodle-branch: MOODLE_403_STABLE + database: mariadb + - php: 8.2 + moodle-branch: MOODLE_403_STABLE + database: pgsql + - php: 8.2 + moodle-branch: MOODLE_404_STABLE + database: mariadb + - php: 8.2 + moodle-branch: MOODLE_404_STABLE + database: pgsql + - php: 8.3 + moodle-branch: MOODLE_404_STABLE + database: mariadb + - php: 8.3 + moodle-branch: MOODLE_404_STABLE + database: pgsql + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + path: plugin + + - name: Setup PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: ${{ matrix.extensions }} + ini-values: max_input_vars=5000 + coverage: none + + - name: Initialise moodle-plugin-ci + run: | + composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4 + echo $(cd ci/bin; pwd) >> $GITHUB_PATH + echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH + sudo locale-gen en_AU.UTF-8 + echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV + + - name: Install moodle-plugin-ci + run: | + moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 + moodle-plugin-ci add-config '$CFG->behat_increasetimeout = 10;' + env: + DB: ${{ matrix.database }} + MOODLE_BRANCH: ${{ matrix.moodle-branch }} + IGNORE_PATHS: 'moodle/tests/fixtures,moodle/Sniffs,classes/vendor' + PHPCS_IGNORE_PATHS: /^classes\/vendor/ + PHPDOCCHECKER_IGNORE_PATHS: /^classes\/vendor/ + MUSTACHE_IGNORE_NAMES: 'report.mustache,questionnaire.mustache' + + - name: PHP Lint + if: ${{ always() }} + run: moodle-plugin-ci phplint + + - name: PHP Mess Detector + continue-on-error: true # This step will show errors but will not fail + if: ${{ always() }} + run: moodle-plugin-ci phpmd + + - name: Moodle Code Checker + if: ${{ always() }} + run: moodle-plugin-ci phpcs --max-warnings 0 + + - name: Moodle PHPDoc Checker + if: ${{ always() }} + run: moodle-plugin-ci phpdoc + + - name: Validating + if: ${{ always() }} + run: moodle-plugin-ci validate + + - name: Check upgrade savepoints + if: ${{ always() }} + run: moodle-plugin-ci savepoints + + - name: Mustache Lint + continue-on-error: true # This step will show errors but will not fail + if: ${{ always() }} + run: moodle-plugin-ci mustache + + - name: Grunt + if: ${{ always() }} + run: moodle-plugin-ci grunt || true + + - name: PHPUnit tests + if: ${{ always() }} + run: moodle-plugin-ci phpunit --coverage-text || true + + - name: Behat features + if: ${{ always() }} + run: moodle-plugin-ci behat --profile chrome diff --git a/classes/event/update_vote.php b/classes/event/update_vote.php index bd6fb64..d41e433 100644 --- a/classes/event/update_vote.php +++ b/classes/event/update_vote.php @@ -59,8 +59,8 @@ public static function get_name() { * @return string */ public function get_description() { - return "The user with id '$this->userid' has just voted for a question in the hotquestion activity with the course module id - '$this->contextinstanceid'."; + return "The user with id '$this->userid' has just voted for a question in the hotquestion activity with the course module ". + " id '$this->contextinstanceid'."; } /** diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index f662a84..c8d31aa 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -58,7 +58,7 @@ class provider implements \core_privacy\local\metadata\provider, * @param collection $collection The initialised collection to add items to. * @return collection The updated collection of metadata items. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->add_database_table( 'hotquestion_questions', [ @@ -107,7 +107,7 @@ private static function get_modid() { * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); $modid = self::get_modid(); if (!$modid) { diff --git a/lang/en/hotquestion.php b/lang/en/hotquestion.php index 67cf32d..dbf550f 100644 --- a/lang/en/hotquestion.php +++ b/lang/en/hotquestion.php @@ -28,11 +28,11 @@ $string['ago'] = '{$a} ago'; $string['allowanonymouspost'] = 'Allow post question as anonymous'; -$string['allowanonymouspost_help'] = 'If enabled, questions can be posted anonomously, and if approved for viewing heat votes can be made by everyone.'; $string['allowanonymouspost_descr'] = 'If enabled, questions can be posted anonomously, and if approved for viewing heat votes can be made by everyone.'; +$string['allowanonymouspost_help'] = 'If enabled, questions can be posted anonomously, and if approved for viewing heat votes can be made by everyone.'; $string['allowauthorinfohide'] = 'Allow authors name to be hidden'; -$string['allowauthorinfohide_help'] = 'If enabled, the name of the questions author can be visible to teachers but hidden from students.'; $string['allowauthorinfohide_descr'] = 'If enabled, the name of the questions author can be visible to teachers but hidden from students.'; +$string['allowauthorinfohide_help'] = 'If enabled, the name of the questions author can be visible to teachers but hidden from students.'; $string['allowcomments'] = 'Allow comments on entries'; $string['allowcomments_help'] = 'If enabled, all participants with permission to create comments will be able to add comments to hot question entries.'; $string['alwaysshowdescription'] = 'Always show description'; @@ -40,25 +40,25 @@ $string['anonymous'] = 'Anonymous'; $string['approvallabel'] = 'Approval required column label'; $string['approvallabel_descr'] = 'Enter a default label for the Approved column.'; -$string['approvedyes'] = 'Approved'; $string['approvedno'] = 'Not approved'; +$string['approvedyes'] = 'Approved'; $string['authorinfo'] = 'Posted by {$a->user} at {$a->time}'; $string['authorinfohide'] = 'Posted {$a->time}'; $string['calendarend'] = '{$a} closes'; $string['calendarstart'] = '{$a} opens'; $string['cnfallowcomments'] = 'Define if a hot question will accept comments on entries by default'; +$string['completiondetail:pass'] = 'Passing grade: {$a}'; $string['completiondetail:post'] = 'Post questions: {$a}'; $string['completiondetail:vote'] = 'Give heat: {$a}'; -$string['completiondetail:pass'] = 'Passing grade: {$a}'; -$string['completionpostdesc'] = 'Student must create at least {$a} questions(s)'; -$string['completionvotedesc'] = 'Student must vote/give heat to {$a} question(s) or post(s)'; +$string['completionpass'] = 'Student must pass:'; $string['completionpassdesc'] = 'Student must receive passing grade of {$a}'; -$string['completionpostgroup'] = 'Require questions'; -$string['completionvotegroup'] = 'Require heat:'; $string['completionpassgroup'] = 'Require pass:'; $string['completionpost'] = 'Student must add questions:'; +$string['completionpostdesc'] = 'Student must create at least {$a} questions(s)'; +$string['completionpostgroup'] = 'Require questions'; $string['completionvote'] = 'Student must add heat:'; -$string['completionpass'] = 'Student must pass:'; +$string['completionvotedesc'] = 'Student must vote/give heat to {$a} question(s) or post(s)'; +$string['completionvotegroup'] = 'Require heat:'; $string['connectionerror'] = 'Connection error'; $string['content'] = 'Content'; $string['csvexport'] = 'Export to .csv'; @@ -115,15 +115,9 @@ $string['heatlimit_help'] = 'Enter a default for the number of times you can apply heat/vote, per round. Zero hides the heat column.'; $string['heatreceived'] = 'Heat received'; $string['heatvisibility'] = 'Heat column visibility'; -$string['heatvisibility_help'] = 'If enabled, the Heat column is visible.'; $string['heatvisibility_descr'] = 'If enabled, the Heat column is visible, otherwise it is hidden.'; +$string['heatvisibility_help'] = 'If enabled, the Heat column is visible.'; $string['hotquestion'] = 'Hotquestion'; -$string['hotquestionclosed'] = 'This activity closed on {$a}.'; -$string['hotquestionclosetime'] = 'Close time'; -$string['hotquestionintro'] = 'Topic'; -$string['hotquestionname'] = 'Activity Name'; -$string['hotquestionopentime'] = 'Open time'; -$string['hotquestionopen'] = 'This activity will be open on {$a}.'; $string['hotquestion:addinstance'] = 'Can add new Hot Question'; $string['hotquestion:ask'] = 'Ask questions'; $string['hotquestion:comment'] = 'Write comments'; @@ -132,88 +126,96 @@ $string['hotquestion:rate'] = 'Rate questions'; $string['hotquestion:view'] = 'View questions'; $string['hotquestion:vote'] = 'Vote on questions'; +$string['hotquestionclosed'] = 'This activity closed on {$a}.'; +$string['hotquestionclosetime'] = 'Close time'; +$string['hotquestionintro'] = 'Topic'; +$string['hotquestionname'] = 'Activity Name'; +$string['hotquestionopen'] = 'This activity will be open on {$a}.'; +$string['hotquestionopentime'] = 'Open time'; +$string['id'] = 'ID'; $string['improperuseviewgradesclass'] = 'Improper use of the viewgrades class. Cannot load the grade item.'; $string['incorrectmodule'] = 'Course Module ID was incorrect'; -$string['id'] = 'ID'; +$string['inputapprovallabel'] = 'Approved'; +$string['inputapprovallabel_descr'] = 'Change the Approved column name to what you want it to be.'; +$string['inputapprovallabel_help'] = 'Change the Approved column name to better fit the use of this activity.'; +$string['inputheatlabel'] = 'Heat'; +$string['inputheatlabel_descr'] = 'Change the Heat column name to what you want it to be.'; +$string['inputheatlabel_help'] = 'Change the Heat column name to better fit the use of this activity.'; $string['inputquestion'] = 'Submit your question here:'; $string['inputquestion_descr'] = 'Change submit directions to what you want them to be.'; $string['inputquestion_help'] = 'Change the submit directions to what you want them to be.'; $string['inputquestionlabel'] = 'Questions'; $string['inputquestionlabel_descr'] = 'Change the Questions column name to what you want it to be.'; $string['inputquestionlabel_help'] = 'Change the Questions column name to better fit the use of this activity.'; -$string['inputteacherprioritylabel'] = 'Priority'; -$string['inputteacherprioritylabel_descr'] = 'Change the Priority column name to what you want it to be.'; -$string['inputteacherprioritylabel_help'] = 'Change the Priority column name to better fit the use of this activity.'; -$string['inputheatlabel'] = 'Heat'; -$string['inputheatlabel_descr'] = 'Change the Heat column name to what you want it to be.'; -$string['inputheatlabel_help'] = 'Change the Heat column name to better fit the use of this activity.'; $string['inputremovelabel'] = 'Remove'; $string['inputremovelabel_descr'] = 'Change the Remove column name to what you want it to be.'; $string['inputremovelabel_help'] = 'Change the remove column name to better fit the use of this activity.'; -$string['inputapprovallabel'] = 'Approved'; -$string['inputapprovallabel_descr'] = 'Change the Approved column name to what you want it to be.'; -$string['inputapprovallabel_help'] = 'Change the Approved column name to better fit the use of this activity.'; +$string['inputteacherprioritylabel'] = 'Priority'; +$string['inputteacherprioritylabel_descr'] = 'Change the Priority column name to what you want it to be.'; +$string['inputteacherprioritylabel_help'] = 'Change the Priority column name to better fit the use of this activity.'; $string['invalidquestion'] = 'Empty questions are ignored.'; $string['modulename'] = 'Hot Question'; $string['modulename_help'] = 'A Hot Question activity enables students to post and vote on posts, in response to questions asked by course teachers.'; $string['modulename_link'] = 'mod/hotquestion/view'; $string['modulenameplural'] = 'Hot Questions'; $string['newround'] = 'Open a new round'; -$string['newroundsuccess'] = 'You have successfully opened a new round.'; $string['newroundconfirm'] = 'Confirm you want to start a new round? (Existing questions and votes will be archived and can not be added to!)'; +$string['newroundsuccess'] = 'You have successfully opened a new round.'; $string['nextround'] = 'Next round'; $string['noquestions'] = 'No entries yet.'; -$string['notavailable'] = 'Not currently available!
'; $string['notapproved'] = 'This entry is not currently approved for viewing.
'; +$string['notavailable'] = 'Not currently available!
'; $string['pluginadministration'] = 'Hot question administration'; $string['pluginname'] = 'Hot Question'; -$string['previousround'] = 'Previous round'; $string['postbutton'] = 'Click to post'; $string['postmaxgrade'] = 'Questions for max grading'; $string['postmaxgrade_help'] = 'The number of questions required to obtain the maximum score. This is nominally a count of questions, but the value attained by a user may be improved by heat factor (questions with greater heat count more) and by voting on other questions (a user may improve the grade by participating in voting for questions by other students).'; +$string['previousround'] = 'Previous round'; +$string['prioritydown'] = 'Priority down'; +$string['priorityup'] = 'Priority up'; $string['privacy:metadata:hotquestion_questions'] = "Information about the user's entries for a given Hot Question activity. "; -$string['privacy:metadata:hotquestion_questions:userid'] = 'The ID of the user that posted this entry.'; -$string['privacy:metadata:hotquestion_questions:hotquestion'] = 'The ID of the Hot Question activity in which the content was posted.'; -$string['privacy:metadata:hotquestion_questions:content'] = 'The content of the question.'; -$string['privacy:metadata:hotquestion_questions:time'] = 'Time the question was posted.'; -$string['privacy:metadata:hotquestion_questions:id'] = 'ID of the entry.'; $string['privacy:metadata:hotquestion_questions:anonymous'] = 'Is the entry posted as anonymous?'; $string['privacy:metadata:hotquestion_questions:approved'] = 'Is the question approved for general viewing?'; +$string['privacy:metadata:hotquestion_questions:content'] = 'The content of the question.'; +$string['privacy:metadata:hotquestion_questions:hotquestion'] = 'The ID of the Hot Question activity in which the content was posted.'; +$string['privacy:metadata:hotquestion_questions:id'] = 'ID of the entry.'; +$string['privacy:metadata:hotquestion_questions:time'] = 'Time the question was posted.'; $string['privacy:metadata:hotquestion_questions:tpriority'] = 'Has the teacher given a priority for this entry?'; +$string['privacy:metadata:hotquestion_questions:userid'] = 'The ID of the user that posted this entry.'; $string['privacy:metadata:hotquestion_votes'] = 'Information about votes on questions.'; $string['privacy:metadata:hotquestion_votes:id'] = 'ID of the entry.'; $string['privacy:metadata:hotquestion_votes:question'] = 'The ID of the entry for this vote'; $string['privacy:metadata:hotquestion_votes:voter'] = 'User ID who voted.'; -$string['teacherprioritylabel'] = 'Priority column label'; -$string['teacherprioritylabel_descr'] = 'Enter a default label for the Priority column.'; $string['question'] = 'Question'; -$string['questions'] = 'Questions'; $string['questionlabel'] = 'Questions column label'; $string['questionlabel_descr'] = 'Enter a default label for the Questions column.'; -$string['questionsubmitted'] = 'Your post has been submitted successfully.'; $string['questionremove'] = 'Remove'; $string['questionremovesuccess'] = 'You have successfully removed that question.'; +$string['questions'] = 'Questions'; +$string['questionsubmitted'] = 'Your post has been submitted successfully.'; $string['rawgrade'] = 'Raw grade {$a->rawgrade} / {$a->max}'; +$string['removedround'] = 'You have successfully removed this round.'; $string['removelabel'] = 'Remove column label'; $string['removelabel_descr'] = 'Enter a default label for the Remove column.'; $string['removeround'] = 'Remove this round'; -$string['removedround'] = 'You have successfully removed this round.'; $string['removevote'] = 'Remove my vote'; $string['requireapproval'] = 'Approval required'; -$string['requireapproval_help'] = 'If enabled, questions require approval by a teacher before they are viewable by everyone.'; $string['requireapproval_descr'] = 'If enabled, questions require approval by a teacher before they are viewable by everyone.'; +$string['requireapproval_help'] = 'If enabled, questions require approval by a teacher before they are viewable by everyone.'; $string['resethotquestion'] = 'Delete all questions and votes'; $string['returnto'] = 'Return to {$a}'; $string['round'] = 'Round {$a}'; $string['showrecentactivity'] = 'Show recent activity'; $string['showrecentactivityconfig'] = 'Everyone can see notifications in recent activity reports.'; $string['teacherpriority'] = 'Priority'; +$string['teacherprioritylabel'] = 'Priority column label'; +$string['teacherprioritylabel_descr'] = 'Enter a default label for the Priority column.'; $string['teacherpriorityvisibility'] = 'Teacher priority column visibility'; -$string['teacherpriorityvisibility_help'] = 'If enabled, the Teacher priority column is visible.'; $string['teacherpriorityvisibility_descr'] = 'If enabled, the Teacher priority column is visible, otherwise it is hidden.'; +$string['teacherpriorityvisibility_help'] = 'If enabled, the Teacher priority column is visible.'; $string['time'] = 'Time'; $string['totalcomments'] = 'Total comments'; $string['unapprovedquestionhide'] = 'Hide unapproved questions'; diff --git a/lib.php b/lib.php index a153889..12ef29d 100644 --- a/lib.php +++ b/lib.php @@ -911,7 +911,7 @@ function hotquestion_rescale_activity_grades(stdClass $course, stdClass $cm, flo * * @param stdClass $hotquestion stdClass. */ -function hotquestion_check_ratings_recalculation(stdClass $hotquestion) : bool { +function hotquestion_check_ratings_recalculation(stdClass $hotquestion): bool { global $CFG, $DB; require_once($CFG->dirroot.'/mod/hotquestion/locallib.php'); diff --git a/locallib.php b/locallib.php index 73359ef..cebed52 100644 --- a/locallib.php +++ b/locallib.php @@ -663,7 +663,10 @@ public function download_questions($chq, $filename = "export.csv", $delimiter="; if ($hqs = $DB->get_records_sql($sql, $fields)) { $firstrowflag = 1; if (is_siteadmin($USER->id)) { - $currenthqhotquestion = $hqs[1]->hotquestion; + // Set $currenthqhotquestion to the first hotquestion id of the $hqs array. + $temphqs = $hqs; + reset($temphqs); + $currenthqhotquestion = current($temphqs)->hotquestion; } else { $currenthqhotquestion = ''; } @@ -828,7 +831,7 @@ public function tpriority_change($u, $question) { * @param int $userid The single user to calculate the rating for. * @return float $rating number */ - public function calculate_user_ratings($userid = null) : float { + public function calculate_user_ratings($userid = null): float { global $DB, $USER; if (!$userid) { @@ -876,7 +879,7 @@ public function calculate_user_ratings($userid = null) : float { * @param int $questionid The question id. * @return array Array of int userids or empty if none. */ - public function get_question_voters(int $questionid) : array { + public function get_question_voters(int $questionid): array { global $DB; $voters = $DB->get_records_menu('hotquestion_votes', ['question' => $questionid], '', 'id, voter'); diff --git a/renderer.php b/renderer.php index d973eb6..71d4f8f 100644 --- a/renderer.php +++ b/renderer.php @@ -441,15 +441,15 @@ public function questions($allowvote = true) { .$this->hotquestion->cm->id.'&action=tpriority&u=1&q=' .$question->id.'" class="hotquestion_vote" id="question_' .$question->id.'">'
-                                       .get_string('teacherpriority', 'hotquestion')
+                                       .get_string('priorityup', 'hotquestion').'
 '; $tpriority .= '   '
-                                       .get_string('teacherpriority', 'hotquestion') .''; + .get_string('prioritydown', 'hotquestion') .'" alt="' + .get_string('prioritydown', 'hotquestion') .'" style="width:16px;height:16px;"/>'; } // Check teacher priority column visibilty settings. @@ -609,7 +609,7 @@ public function hotquestion_get_question_comment_count($question, $cm) { * @param bool $showrating * @return string */ - public function current_user_rating(bool $showrating) : string { + public function current_user_rating(bool $showrating): string { global $USER; $output = ''; diff --git a/tests/behat/add_hot_question_activity.feature b/tests/behat/add_hot_question_activity.feature index 156f61f..368ab29 100644 --- a/tests/behat/add_hot_question_activity.feature +++ b/tests/behat/add_hot_question_activity.feature @@ -18,13 +18,15 @@ Feature: Add HotQuestion activity | student1 | C1 | student | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Hot Question" to section "1" and I fill the form with: - | Activity Name | Test Hot Question name | - | Description | Test Hot Question Description | + And I add a hotquestion activity to course "Course 1" section "1" + And I set the following fields to these values: + | Activity Name | Test Hot Question name | + | Description | Test Hot Question Description | + | cmidnumber | TestHotQuestion | + | viewaftertimeclose | 0 | + And I press "Save and return to course" And I log out - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test Hot Question name" + And I am on the "Test Hot Question name" "mod_hotquestion > View" page logged in as "student1" And I set the following fields to these values: | Submit your question here: | First question | And I press "Click to post" @@ -32,10 +34,16 @@ Feature: Add HotQuestion activity | Submit your question here: | Second question | And I set the field "Display as anonymous" to "1" And I press "Click to post" - # Admin User verifies his posts are logged. - And I navigate to "Logs" in current page administration - Then I should see "Admin User" in the "#report_log_r1_c1" "css_element" + And I log out + # Teacher 1 verifies the posts of Student 1 are logged. + And I log in as "teacher1" + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test Hot Question name" + And I press "Get these logs" + Then I should see "Student 1" in the "#report_log_r1_c1" "css_element" And I should see "Added a question" in the "#report_log_r1_c5" "css_element" - And I should see "Admin User" in the "#report_log_r4_c1" "css_element" + And I should see "Student 1" in the "#report_log_r4_c1" "css_element" And I should see "Added a question" in the "#report_log_r4_c5" "css_element" Then I log out diff --git a/tests/behat/behat_mod_hotquestion.php b/tests/behat/behat_mod_hotquestion.php index 47bf7e0..abb0fdf 100644 --- a/tests/behat/behat_mod_hotquestion.php +++ b/tests/behat/behat_mod_hotquestion.php @@ -26,6 +26,8 @@ require_once(__DIR__ . '/../../../../lib/behat/behat_base.php'); +use Behat\Behat\Context\Step\Given as Given, Behat\Behat\Context\Step\When as When, Behat\Gherkin\Node\TableNode as TableNode; + /** * Steps definitions for mod_hotquestion. * @@ -49,4 +51,71 @@ public function i_open_course_or_activity_settings_page(): void { $this->execute("behat_navigation::i_navigate_to_in_current_page_administration", ['Settings']); } } + + /** + * Convert page names to URLs for steps like 'When I am on the "[page name]" page'. + * + * Recognised page names are: + * | None so far! | | + * + * @param string $page name of the page, with the component name removed e.g. 'Admin notification'. + * @return moodle_url the corresponding URL. + * @throws Exception with a meaningful error message if the specified page cannot be found. + */ + protected function resolve_page_url(string $page): moodle_url { + switch (strtolower($page)) { + default: + throw new Exception('Unrecognised hotquestion page type "' . $page . '."'); + } + } + + /** + * Convert page names to URLs for steps like 'When I am on the "[identifier]" "[page type]" page'. + * + * Recognised page names are: + * | pagetype | name meaning | description | + * | view | Hotquestion name | The hotquestion main page (view.php) | + * | edit | Hotquestion name | The hotquestion edit page (modedit.php) | + * + * @param string $type identifies which type of page this is, e.g. 'preview'. + * @param string $identifier identifies the particular page, e.g. 'Test hotquestion > preview > Attempt 1'. + * @return moodle_url the corresponding URL. + * @throws Exception with a meaningful error message if the specified page cannot be found. + */ + protected function resolve_page_instance_url(string $type, string $identifier): moodle_url { + switch (strtolower($type)) { + case 'view': + return new moodle_url('/mod/hotquestion/view.php', + ['id' => $this->get_cm_by_hotquestion_name($identifier)->id]); + case 'edit': + return new moodle_url('/course/modedit.php', + ['update' => $this->get_cm_by_hotquestion_name($identifier)->id]); + + default: + throw new Exception('Unrecognised hotquestion page type "' . $type . '."'); + } + } + + /** + * Get a hotquestion by name. + * + * @param string $name hotquestion name. + * @return stdClass the corresponding DB row. + */ + protected function get_hotquestion_by_name(string $name): stdClass { + global $DB; + return $DB->get_record('hotquestion', ['name' => $name], '*', MUST_EXIST); + } + + /** + * Get a hotquestion cmid from the quiz name. + * + * @param string $name hotquestion name. + * @return stdClass cm from get_coursemodule_from_instance. + */ + protected function get_cm_by_hotquestion_name(string $name): stdClass { + $hotquestion = $this->get_hotquestion_by_name($name); + return get_coursemodule_from_instance('hotquestion', $hotquestion->id, $hotquestion->course); + } + } diff --git a/tests/behat/hotquestion_no_calendar_capabilities.feature b/tests/behat/hotquestion_no_calendar_capabilities.feature index 459c994..6bbe4e0 100644 --- a/tests/behat/hotquestion_no_calendar_capabilities.feature +++ b/tests/behat/hotquestion_no_calendar_capabilities.feature @@ -16,27 +16,25 @@ Feature: HotQuestion with no calendar capabilites | teacher1 | C1 | editingteacher | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - And I navigate to "Users > Permissions" in current page administration + And I am on the "Course 1" "permissions" page And I override the system permissions of "Teacher" role with: | capability | permission | | moodle/calendar:manageentries | Prohibit | - And I am on "Course 1" course homepage - And I add a "Hot Question" to section "1" and I fill the form with: + And I add a hotquestion activity to course "Course 1" section "1" + And I set the following fields to these values: | Activity Name | Test hotquestion name | | Description | Test hotquestion description | | id_timeopen_enabled | 1 | | id_timeopen_day | 1 | | id_timeopen_month | 1 | - | id_timeopen_year | 2017 | + | id_timeopen_year | 2034 | | id_timeclose_enabled | 1 | | id_timeclose_day | 1 | | id_timeclose_month | 2 | - | id_timeclose_year | 2017 | + | id_timeclose_year | 2034 | + And I press "Save and return to course" And I log out - When I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I follow "Test hotquestion name" - And I navigate to "Edit settings" in current page administration + When I am on the "Test hotquestion name" "mod_hotquestion > Edit" page logged in as "teacher1" And I set the following fields to these values: | id_timeopen_year | 2018 | | id_timeclose_year | 2018 | diff --git a/tests/behat/questions_approve_not_required.feature b/tests/behat/questions_approve_not_required.feature index b65a51f..4a46c16 100644 --- a/tests/behat/questions_approve_not_required.feature +++ b/tests/behat/questions_approve_not_required.feature @@ -35,8 +35,13 @@ Feature: Users can post named or anonymous entries to hotquestion | Submit your question here: | Second question | And I set the field "Display as anonymous" to "1" And I press "Click to post" + And I wait until the page is ready # Admin User verifies his posts are logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Admin User" in the "#report_log_r1_c1" "css_element" And I should see "Added a question" in the "#report_log_r1_c5" "css_element" And I should see "Admin User" in the "#report_log_r4_c1" "css_element" @@ -54,7 +59,11 @@ Feature: Users can post named or anonymous entries to hotquestion And I set the field "Display as anonymous" to "1" And I press "Click to post" # Teacher 1 verifies his posts are logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Teacher 1" in the "#report_log_r1_c1" "css_element" And I should see "Added a question" in the "#report_log_r1_c5" "css_element" And I should see "Teacher 1" in the "#report_log_r4_c1" "css_element" @@ -72,7 +81,11 @@ Feature: Users can post named or anonymous entries to hotquestion And I set the field "Display as anonymous" to "1" And I press "Click to post" # Teacher 2 verifies his posts are logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Teacher 2" in the "#report_log_r1_c1" "css_element" And I should see "Added a question" in the "#report_log_r1_c5" "css_element" And I should see "Teacher 2" in the "#report_log_r4_c1" "css_element" @@ -94,13 +107,15 @@ Feature: Users can post named or anonymous entries to hotquestion Then I log out # Teacher 1 verifies posts are logged for student. Given I log in as "teacher1" - When I am on "Course 1" course homepage - And I follow "Test hotquestion name" - And I navigate to "Logs" in current page administration - Then I should see "Teacher 1" in the "#report_log_r0_c1" "css_element" - And I should see "Course module viewed" in the "#report_log_r0_c5" "css_element" - Then I should see "Student 1" in the "#report_log_r2_c1" "css_element" - And I should see "Added a question" in the "#report_log_r2_c5" "css_element" - And I should see "Student 1" in the "#report_log_r5_c1" "css_element" - And I should see "Added a question" in the "#report_log_r5_c5" "css_element" + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" + Then I should see "Teacher 1" in the "#report_log_r14_c1" "css_element" + And I should see "Course module viewed" in the "#report_log_r14_c5" "css_element" + Then I should see "Student 1" in the "#report_log_r1_c1" "css_element" + And I should see "Added a question" in the "#report_log_r1_c5" "css_element" + And I should see "Student 1" in the "#report_log_r4_c1" "css_element" + And I should see "Added a question" in the "#report_log_r4_c5" "css_element" Then I log out diff --git a/tests/behat/questions_post.feature b/tests/behat/questions_post.feature index 0a30bd0..91a44dd 100644 --- a/tests/behat/questions_post.feature +++ b/tests/behat/questions_post.feature @@ -36,7 +36,12 @@ Feature: Users can post anonymous or named entries to hotquestion And I set the field "Display as anonymous" to "1" And I press "Click to post" # Admin User verifies his posts are logged. - And I navigate to "Logs" in current page administration + And I log in as "teacher1" + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Admin User" in the "#report_log_r1_c1" "css_element" And I should see "Added a question" in the "#report_log_r1_c5" "css_element" And I should see "Admin User" in the "#report_log_r4_c1" "css_element" @@ -54,7 +59,11 @@ Feature: Users can post anonymous or named entries to hotquestion And I set the field "Display as anonymous" to "1" And I press "Click to post" # Teacher 1 verifies his posts are logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Teacher 1" in the "#report_log_r1_c1" "css_element" And I should see "Added a question" in the "#report_log_r1_c5" "css_element" And I should see "Teacher 1" in the "#report_log_r4_c1" "css_element" @@ -72,7 +81,11 @@ Feature: Users can post anonymous or named entries to hotquestion And I set the field "Display as anonymous" to "1" And I press "Click to post" # Teacher 2 verifies his posts are logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Teacher 2" in the "#report_log_r1_c1" "css_element" And I should see "Added a question" in the "#report_log_r1_c5" "css_element" And I should see "Teacher 2" in the "#report_log_r4_c1" "css_element" @@ -110,12 +123,14 @@ Feature: Users can post anonymous or named entries to hotquestion # Teacher 1 verifies posts are logged for student. Given I log in as "teacher1" When I am on "Course 1" course homepage - And I follow "Test hotquestion name" - And I navigate to "Logs" in current page administration - Then I should see "Teacher 1" in the "#report_log_r0_c1" "css_element" - And I should see "Course module viewed" in the "#report_log_r0_c5" "css_element" - Then I should see "Student 1" in the "#report_log_r2_c1" "css_element" - And I should see "Added a question" in the "#report_log_r2_c5" "css_element" - And I should see "Student 1" in the "#report_log_r5_c1" "css_element" - And I should see "Added a question" in the "#report_log_r5_c5" "css_element" + And I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" + Then I should see "Teacher 1" in the "#report_log_r14_c1" "css_element" + And I should see "Course module viewed" in the "#report_log_r14_c5" "css_element" + Then I should see "Student 1" in the "#report_log_r1_c1" "css_element" + And I should see "Added a question" in the "#report_log_r1_c5" "css_element" + And I should see "Student 1" in the "#report_log_r4_c1" "css_element" + And I should see "Added a question" in the "#report_log_r4_c5" "css_element" Then I log out diff --git a/tests/behat/questions_post_to_current_when_viewing_a_closed_round.feature b/tests/behat/questions_post_to_current_when_viewing_a_closed_round.feature index e65ad16..e889d3c 100644 --- a/tests/behat/questions_post_to_current_when_viewing_a_closed_round.feature +++ b/tests/behat/questions_post_to_current_when_viewing_a_closed_round.feature @@ -44,7 +44,11 @@ Feature: When posting a question while viewing a closed round, the question post And I should see "Round 1 first question by student 1" And I follow "Open a new round" # Teacher verfies new round is logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Teacher 1" in the "#report_log_r1_c1" "css_element" And I should see "Opened a new round" in the "#report_log_r1_c5" "css_element" Then I log out diff --git a/tests/behat/questions_remove.feature b/tests/behat/questions_remove.feature index 95a1674..d3dd5cf 100644 --- a/tests/behat/questions_remove.feature +++ b/tests/behat/questions_remove.feature @@ -81,7 +81,11 @@ Feature: Teachers, admin and managers can remove named or anonymous posts And I click on "Remove" "link" in the "Seventh question by student 1" "table_row" Then I should not see "Seventh question by student 1" # Teacher 1 verifies removing post and votes is logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Teacher 1" in the "#report_log_r1_c1" "css_element" And I should see "Remove question" in the "#report_log_r1_c5" "css_element" Then I log out @@ -92,7 +96,11 @@ Feature: Teachers, admin and managers can remove named or anonymous posts And I click on "Remove" "link" in the "Eighth question by student 1" "table_row" Then I should not see "Eighth question by student 1" # Admin User verifies removing post and votes is logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Admin User" in the "#report_log_r1_c1" "css_element" And I should see "Remove question" in the "#report_log_r1_c5" "css_element" Then I log out @@ -103,7 +111,11 @@ Feature: Teachers, admin and managers can remove named or anonymous posts And I click on "Remove" "link" in the "First question by teacher 1" "table_row" Then I should not see "First question by teacher 1" # Manager 1 verifies removing post and votes is logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Manager 1" in the "#report_log_r1_c1" "css_element" And I should see "Remove question" in the "#report_log_r1_c5" "css_element" Then I log out diff --git a/tests/behat/questions_vote.feature b/tests/behat/questions_vote.feature index 1ab7bfd..e898bbc 100644 --- a/tests/behat/questions_vote.feature +++ b/tests/behat/questions_vote.feature @@ -23,10 +23,10 @@ Feature: Users can vote on named or anonymous entries to hotquestion | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | submitdirections | - | hotquestion | Test hotquestion name | Hotquestion intro | C1 | hotquestion1 | Submit your question here: | + | activity | name | intro | course | idnumber | submitdirections | heatvisibility | heatlabel | heatlimit | + | hotquestion | Test hotquestion name | Hotquestion intro | C1 | hotquestion1 | Submit your question here: | 1 | Heat | 5 | Scenario: A user follows vote to increase heat - # Student 1 adds posts and votes. + # Student 1 adds posts. Given I log in as "student1" When I am on "Course 1" course homepage And I follow "Test hotquestion name" @@ -41,6 +41,11 @@ Feature: Users can vote on named or anonymous entries to hotquestion And I should see "Posted by Anonymous" Then I should see "First question by student 1" And I should see "Posted by Student 1" + Then I log out + #Student 2 votes. + Given I log in as "student2" + When I am on "Course 1" course homepage + And I follow "Test hotquestion name" And I click on "Vote" "link" in the "Anonymous" "table_row" Then I should see "1" in the "Anonymous" "table_row" Then I log out @@ -58,49 +63,53 @@ Feature: Users can vote on named or anonymous entries to hotquestion When I am on "Course 1" course homepage And I follow "Test hotquestion name" And I click on "Vote" "link" in the "Anonymous" "table_row" - Then I should see "3" in the "Anonymous" "table_row" + Then I should see "2" in the "Anonymous" "table_row" And I click on "Vote" "link" in the "Student 1" "table_row" - Then I should see "2" in the "Student 1" "table_row" + Then I should see "1" in the "Student 1" "table_row" Then I log out #Manager 1 votes. Given I log in as "manager1" When I am on "Course 1" course homepage And I follow "Test hotquestion name" And I click on "Vote" "link" in the "Anonymous" "table_row" - Then I should see "4" in the "Anonymous" "table_row" + Then I should see "3" in the "Anonymous" "table_row" And I click on "Vote" "link" in the "Student 1" "table_row" - Then I should see "3" in the "Student 1" "table_row" + Then I should see "2" in the "Student 1" "table_row" Then I log out #Teacher 2 votes. Given I log in as "teacher2" When I am on "Course 1" course homepage And I follow "Test hotquestion name" And I click on "Vote" "link" in the "Anonymous" "table_row" - Then I should see "5" in the "Anonymous" "table_row" + Then I should see "4" in the "Anonymous" "table_row" And I click on "Vote" "link" in the "Student 1" "table_row" Then I should see "4" in the "Student 1" "table_row" # Teacher 2 verifies adding votes is logged for everyone. - And I navigate to "Logs" in current page administration - Then I should see "Teacher 2" in the "#report_log_r1_c1" "css_element" - And I should see "Updated vote" in the "#report_log_r1_c5" "css_element" - Then I should see "Teacher 2" in the "#report_log_r3_c1" "css_element" - And I should see "Updated vote" in the "#report_log_r4_c5" "css_element" - # Check for two mangager votes. - Then I should see "Manager 1" in the "#report_log_r8_c1" "css_element" - And I should see "Updated vote" in the "#report_log_r8_c5" "css_element" - Then I should see "Manager 1" in the "#report_log_r11_c1" "css_element" - And I should see "Updated vote" in the "#report_log_r11_c5" "css_element" + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" + Then I should see "Teacher 2" in the "#report_log_r0_c1" "css_element" + And I should see "Updated vote" in the "#report_log_r0_c5" "css_element" + Then I should see "Teacher 2" in the "#report_log_r2_c1" "css_element" + And I should see "Updated vote" in the "#report_log_r2_c5" "css_element" + # Check for two manager votes. + Then I should see "Manager 1" in the "#report_log_r5_c1" "css_element" + And I should see "Updated vote" in the "#report_log_r5_c5" "css_element" + Then I should see "Manager 1" in the "#report_log_r7_c1" "css_element" + And I should see "Updated vote" in the "#report_log_r7_c5" "css_element" # Check for two teacher 1 votes. - Then I should see "Teacher 1" in the "#report_log_r15_c1" "css_element" - And I should see "Updated vote" in the "#report_log_r15_c5" "css_element" - Then I should see "Teacher 1" in the "#report_log_r18_c1" "css_element" - And I should see "Updated vote" in the "#report_log_r18_c5" "css_element" + Then I should see "Teacher 1" in the "#report_log_r10_c1" "css_element" + And I should see "Updated vote" in the "#report_log_r10_c5" "css_element" + Then I should see "Teacher 1" in the "#report_log_r12_c1" "css_element" + And I should see "Updated vote" in the "#report_log_r12_c5" "css_element" # Check for two admin votes. - Then I should see "Admin User" in the "#report_log_r22_c1" "css_element" - And I should see "Updated vote" in the "#report_log_r22_c5" "css_element" - Then I should see "Admin User" in the "#report_log_r25_c1" "css_element" - And I should see "Updated vote" in the "#report_log_r25_c5" "css_element" + Then I should see "Admin User" in the "#report_log_r15_c1" "css_element" + And I should see "Updated vote" in the "#report_log_r15_c5" "css_element" + Then I should see "Admin User" in the "#report_log_r17_c1" "css_element" + And I should see "Updated vote" in the "#report_log_r17_c5" "css_element" # Student 1 only voted once. - Then I should see "Student 1" in the "#report_log_r29_c1" "css_element" - And I should see "Updated vote" in the "#report_log_r29_c5" "css_element" + Then I should see "Student 2" in the "#report_log_r20_c1" "css_element" + And I should see "Updated vote" in the "#report_log_r20_c5" "css_element" Then I log out diff --git a/tests/behat/toolbar_export_to_csv_admin.feature b/tests/behat/toolbar_export_to_csv_admin.feature index 5be9de9..5c7e1e5 100644 --- a/tests/behat/toolbar_export_to_csv_admin.feature +++ b/tests/behat/toolbar_export_to_csv_admin.feature @@ -157,9 +157,14 @@ Feature: Admin user can export all questions from all HotQuestions And I should see "Posted by Anonymous" And I should see "First question 1" And I should see "Posted by Admin User" - And following "Export to .csv" should download between "1300" and "1400" bytes + And following "Export to .csv" should download between "1700" and "1800" bytes + And I log out # Verify download by admin was logged. - And I navigate to "Logs" in current page administration + And I am on the "C1" "Course" page logged in as "admin" + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Admin User" in the "#report_log_r0_c1" "css_element" And I should see "Download questions" in the "#report_log_r0_c5" "css_element" Then I log out diff --git a/tests/behat/toolbar_export_to_csv_teacher.feature b/tests/behat/toolbar_export_to_csv_teacher.feature index b5a1476..caf1c4c 100644 --- a/tests/behat/toolbar_export_to_csv_teacher.feature +++ b/tests/behat/toolbar_export_to_csv_teacher.feature @@ -157,9 +157,13 @@ Feature: Teacher can export questions from current HotQuestion activity And I should see "Posted by Anonymous" And I should see "First question 1" And I should see "Posted by Admin User" - And following "Export to .csv" should download between "700" and "900" bytes + And following "Export to .csv" should download between "700" and "990" bytes # Verify download by Teacher 1 was logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Teacher 1" in the "#report_log_r0_c1" "css_element" And I should see "Download questions" in the "#report_log_r0_c5" "css_element" Then I log out diff --git a/tests/behat/toolbar_open_a_new_round.feature b/tests/behat/toolbar_open_a_new_round.feature index c42c934..cc1fb57 100644 --- a/tests/behat/toolbar_open_a_new_round.feature +++ b/tests/behat/toolbar_open_a_new_round.feature @@ -44,7 +44,11 @@ Feature: Teachers and admin users can start new question rounds And I should see "Round 1 first question by student 1" And I follow "Open a new round" # Verify new round by teacher was logged. - And I navigate to "Logs" in current page administration + And I am on "Course 1" course homepage + When I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Teacher 1" in the "#report_log_r1_c1" "css_element" And I should see "Opened a new round" in the "#report_log_r1_c5" "css_element" Then I log out diff --git a/tests/behat/toolbar_remove_this_round.feature b/tests/behat/toolbar_remove_this_round.feature index b7f4c01..63313b4 100644 --- a/tests/behat/toolbar_remove_this_round.feature +++ b/tests/behat/toolbar_remove_this_round.feature @@ -72,7 +72,11 @@ Feature: Teachers and admin users can remove rounds And I should see "Round 2 third question by student 2" And I follow "Remove this round" # Verify removing a round by teacher was logged. - And I navigate to "Logs" in current page administration + When I am on "Course 1" course homepage + And I navigate to "Reports" in current page administration + And I click on "Logs" "link" + And I set the field "menumodid" to "Test hotquestion name" + And I press "Get these logs" Then I should see "Teacher 1" in the "#report_log_r1_c1" "css_element" And I should see "Remove round" in the "#report_log_r1_c5" "css_element" Then I log out