Renaming {load|save}_grading_form() methods
[moodle.git] / mod / workshop / locallib.php
CommitLineData
de811c0c
DM
1<?php
2
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17
18
19/**
20 * Library of internal functions for module workshop
21 *
22 * All the workshop specific functions, needed to implement the module
23 * logic, should go to here.
24 *
25 * @package mod-workshop
26 * @copyright 2009 David Mudrak <david.mudrak@gmail.com>
27 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
28 */
29
30defined('MOODLE_INTERNAL') || die();
31
32/**
33 * Return the user's submission record in the given workshop
34 *
35 * Example submissions are not returned. This is intended to return a submission for given
36 * student.
37 *
38 * @param int $workshopid Workshop id
39 * @param int $userid Owner id
40 * @return mixed A fieldset object containing the first matching record or false if not found
41 */
42function workshop_get_user_submission($workshopid, $userid) {
43 global $DB;
44
45 return $DB->get_record('workshop_submissions', array('workshopid' => $workshopid, 'userid' => $userid, 'example' => 0));
46}
47
48