From: David Mudrak Date: Mon, 4 Jan 2010 17:12:35 +0000 (+0000) Subject: Adding locallib.php to store internal functions X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=de811c0cf00dc5b64a7e9a9c0907b9cb3c7d3a4f;p=moodle.git Adding locallib.php to store internal functions --- diff --git a/mod/workshop/locallib.php b/mod/workshop/locallib.php new file mode 100644 index 0000000000..bf546e6c98 --- /dev/null +++ b/mod/workshop/locallib.php @@ -0,0 +1,48 @@ +. + + +/** + * Library of internal functions for module workshop + * + * All the workshop specific functions, needed to implement the module + * logic, should go to here. + * + * @package mod-workshop + * @copyright 2009 David Mudrak + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +/** + * Return the user's submission record in the given workshop + * + * Example submissions are not returned. This is intended to return a submission for given + * student. + * + * @param int $workshopid Workshop id + * @param int $userid Owner id + * @return mixed A fieldset object containing the first matching record or false if not found + */ +function workshop_get_user_submission($workshopid, $userid) { + global $DB; + + return $DB->get_record('workshop_submissions', array('workshopid' => $workshopid, 'userid' => $userid, 'example' => 0)); +} + +