X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=blobdiff_plain;f=grade%2Ftests%2Fbehat%2Fbehat_grade.php;h=6ee26bf25017bcd54830d30e7cdcffdcf89940a0;hp=727aeb0e71ef01e8d668c67b745b11b7f6cf3cf0;hb=12f946d99904cf2dda79306b5d2d7380712e18ba;hpb=df65120a755d704d24a216d6f43df51a1dfbb403 diff --git a/grade/tests/behat/behat_grade.php b/grade/tests/behat/behat_grade.php index 727aeb0e71e..6ee26bf2501 100644 --- a/grade/tests/behat/behat_grade.php +++ b/grade/tests/behat/behat_grade.php @@ -48,6 +48,23 @@ class behat_grade extends behat_base { return new Given('I set the field "' . $this->escape($fieldstr) . '" to "' . $grade . '"'); } + /** + * Enters a quick feedback via the gradebook for a specific grade item and user when viewing + * the 'Grader report' with editing mode turned on. + * + * @Given /^I give the feedback "(?P(?:[^"]|\\")*)" to the user "(?P(?:[^"]|\\")*)" for the grade item "(?P(?:[^"]|\\")*)"$/ + * @param string $feedback + * @param string $userfullname the user's fullname as returned by fullname() + * @param string $itemname + * @return Given + */ + public function i_give_the_feedback($feedback, $userfullname, $itemname) { + $gradelabel = $userfullname . ' ' . $itemname; + $fieldstr = get_string('useractivityfeedback', 'gradereport_grader', $gradelabel); + + return new Given('I set the field "' . $this->escape($fieldstr) . '" to "' . $this->escape($feedback) . '"'); + } + /** * Changes the settings of a grade item or category or the course. *