Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.
   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  // NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
  18  
  19  use Behat\Gherkin\Node\TableNode;
  20  
  21  require_once (__DIR__ . '/../../../lib/behat/behat_deprecated_base.php');
  22  
  23  /**
  24   * Steps definitions that are now deprecated and will be removed in the next releases.
  25   *
  26   * This file only contains the steps that previously were in the behat_*.php files in the SAME DIRECTORY.
  27   * When deprecating steps from other components or plugins, create a behat_COMPONENT_deprecated.php
  28   * file in the same directory where the steps were defined.
  29   *
  30   * @package    core_grades
  31   * @category   test
  32   * @copyright  2023 Ilya Tregubov
  33   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  34   */
  35  class behat_grade_deprecated extends behat_deprecated_base {
  36  
  37      /**
  38       * Enters a quick feedback via the gradebook for a specific grade item and user when viewing
  39       * the 'Grader report' with editing mode turned on.
  40       *
  41       * @deprecated since 4.2 - we don't allow edit feedback on grader report anymore.
  42       * @todo MDL-77107 This will be deleted in Moodle 4.6.
  43       * @Given /^I give the feedback "(?P<grade_number>(?:[^"]|\\")*)" to the user "(?P<username_string>(?:[^"]|\\")*)" for the grade item "(?P<grade_activity_string>(?:[^"]|\\")*)"$/
  44       * @param string $feedback
  45       * @param string $userfullname the user's fullname as returned by fullname()
  46       * @param string $itemname
  47       */
  48      public function i_give_the_feedback($feedback, $userfullname, $itemname) {
  49          $this->deprecated_message(['behat_grade::i_give_the_feedback']);
  50  
  51          $gradelabel = $userfullname . ' ' . $itemname;
  52          $fieldstr = get_string('useractivityfeedback', 'gradereport_grader', $gradelabel);
  53  
  54          $this->execute('behat_forms::i_set_the_field_to', array($this->escape($fieldstr), $this->escape($feedback)));
  55      }
  56  }