Moodle  2.2.1
http://www.collinsharper.com
workshop Class Reference
Inheritance diagram for workshop:

Public Member Functions

 __construct (stdclass $dbrecord, stdclass $cm, stdclass $course, stdclass $context=null)
 get_potential_authors ($musthavesubmission=true)
 get_potential_reviewers ($musthavesubmission=false)
 get_grouped ($users)
 get_allocations ()
 get_submissions ($authorid='all')
 get_submission_by_id ($id)
 get_submission_by_author ($authorid)
 get_published_submissions ($orderby='finalgrade DESC')
 get_example_by_id ($id)
 get_examples_for_manager ()
 get_examples_for_reviewer ($reviewerid)
 prepare_submission (stdClass $record, $showauthor=false)
 prepare_submission_summary (stdClass $record, $showauthor=false)
 prepare_example_submission (stdClass $record)
 prepare_example_summary (stdClass $example)
 prepare_assessment (stdClass $record, $form, array $options=array())
 prepare_example_assessment (stdClass $record, $form=null, array $options=array())
 prepare_example_reference_assessment (stdClass $record, $form=null, array $options=array())
 delete_submission (stdclass $submission)
 get_all_assessments ()
 get_assessment_by_id ($id)
 get_assessment_of_submission_by_user ($submissionid, $reviewerid)
 get_assessments_of_submission ($submissionid)
 get_assessments_by_reviewer ($reviewerid)
 add_allocation (stdclass $submission, $reviewerid, $weight=1, $bulk=false)
 delete_assessment ($id)
 grading_strategy_instance ()
 grading_evaluation_instance ()
 allocator_instance ($method)
 view_url ()
 editform_url ()
 previewform_url ()
 assess_url ($assessmentid)
 exassess_url ($assessmentid)
 submission_url ($id=null)
 exsubmission_url ($id)
 compare_url ($sid, array $aids)
 excompare_url ($sid, $aid)
 updatemod_url ()
 allocation_url ($method=null)
 switchphase_url ($phasecode)
 aggregate_url ()
 toolbox_url ($tool)
 log ($action, moodle_url $url=null, $info=null)
 creating_submission_allowed ($userid)
 modifying_submission_allowed ($userid)
 assessing_allowed ($userid)
 assessing_examples_allowed ()
 assessments_available ()
 switch_phase ($newphase)
 set_peer_grade ($assessmentid, $grade)
 prepare_grading_report_data ($userid, $groups, $page, $perpage, $sortby, $sorthow)
 real_grade_value ($value, $max)
 raw_grade_value ($value, $max)
 real_grade ($value)
 real_grading_grade ($value)
 clear_assessments ()
 clear_submission_grades ($restrict=null)
 aggregate_submission_grades ($restrict=null)
 clear_grading_grades ($restrict=null)
 aggregate_grading_grades ($restrict=null)
 get_feedbackreviewer_form (moodle_url $actionurl, stdclass $assessment, $options=array())
 get_feedbackauthor_form (moodle_url $actionurl, stdclass $submission, $options=array())

Static Public Member Functions

static installed_allocators ()
static instruction_editors_options (stdclass $context)
static percent_to_value ($percent, $total)
static available_maxgrades_list ()
static available_example_modes_list ()
static available_strategies_list ()
static available_dimension_weights_list ()
static available_assessment_weights_list ()
static gcd ($a, $b)
static lcm ($a, $b)
static timestamp_formats ($timestamp)

Data Fields

const ALLOCATION_EXISTS = -9999
const ALLOCATION_ERROR = -9998
const PHASE_SETUP = 10
const PHASE_SUBMISSION = 20
const PHASE_ASSESSMENT = 30
const PHASE_EVALUATION = 40
const PHASE_CLOSED = 50
const EXAMPLES_VOLUNTARY = 0
const EXAMPLES_BEFORE_SUBMISSION = 1
const EXAMPLES_BEFORE_ASSESSMENT = 2
 $cm
 $course
 $context
 $id
 $name
 $intro
 $introformat
 $instructauthors
 $instructauthorsformat
 $instructreviewers
 $instructreviewersformat
 $timemodified
 $phase
 $useexamples
 $usepeerassessment
 $useselfassessment
 $grade
 $gradinggrade
 $strategy
 $evaluation
 $gradedecimals
 $nattachments
 $latesubmissions
 $maxbytes
 $examplesmode
 $submissionstart
 $submissionend
 $assessmentstart
 $assessmentend

Protected Member Functions

 aggregate_submission_grades_process (array $assessments)
 aggregate_grading_grades_process (array $assessments, $timegraded=null)
 users_with_submission (array $userids)
 available_phases_list ()
 log_convert_url (moodle_url $fullurl)

Protected Attributes

 $strategyinstance = null
 $evaluationinstance = null

Detailed Description

Full-featured workshop API

This wraps the workshop database record with a set of methods that are called from the module itself. The class should be initialized right after you get $workshop, $cm and $course records at the begining of the script.

Definition at line 45 of file locallib.php.


Constructor & Destructor Documentation

__construct ( stdclass $  dbrecord,
stdclass $  cm,
stdclass $  course,
stdclass $  context = null 
)

Initializes the workshop API instance using the data from DB

Makes deep copy of all passed records properties. Replaces integer $course attribute with a full database record (course should not be stored in instances table anyway).

Parameters:
stdClass$dbrecordWorkshop instance data from {workshop} table
stdClass$cmCourse module record as returned by get_coursemodule_from_id()
stdClass$courseCourse record from {course} table
stdClass$contextThe context of the workshop instance

Definition at line 173 of file locallib.php.

Here is the call graph for this function:


Member Function Documentation

add_allocation ( stdclass $  submission,
reviewerid,
weight = 1,
bulk = false 
)

Allocate a submission to a user for review

Parameters:
stdClass$submissionSubmission object with at least id property
int$revieweridUser ID
int$weightof the new assessment, from 0 to 16
bool$bulkrepeated inserts into DB expected
Returns:
int ID of the new assessment or an error code

Definition at line 970 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

aggregate_grading_grades ( restrict = null)

Calculates grades for assessment for the given participant(s)

Grade for assessment is calculated as a simple mean of all grading grades calculated by the grading evaluator. The assessment weight is not taken into account here.

Parameters:
null | int | array$restrictIf null, update all reviewers, otherwise update just grades for the given reviewer(s)
Returns:
void

Definition at line 1837 of file locallib.php.

aggregate_grading_grades_process ( array assessments,
timegraded = null 
) [protected]

Given an array of all assessments done by a single reviewer, calculates the final grading grade

This calculates the simple mean of the passed grading grades. If, however, the grading grade was overridden by a teacher, the gradinggradeover value is returned and the rest of grades are ignored.

Parameters:
array$assessmentsof stdclass(->reviewerid ->gradinggrade ->gradinggradeover ->aggregationid ->aggregatedgrade)
null | int$timegradedexplicit timestamp of the aggregation, defaults to the current time
Returns:
void

Reimplemented in testable_workshop.

Definition at line 2024 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

aggregate_submission_grades ( restrict = null)

Calculates grades for submission for the given participant(s) and updates it in the database

Parameters:
null | int | array$restrictIf null, update all authors, otherwise update just grades for the given author(s)
Returns:
void

Definition at line 1755 of file locallib.php.

aggregate_submission_grades_process ( array assessments) [protected]

Given an array of all assessments of a single submission, calculates the final grade for this submission

This calculates the weighted mean of the passed assessment grades. If, however, the submission grade was overridden by a teacher, the gradeover value is returned and the rest of grades are ignored.

Parameters:
array$assessmentsof stdclass(->submissionid ->submissiongrade ->gradeover ->weight ->grade)
Returns:
void

Reimplemented in testable_workshop.

Definition at line 1971 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
moodle_url to the aggregation page

Definition at line 1204 of file locallib.php.

allocation_url ( method = null)
Parameters:
string$methodallocation method
Returns:
moodle_url to the allocation page

Definition at line 1182 of file locallib.php.

Here is the caller graph for this function:

allocator_instance ( method)

Returns instance of submissions allocator

Parameters:
string$methodThe name of the allocation method, must be PARAM_ALPHA
Returns:
stdclass Instance of submissions allocator

Definition at line 1069 of file locallib.php.

assess_url ( assessmentid)
Parameters:
int$assessmentidThe ID of assessment record
Returns:
moodle_url of the assessment page

Definition at line 1110 of file locallib.php.

Here is the call graph for this function:

assessing_allowed ( userid)

Is the given reviewer allowed to create/edit their assessments?

Parameters:
int$userid
Returns:
bool

Definition at line 1309 of file locallib.php.

Here is the call graph for this function:

Are reviewers allowed to create/edit their assessments of the example submissions?

Returns null if example submissions are not enabled in this workshop. Otherwise returns true or false. Note this does not check other conditions like the number of already assessed examples, examples mode etc.

Returns:
null|bool

Definition at line 1340 of file locallib.php.

Are the peer-reviews available to the authors?

Returns:
bool

Definition at line 1361 of file locallib.php.

static available_assessment_weights_list ( ) [static]

Return an array of possible values of assessment weight

Note there is no real reason why the maximum value here is 16. It used to be 10 in workshop 1.x and I just decided to use the same number as in the maximum weight of a single assessment dimension. The value looks reasonable, though. Teachers who would want to assign themselves higher weight probably do not want peer assessment really...

Returns:
array of integers 0, 1, 2, ..., 16

Definition at line 308 of file locallib.php.

Here is the caller graph for this function:

static available_dimension_weights_list ( ) [static]

Return an array of possible values of assessment dimension weight

Returns:
array of integers 0, 1, 2, ..., 16

Definition at line 289 of file locallib.php.

Here is the caller graph for this function:

static available_example_modes_list ( ) [static]

Returns the localized list of supported examples modes

Returns:
array

Definition at line 260 of file locallib.php.

Here is the caller graph for this function:

static available_maxgrades_list ( ) [static]

Returns an array of numeric values that can be used as maximum grades

Returns:
array Array of integers

Definition at line 247 of file locallib.php.

Here is the caller graph for this function:

available_phases_list ( ) [protected]
Returns:
array of available workshop phases

Definition at line 2118 of file locallib.php.

static available_strategies_list ( ) [static]

Returns the list of available grading strategy methods

Returns:
array ['string' => 'string']

Definition at line 273 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Sets the given grades and received grading grades to null

This does not clear the information about how the peers filled the assessment forms, but clears the calculated grades in workshop_assessments. Therefore reviewers have to re-assess the allocated submissions.

Returns:
void

Definition at line 1709 of file locallib.php.

clear_grading_grades ( restrict = null)

Sets the aggregated grades for assessment to null

Parameters:
null | int | array$restrictIf null, update all reviewers, otherwise update just grades for the given reviewer(s)
Returns:
void

Definition at line 1809 of file locallib.php.

clear_submission_grades ( restrict = null)

Sets the grades for submission to null

Parameters:
null | int | array$restrictIf null, update all authors, otherwise update just grades for the given author(s)
Returns:
void

Definition at line 1730 of file locallib.php.

compare_url ( sid,
array aids 
)
Parameters:
int$sidsubmission id
array$aidof int assessment ids
Returns:
moodle_url of the page to compare assessments of the given submission

Definition at line 1148 of file locallib.php.

Is the given user allowed to create their submission?

Parameters:
int$userid
Returns:
bool

Definition at line 1244 of file locallib.php.

Here is the call graph for this function:

delete_assessment ( id)

Delete assessment record or records

Parameters:
mixed$idint|array assessment id or array of assessments ids
Returns:
bool false if $id not a valid parameter, true otherwise

Definition at line 1003 of file locallib.php.

Here is the caller graph for this function:

delete_submission ( stdclass $  submission)

Removes the submission and all relevant data

Parameters:
stdClass$submissionrecord to delete
Returns:
void

Definition at line 825 of file locallib.php.

Returns:
moodle_url of the page for editing this workshop's grading form

Definition at line 1093 of file locallib.php.

Here is the caller graph for this function:

exassess_url ( assessmentid)
Parameters:
int$assessmentidThe ID of assessment record
Returns:
moodle_url of the example assessment page

Definition at line 1120 of file locallib.php.

Here is the call graph for this function:

excompare_url ( sid,
aid 
)
Parameters:
int$sidsubmission id
int$aidassessment id
Returns:
moodle_url of the page to compare the reference assessments of the given example submission

Definition at line 1165 of file locallib.php.

exsubmission_url ( id)
Parameters:
int$idexample submission id
Returns:
moodle_url of the page to view an example submission

Definition at line 1138 of file locallib.php.

static gcd ( a,
b 
) [static]

Helper function returning the greatest common divisor

Parameters:
int$a
int$b
Returns:
int

Definition at line 323 of file locallib.php.

Returns the list of all assessments in the workshop with some data added

Fetches data from {workshop_assessments} and adds some useful information from other tables. The returned object does not contain textual fields (i.e. comments) to prevent memory lack issues.

Returns:
array [assessmentid] => assessment stdclass

Definition at line 841 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the list of all allocations (i.e. assigned assessments) in the workshop

Assessments of example submissions are ignored

Returns:
array

Definition at line 468 of file locallib.php.

Get the complete information about the given assessment

Parameters:
int$idAssessment ID
Returns:
stdclass

Definition at line 869 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_assessment_of_submission_by_user ( submissionid,
reviewerid 
)

Get the complete information about the user's assessment of the given submission

Parameters:
int$sidsubmission ID
int$uiduser ID of the reviewer
Returns:
false|stdclass false if not found, stdclass otherwise

Definition at line 894 of file locallib.php.

Here is the call graph for this function:

get_assessments_by_reviewer ( reviewerid)

Get the complete information about all assessments allocated to the given reviewer

Parameters:
int$reviewerid
Returns:
array

Definition at line 941 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_assessments_of_submission ( submissionid)

Get the complete information about all assessments of the given submission

Parameters:
int$submissionid
Returns:
array

Definition at line 918 of file locallib.php.

Here is the call graph for this function:

get_example_by_id ( id)

Returns full record of the given example submission

Parameters:
int$idexample submission od
Returns:
object

Definition at line 589 of file locallib.php.

Returns the list of example submissions in this workshop with reference assessments attached

Returns:
array of objects or an empty array
See also:
workshop::prepare_example_summary()

Definition at line 601 of file locallib.php.

get_examples_for_reviewer ( reviewerid)

Returns the list of all example submissions in this workshop with the information of assessments done by the given user

Parameters:
int$revieweriduser id
Returns:
array of objects, indexed by example submission id
See also:
workshop::prepare_example_summary()

Definition at line 620 of file locallib.php.

Here is the caller graph for this function:

get_feedbackauthor_form ( moodle_url actionurl,
stdclass $  submission,
options = array() 
)

Returns the mform the teachers use to put a feedback for the author on their submission

Parameters:
moodle_url$actionurl
stdClass$submission
array$optionseditable
Returns:
workshop_feedbackauthor_form

Definition at line 1930 of file locallib.php.

Here is the call graph for this function:

get_feedbackreviewer_form ( moodle_url actionurl,
stdclass $  assessment,
options = array() 
)

Returns the mform the teachers use to put a feedback for the reviewer

Parameters:
moodle_url$actionurl
stdClass$assessment
array$optionseditable, editableweight, overridablegradinggrade
Returns:
workshop_feedbackreviewer_form

Definition at line 1894 of file locallib.php.

Here is the call graph for this function:

get_grouped ( users)

Groups the given users by the group membership

This takes the module grouping settings into account. If "Available for group members only" is set, returns only groups withing the course module grouping. Always returns group [0] with all the given users.

Parameters:
array$usersarray[userid] => stdclass{->id ->lastname ->firstname}
Returns:
array array[groupid][userid] => stdclass{->id ->lastname ->firstname}

Definition at line 427 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_potential_authors ( musthavesubmission = true)

Fetches all users with the capability mod/workshop:submit in the current context

The returned objects contain id, lastname and firstname properties and are ordered by lastname,firstname

Todo:
handle with limits and groups
Parameters:
bool$musthavesubmissionIf true, return only users who have already submitted. All possible authors otherwise.
Returns:
array array[userid] => stdclass{->id ->lastname ->firstname}

Definition at line 389 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_potential_reviewers ( musthavesubmission = false)

Fetches all users with the capability mod/workshop:peerassess in the current context

The returned objects contain id, lastname and firstname properties and are ordered by lastname,firstname

Todo:
handle with limits and groups
Parameters:
bool$musthavesubmissionIf true, return only users who have already submitted. All possible users otherwise.
Returns:
array array[userid] => stdclass{->id ->lastname ->firstname}

Definition at line 407 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_published_submissions ( orderby = 'finalgrade DESC')

Returns published submissions with their authors data

Returns:
array of stdclass

Definition at line 568 of file locallib.php.

Here is the call graph for this function:

get_submission_by_author ( authorid)

Returns a submission submitted by the given author

Parameters:
int$idauthor id
Returns:
stdclass|false

Definition at line 546 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns a submission record with the author's data

Parameters:
int$idsubmission id
Returns:
stdclass

Definition at line 524 of file locallib.php.

Here is the call graph for this function:

get_submissions ( authorid = 'all')

Returns submissions from this workshop

Fetches data from {workshop_submissions} and adds some useful information from other tables. Does not return textual fields to prevent possible memory lack issues.

Parameters:
mixed$authoridint|array|'all' If set to [array of] integer, return submission[s] of the given user[s] only
Returns:
array of records or an empty array

Definition at line 489 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns instance of grading evaluation class

Returns:
stdclass Instance of a grading evaluation

Definition at line 1044 of file locallib.php.

Returns instance of grading strategy class

Returns:
stdclass Instance of a grading strategy

Definition at line 1020 of file locallib.php.

Here is the caller graph for this function:

static installed_allocators ( ) [static]

Return list of available allocation methods

Returns:
array Array ['string' => 'string'] of localized allocation method names

Definition at line 198 of file locallib.php.

Here is the call graph for this function:

static instruction_editors_options ( stdclass $  context) [static]

Returns an array of options for the editors that are used for submitting and assessing instructions

Parameters:
stdClass$contextEDITOR_UNLIMITED_FILES hard-coded value for the 'maxfiles' option
Returns:
array

Definition at line 222 of file locallib.php.

Here is the caller graph for this function:

static lcm ( a,
b 
) [static]

Helper function returning the least common multiple

Parameters:
int$a
int$b
Returns:
int

Definition at line 334 of file locallib.php.

Here is the caller graph for this function:

log ( action,
moodle_url url = null,
info = null 
)

Workshop wrapper around {

See also:
add_to_log()}
Parameters:
string$actionto be logged
moodle_url$urlabsolute url as returned by {
See also:
workshop::submission_url()} and friends
Parameters:
mixed$infoadditional info, usually id in a table

Definition at line 1224 of file locallib.php.

Here is the call graph for this function:

log_convert_url ( moodle_url fullurl) [protected]

Converts absolute URL to relative URL needed by {

See also:
add_to_log()}
Parameters:
moodle_url$urlabsolute URL
Returns:
string

Definition at line 2134 of file locallib.php.

Here is the call graph for this function:

Is the given user allowed to modify their existing submission?

Parameters:
int$userid
Returns:
bool

Definition at line 1283 of file locallib.php.

Here is the call graph for this function:

static percent_to_value ( percent,
total 
) [static]

Given the percent and the total, returns the number

Parameters:
float$percentfrom 0 to 100
float$totalthe 100% value
Returns:
float

Definition at line 234 of file locallib.php.

Here is the caller graph for this function:

prepare_assessment ( stdClass $  record,
form,
array options = array() 
)

Prepares renderable assessment component

The $options array supports the following keys: showauthor - should the author user info be available for the renderer showreviewer - should the reviewer user info be available for the renderer showform - show the assessment form if it is available showweight - should the assessment weight be available for the renderer

Parameters:
stdClass$recordas returned by eg self::get_assessment_by_id()
workshop_assessment_form | null$formas returned by workshop_strategy::get_assessment_form()
array$options
Returns:
workshop_assessment

Definition at line 723 of file locallib.php.

Here is the call graph for this function:

prepare_example_assessment ( stdClass $  record,
form = null,
array options = array() 
)

Prepares renderable example submission's assessment component

The $options array supports the following keys: showauthor - should the author user info be available for the renderer showreviewer - should the reviewer user info be available for the renderer showform - show the assessment form if it is available

Parameters:
stdClass$recordas returned by eg self::get_assessment_by_id()
workshop_assessment_form | null$formas returned by workshop_strategy::get_assessment_form()
array$options
Returns:
workshop_example_assessment

Definition at line 761 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

prepare_example_reference_assessment ( stdClass $  record,
form = null,
array options = array() 
)

Prepares renderable example submission's reference assessment component

The $options array supports the following keys: showauthor - should the author user info be available for the renderer showreviewer - should the reviewer user info be available for the renderer showform - show the assessment form if it is available

Parameters:
stdClass$recordas returned by eg self::get_assessment_by_id()
workshop_assessment_form | null$formas returned by workshop_strategy::get_assessment_form()
array$options
Returns:
workshop_example_reference_assessment

Definition at line 797 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

prepare_example_submission ( stdClass $  record)

Prepares renderable example submission component

Parameters:
stdClass$recordrequired by {
See also:
workshop_example_submission}
Returns:
workshop_example_submission

Definition at line 671 of file locallib.php.

prepare_example_summary ( stdClass $  example)

Prepares renderable example submission summary component

If the example is editable, the caller must set the 'editable' flag explicitly.

Parameters:
stdClass$exampleas returned by workshop::get_examples_for_manager() or workshop::get_examples_for_reviewer()
Returns:
workshop_example_submission_summary to be rendered

Definition at line 686 of file locallib.php.

Here is the call graph for this function:

prepare_grading_report_data ( userid,
groups,
page,
perpage,
sortby,
sorthow 
)

Prepares data object with all workshop grades to be rendered

Parameters:
int$useridthe user we are preparing the report for
mixed$groupssingle group or array of groups - only show users who are in one of these group(s). Defaults to all
int$pagethe current page (for the pagination)
int$perpageparticipants per page (for the pagination)
string$sortbylastname|firstname|submissiontitle|submissiongrade|gradinggrade
string$sorthowASC|DESC
Returns:
stdclass data for the renderer

Definition at line 1429 of file locallib.php.

Here is the call graph for this function:

prepare_submission ( stdClass $  record,
showauthor = false 
)

Prepares renderable submission component

Parameters:
stdClass$recordrequired by {
See also:
workshop_submission}
Parameters:
bool$showauthorshow the author-related information
Returns:
workshop_submission

Definition at line 642 of file locallib.php.

prepare_submission_summary ( stdClass $  record,
showauthor = false 
)

Prepares renderable submission summary component

Parameters:
stdClass$recordrequired by {
See also:
workshop_submission_summary}
Parameters:
bool$showauthorshow the author-related information
Returns:
workshop_submission_summary

Definition at line 657 of file locallib.php.

Returns:
moodle_url of the page for previewing this workshop's grading form

Definition at line 1101 of file locallib.php.

raw_grade_value ( value,
max 
)

Calculates the raw (percentual) value from a real grade

This is used in cases when a user wants to give a grade such as 12 of 20 and we need to save this value in a raw percentual form into DB

Parameters:
float$valuegiven grade
float$maxthe maximal grade
Returns:
float suitable to be stored as numeric(10,5)

Definition at line 1666 of file locallib.php.

Here is the call graph for this function:

real_grade ( value)

Calculates the real value of grade for submission

Parameters:
float$valuepercentual value from 0 to 100
Returns:
string

Definition at line 1686 of file locallib.php.

real_grade_value ( value,
max 
)

Calculates the real value of a grade

Parameters:
float$valuepercentual value from 0 to 100
float$maxthe maximal grade
Returns:
string

Definition at line 1646 of file locallib.php.

Here is the call graph for this function:

real_grading_grade ( value)

Calculates the real value of grade for assessment

Parameters:
float$valuepercentual value from 0 to 100
Returns:
string

Definition at line 1696 of file locallib.php.

set_peer_grade ( assessmentid,
grade 
)

Saves a raw grade for submission as calculated from the assessment form fields

Parameters:
array$assessmentidassessment record id, must exists
mixed$graderaw percentual grade from 0.00000 to 100.00000
Returns:
false|float the saved grade

Definition at line 1404 of file locallib.php.

Here is the caller graph for this function:

submission_url ( id = null)
Returns:
moodle_url of the page to view a submission, defaults to the own one

Definition at line 1129 of file locallib.php.

Here is the caller graph for this function:

switch_phase ( newphase)

Switch to a new workshop phase

Modifies the underlying database record. You should terminate the script shortly after calling this.

Parameters:
int$newphasenew phase code
Returns:
bool true if success, false otherwise

Definition at line 1373 of file locallib.php.

Here is the call graph for this function:

switchphase_url ( phasecode)
Parameters:
int$phasecodeThe internal phase code
Returns:
moodle_url of the script to change the current phase to $phasecode

Definition at line 1195 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static timestamp_formats ( timestamp) [static]

Returns an object suitable for strings containing dates/times

The returned object contains properties date, datefullshort, datetime, ... containing the given timestamp formatted using strftimedate, strftimedatefullshort, strftimedatetime, ... from the current lang's langconfig.php This allows translators and administrators customize the date/time format.

Parameters:
int$timestampthe timestamp in UTC
Returns:
stdclass

Definition at line 349 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

toolbox_url ( tool)
Returns:
moodle_url of this workshop's toolbox page

Definition at line 1212 of file locallib.php.

Returns:
moodle_url of the mod_edit form

Definition at line 1173 of file locallib.php.

Here is the caller graph for this function:

users_with_submission ( array userids) [protected]

Given a list of user ids, returns the filtered one containing just ids of users with own submission

Example submissions are ignored.

Parameters:
array$userids
Returns:
array

Definition at line 2094 of file locallib.php.

view_url ( )
Returns:
moodle_url of this workshop's view page

Definition at line 1085 of file locallib.php.


Field Documentation

$assessmentend

Definition at line 148 of file locallib.php.

$assessmentstart

Definition at line 145 of file locallib.php.

$cm

Definition at line 64 of file locallib.php.

Definition at line 70 of file locallib.php.

Definition at line 67 of file locallib.php.

$evaluation

Definition at line 121 of file locallib.php.

$evaluationinstance = null [protected]

Definition at line 160 of file locallib.php.

$examplesmode

Definition at line 136 of file locallib.php.

$grade

Definition at line 112 of file locallib.php.

$gradedecimals

Definition at line 124 of file locallib.php.

$gradinggrade

Definition at line 115 of file locallib.php.

$id

Definition at line 73 of file locallib.php.

$instructauthors

Definition at line 85 of file locallib.php.

$instructauthorsformat

Definition at line 88 of file locallib.php.

$instructreviewers

Definition at line 91 of file locallib.php.

$instructreviewersformat

Definition at line 94 of file locallib.php.

$intro

Definition at line 79 of file locallib.php.

$introformat

Definition at line 82 of file locallib.php.

$latesubmissions

Definition at line 130 of file locallib.php.

$maxbytes

Definition at line 133 of file locallib.php.

$name

Definition at line 76 of file locallib.php.

$nattachments

Definition at line 127 of file locallib.php.

$phase

Definition at line 100 of file locallib.php.

$strategy

Definition at line 118 of file locallib.php.

$strategyinstance = null [protected]

Definition at line 154 of file locallib.php.

$submissionend

Definition at line 142 of file locallib.php.

$submissionstart

Definition at line 139 of file locallib.php.

$timemodified

Definition at line 97 of file locallib.php.

$useexamples

Definition at line 103 of file locallib.php.

$usepeerassessment

Definition at line 106 of file locallib.php.

$useselfassessment

Definition at line 109 of file locallib.php.

const ALLOCATION_ERROR = -9998

Definition at line 49 of file locallib.php.

const ALLOCATION_EXISTS = -9999

return statuses of add_allocation to be passed to a workshop renderer method

Definition at line 48 of file locallib.php.

Definition at line 61 of file locallib.php.

Definition at line 60 of file locallib.php.

const EXAMPLES_VOLUNTARY = 0

the internal code of the examples modes as are stored in the database

Definition at line 59 of file locallib.php.

const PHASE_ASSESSMENT = 30

Definition at line 54 of file locallib.php.

const PHASE_CLOSED = 50

Definition at line 56 of file locallib.php.

const PHASE_EVALUATION = 40

Definition at line 55 of file locallib.php.

const PHASE_SETUP = 10

the internal code of the workshop phases as are stored in the database

Definition at line 52 of file locallib.php.

const PHASE_SUBMISSION = 20

Definition at line 53 of file locallib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations