Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/workshop/lib.php File Reference

Go to the source code of this file.

Namespaces

namespace  mod
 

Local Library of functions for module scorm.


Functions

 workshop_supports ($feature)
 workshop_add_instance (stdclass $workshop)
 workshop_update_instance (stdclass $workshop)
 workshop_delete_instance ($id)
 workshop_user_outline ($course, $user, $mod, $workshop)
 workshop_user_complete ($course, $user, $mod, $workshop)
 workshop_print_recent_activity ($course, $viewfullnames, $timestart)
 workshop_get_recent_mod_activity (&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0)
 workshop_print_recent_mod_activity ($activity, $courseid, $detail, $modnames, $viewfullnames)
 workshop_cron ()
 workshop_get_participants ($workshopid)
 workshop_scale_used ($workshopid, $scaleid)
 workshop_scale_used_anywhere ($scaleid)
 workshop_get_extra_capabilities ()
 workshop_grade_item_update (stdclass $workshop, $submissiongrades=null, $assessmentgrades=null)
 workshop_update_grades (stdclass $workshop, $userid=0)
 workshop_grade_item_category_update ($workshop)
 workshop_get_file_areas ($course, $cm, $context)
 workshop_pluginfile ($course, $cm, $context, $filearea, array $args, $forcedownload)
 workshop_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename)
 workshop_extend_navigation (navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm)
 workshop_extend_settings_navigation (settings_navigation $settingsnav, navigation_node $workshopnode=null)
 workshop_page_type_list ($pagetype, $parentcontext, $currentcontext)

Function Documentation

workshop_add_instance ( stdclass $  workshop)

Saves a new instance of the workshop into the database

Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will save a new instance and return the id number of the new instance.

Parameters:
stdClass$workshopAn object from the form in mod_form.php
Returns:
int The id of the newly inserted workshop record

Definition at line 69 of file lib.php.

Here is the call graph for this function:

Function to be run periodically according to the moodle cron This function searches for things that need to be done, such as sending out mail, toggling flags etc ...

Returns:
boolean
Todo:
Finish documenting this function

Definition at line 892 of file lib.php.

Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.

Parameters:
int$idId of the module instance
Returns:
boolean Success/Failure

Definition at line 170 of file lib.php.

Here is the call graph for this function:

workshop_extend_navigation ( navigation_node navref,
stdclass $  course,
stdclass $  module,
cm_info cm 
)

Extends the global navigation tree by adding workshop nodes if there is a relevant content

This can be called by an AJAX request so do not rely on $PAGE as it might not be set up properly.

Parameters:
navigation_node$navrefAn object representing the navigation tree node of the workshop module instance
stdClass$course
stdClass$module
cm_info$cm

Definition at line 1346 of file lib.php.

Here is the call graph for this function:

workshop_extend_settings_navigation ( settings_navigation settingsnav,
navigation_node workshopnode = null 
)

Extends the settings navigation with the Workshop settings

This function is called when the context for the page is a workshop module. This is not called by AJAX so it is safe to rely on the $PAGE.

Parameters:
settings_navigation$settingsnavsettings_navigation
navigation_node$workshopnodenavigation_node

Definition at line 1365 of file lib.php.

Here is the call graph for this function:

Returns all other caps used in the module

Returns:
array

Definition at line 1011 of file lib.php.

workshop_get_file_areas ( course,
cm,
context 
)

Returns the lists of all browsable file areas within the given module context

The file area workshop_intro for the activity introduction field is added automatically by file_browser::get_file_info_context_module()

Parameters:
stdClass$course
stdClass$cm
stdClass$context
Returns:
array of [(string)filearea] => (string)description

Definition at line 1152 of file lib.php.

workshop_get_file_info ( browser,
areas,
course,
cm,
context,
filearea,
itemid,
filepath,
filename 
)

File browsing support for workshop file areas

Parameters:
stdClass$browser
stdClass$areas
stdClass$course
stdClass$cm
stdClass$context
string$filearea
int$itemid
string$filepath
string$filename
Returns:
stdclass file_info instance or null if not found

Definition at line 1268 of file lib.php.

Here is the call graph for this function:

workshop_get_participants ( workshopid)

Returns an array of user ids who are participanting in this workshop

Participants are either submission authors or reviewers or both. Authors of the example submissions and their referential assessments are not returned as the example submission is considered non-user data for the purpose of workshop backup.

Todo:
: deprecated - to be deleted in 2.2
Parameters:
int$workshopidID of an instance of this module
Returns:
array of user ids, empty if there are no participants

Definition at line 909 of file lib.php.

workshop_get_recent_mod_activity ( &$  activities,
&$  index,
timestart,
courseid,
cmid,
userid = 0,
groupid = 0 
)

Returns all activity in course workshops since a given time

Parameters:
array$activitiessequentially indexed array of objects
int$index
int$timestart
int$courseid
int$cmid
int$useriddefaults to 0
int$groupiddefaults to 0
Returns:
void adds items into $activities and increases $index

Definition at line 546 of file lib.php.

Here is the call graph for this function:

Update the grade items categories if they are changed via mod_form.php

We must do it manually here in the workshop module because modedit supports only single grade item while we use two.

Parameters:
stdClass$workshopAn object from the form in mod_form.php

Definition at line 1114 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

workshop_grade_item_update ( stdclass $  workshop,
submissiongrades = null,
assessmentgrades = null 
)

Creates or updates grade items for the give workshop instance

Needed by grade_update_mod_grades() in lib/gradelib.php. Also used by workshop_update_grades().

Parameters:
stdClass$workshopinstance object with extra cmidnumber and modname property
stdClass$submissiongradesdata for the first grade item
stdClass$assessmentgradesdata for the second grade item
Returns:
void

Definition at line 1030 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

workshop_page_type_list ( pagetype,
parentcontext,
currentcontext 
)

Return a list of page types

Parameters:
string$pagetypecurrent page type
stdClass$parentcontextBlock's parent context
stdClass$currentcontextCurrent context of block

Definition at line 1386 of file lib.php.

workshop_pluginfile ( course,
cm,
context,
filearea,
array args,
forcedownload 
)

Serves the files from the workshop file areas

Apart from module intro (handled by pluginfile.php automatically), workshop files may be media inserted into submission content (like images) and submission attachments. For these two, the fileareas workshop_submission_content and workshop_submission_attachment are used. The access rights to the files are checked here. The user must be either a peer-reviewer of the submission or have capability ... (todo) to access the submission files. Besides that, areas workshop_instructauthors and mod_workshop instructreviewers contain the media embedded using the mod_form.php.

Parameters:
stdClass$course
stdClass$cm
stdClass$context
string$filearea
array$args
bool$forcedownload
Returns:
void this should never return to the caller

Definition at line 1181 of file lib.php.

Here is the call graph for this function:

workshop_print_recent_activity ( course,
viewfullnames,
timestart 
)

Given a course and a time, this module should find recent activity that has occurred in workshop activities and print it out. Return true if there was output, or false is there was none.

Parameters:
stdClass$course
bool$viewfullnames
int$timestart
Returns:
boolean

Definition at line 324 of file lib.php.

Here is the call graph for this function:

workshop_print_recent_mod_activity ( activity,
courseid,
detail,
modnames,
viewfullnames 
)

Print single activity item prepared by {

See also:
workshop_get_recent_mod_activity()}

Definition at line 799 of file lib.php.

Here is the call graph for this function:

workshop_scale_used ( workshopid,
scaleid 
)

Is a given scale used by the instance of workshop?

The function asks all installed grading strategy subplugins. The workshop core itself does not use scales. Both grade for submission and grade for assessments do not use scales.

Parameters:
int$workshopidid of workshop instance
int$scaleidid of the scale to check
Returns:
bool

Definition at line 950 of file lib.php.

Here is the call graph for this function:

Is a given scale used by any instance of workshop?

The function asks all installed grading strategy subplugins. The workshop core itself does not use scales. Both grade for submission and grade for assessments do not use scales.

Parameters:
int$scaleidid of the scale to check
Returns:
bool

Definition at line 983 of file lib.php.

Here is the call graph for this function:

workshop_supports ( feature)

Returns the information if the module supports a feature

See also:
plugin_supports() in lib/moodlelib.php
Parameters:
string$featureFEATURE_xx constant for requested feature
Returns:
mixed true if the feature is supported, null if unknown

Definition at line 43 of file lib.php.

workshop_update_grades ( stdclass $  workshop,
userid = 0 
)

Update workshop grades in the gradebook

Needed by grade_update_mod_grades() in lib/gradelib.php

Parameters:
stdClass$workshopinstance object with extra cmidnumber and modname property
int$useridupdate grade of specific user only, 0 means all participants
Returns:
void

Definition at line 1061 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

workshop_update_instance ( stdclass $  workshop)

Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data.

Parameters:
stdClass$workshopAn object from the form in mod_form.php
Returns:
bool success

Definition at line 121 of file lib.php.

Here is the call graph for this function:

workshop_user_complete ( course,
user,
mod,
workshop 
)

Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports.

Returns:
string HTML

Definition at line 272 of file lib.php.

Here is the call graph for this function:

workshop_user_outline ( course,
user,
mod,
workshop 
)

Return a small object with summary information about what a user has done with a given particular instance of this module Used for user activity reports. $return->time = the time they did it $return->info = a short text description

Returns:
stdclass|null

Definition at line 233 of file lib.php.

Here is the call graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations