From 3f06c90ddad3ba1068bba27a545c17b446e08dd4 Mon Sep 17 00:00:00 2001 From: rkingdon Date: Fri, 18 Jun 2004 14:23:19 +0000 Subject: [PATCH] Moved back a few functions from locallib.php to lib.php --- mod/workshop/lib.php | 30 ++++++++++++++++++++++++++++++ mod/workshop/locallib.php | 34 +++------------------------------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index aefc5fae552..1b3c16ab261 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -997,6 +997,23 @@ function workshop_get_participants($workshopid) { } +////////////////////////////////////////////////////////////////////////////////////// +// Non-standard workshop functions +////////////////////////////////////////////////////////////////////////////////////// +function workshop_file_area($workshop, $submission) { + return make_upload_directory( workshop_file_area_name($workshop, $submission) ); +} + + +////////////////////////////////////////////////////////////////////////////////////// +function workshop_file_area_name($workshop, $submission) { +// Creates a directory file name, suitable for make_upload_directory() + global $CFG; + + return "$workshop->course/$CFG->moddata/workshop/$submission->id"; +} + + /////////////////////////////////////////////////////////////////////////////////////////////// function workshop_get_agree_logs($course, $timestart) { // get the "agree" entries for this user (the assessment owner and add the first and last names @@ -1090,6 +1107,19 @@ function workshop_get_grade_logs($course, $timestart) { } +////////////////////////////////////////////////////////////////////////////////////// +function workshop_get_student_submission($workshop, $user) { +// Return a submission for a particular user + global $CFG; + + $submission = get_record("workshop_submissions", "workshopid", $workshop->id, "userid", $user->id); + if (!empty($submission->timecreated)) { + return $submission; + } + return NULL; +} + + /////////////////////////////////////////////////////////////////////////////////////////////// function workshop_get_submit_logs($course, $timestart) { // get the "submit" entries and add the first and last names... diff --git a/mod/workshop/locallib.php b/mod/workshop/locallib.php index 103725c74a7..6322832f576 100644 --- a/mod/workshop/locallib.php +++ b/mod/workshop/locallib.php @@ -27,14 +27,14 @@ workshop_count_user_submissions($workshop, $user) { workshop_delete_submitted_files($workshop, $submission) { workshop_delete_user_files($workshop, $user, $exception) { -workshop_file_area($workshop, $submission) { -workshop_file_area_name($workshop, $submission) { +workshop_file_area($workshop, $submission) { <--- in lib.php +workshop_file_area_name($workshop, $submission) { <--- in lib.php workshop_get_assessments($submission) { workshop_get_comments($assessment) { workshop_get_participants($workshopid) { workshop_get_student_assessments($workshop, $user) { -workshop_get_student_submission($workshop, $user) { +workshop_get_student_submission($workshop, $user) { <--- in lib.php workshop_get_student_submission_assessments($workshop) { workshop_get_student_submissions($workshop) { <--- in lib.php workshop_get_submission_assessment($submission, $user) { @@ -474,21 +474,6 @@ function workshop_delete_user_files($workshop, $user, $exception) { } -////////////////////////////////////////////////////////////////////////////////////// -function workshop_file_area($workshop, $submission) { - return make_upload_directory( workshop_file_area_name($workshop, $submission) ); -} - - -////////////////////////////////////////////////////////////////////////////////////// -function workshop_file_area_name($workshop, $submission) { -// Creates a directory file name, suitable for make_upload_directory() - global $CFG; - - return "$workshop->course/$CFG->moddata/workshop/$submission->id"; -} - - ////////////////////////////////////////////////////////////////////////////////////// function workshop_get_assessments($submission, $all = '') { // Return assessments for this submission ordered oldest first, newest last @@ -534,19 +519,6 @@ function workshop_get_student_assessments($workshop, $user) { } -////////////////////////////////////////////////////////////////////////////////////// -function workshop_get_student_submission($workshop, $user) { -// Return a submission for a particular user - global $CFG; - - $submission = get_record("workshop_submissions", "workshopid", $workshop->id, "userid", $user->id); - if (!empty($submission->timecreated)) { - return $submission; - } - return NULL; -} - - ////////////////////////////////////////////////////////////////////////////////////// function workshop_get_student_submission_assessments($workshop) { // Return all assessments on the student submissions, order by youngest first, oldest last