Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
13
//
13
//
14
// You should have received a copy of the GNU General Public License
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/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea -...
16
 
-
 
17
/**
-
 
18
 * Behat steps definitions for drag and drop onto image.
-
 
19
 *
-
 
20
 * @package   gradereport_grader
-
 
21
 * @category  test
-
 
22
 * @copyright 2015 Oakland University
-
 
23
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
24
 */
-
 
25
 
16
 
Línea 26... Línea 17...
26
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
17
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
Línea 27... Línea -...
27
 
-
 
28
require_once(__DIR__ . '/../../../../../lib/behat/behat_base.php');
-
 
29
 
-
 
30
use Behat\Mink\Exception\ExpectationException as ExpectationException,
18
 
31
    Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException;
19
require_once(__DIR__ . '/../../../../../lib/behat/behat_base.php');
32
 
20
 
-
 
21
/**
-
 
22
 * Behat step definitions for the grader report
33
/**
23
 *
34
 * Steps definitions related with the drag and drop onto image question type.
24
 * @package   gradereport_grader
35
 *
25
 * @category  test
36
 * @copyright 2015 Oakland University
26
 * @copyright 2015 Oakland University
Línea 54... Línea 44...
54
        }
44
        }
55
        return $id;
45
        return $id;
56
    }
46
    }
Línea 57... Línea 47...
57
 
47
 
58
    /**
-
 
59
     * Gets the grade item id from its name.
-
 
60
     *
48
    /**
61
     * @deprecated since 4.2
-
 
62
     * @todo MDL-77107 This will be deleted in Moodle 4.6.
-
 
63
     * @throws Exception
-
 
64
     * @param string $itemname
-
 
65
     * @return int
49
     * @deprecated since 4.2
66
     */
-
 
67
    protected function get_grade_item_id($itemname) {
-
 
68
 
-
 
69
        global $DB;
-
 
70
 
50
     */
71
        debugging('behat_gradereport_grader::get_grade_item_id() is deprecated, please use' .
-
 
72
            ' behat_grades::get_grade_item_id() instead.', DEBUG_DEVELOPER);
-
 
73
 
-
 
74
        if ($id = $DB->get_field('grade_items', 'id', array('itemname' => $itemname))) {
-
 
75
            return $id;
-
 
76
        }
-
 
77
 
-
 
78
        // The course total is a special case.
51
    #[\core\attribute\deprecated('behat_grades::get_grade_item_id', since: '4.2', mdl: 'MDL-77033', final: true)]
79
        if ($itemname === "Course total") {
-
 
80
            if (!$id = $DB->get_field('grade_items', 'id', array('itemtype' => 'course'))) {
-
 
81
                throw new Exception('The specified grade_item with name "' . $itemname . '" does not exist');
-
 
82
            }
-
 
83
            return $id;
-
 
84
        }
-
 
85
 
-
 
86
        // Find a category with the name.
-
 
87
        if ($catid = $DB->get_field('grade_categories', 'id', array('fullname' => $itemname))) {
-
 
88
            if ($id = $DB->get_field('grade_items', 'id', array('iteminstance' => $catid))) {
-
 
89
                return $id;
-
 
90
            }
-
 
91
        }
-
 
92
 
52
    protected function get_grade_item_id() {
93
        throw new Exception('The specified grade_item with name "' . $itemname . '" does not exist');
53
        \core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
Línea 94... Línea 54...
94
    }
54
    }
95
 
55
 
96
    /**
56
    /**