Moved back a few functions from locallib.php to lib.php

This commit is contained in:
rkingdon 2004-06-18 14:23:19 +00:00
parent de7200645a
commit 3f06c90dda
2 changed files with 33 additions and 31 deletions

View File

@ -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...

View File

@ -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