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

Go to the source code of this file.

Data Structures

class  lesson_add_page_form_base
class  lesson
class  lesson_base
class  lesson_page
class  lesson_page_answer
class  lesson_page_type_manager

Namespaces

namespace  mod
 

Local Library of functions for module scorm.


Enumerations

enum  LESSON_THISPAGE
enum  LESSON_UNSEENPAGE
enum  LESSON_UNANSWEREDPAGE
enum  LESSON_NEXTPAGE
enum  LESSON_EOL
enum  LESSON_UNSEENBRANCHPAGE
enum  LESSON_PREVIOUSPAGE
enum  LESSON_RANDOMPAGE
enum  LESSON_RANDOMBRANCH
enum  LESSON_CLUSTERJUMP
enum  LESSON_UNDEFINED
enum  LESSON_MAX_EVENT_LENGTH

Functions

 lesson_display_teacher_warning ($lesson)
 lesson_unseen_question_jump ($lesson, $user, $pageid)
 lesson_unseen_branch_jump ($lesson, $userid)
 lesson_random_question_jump ($lesson, $pageid)
 lesson_grade ($lesson, $ntries, $userid=0)
 lesson_displayleftif ($lesson)
 lesson_add_fake_blocks ($page, $cm, $lesson, $timer=null)
 lesson_mediafile_block_contents ($cmid, $lesson)
 lesson_clock_block_contents ($cmid, $lesson, $timer, $page)
 lesson_menu_block_contents ($cmid, $lesson)
 lesson_add_header_buttons ($cm, $context, $extraeditbuttons=false, $lessonpageid=null)
 lesson_get_media_html ($lesson, $context)

Enumeration Type Documentation

Cluster Jump

Definition at line 55 of file locallib.php.

enum LESSON_EOL

End of Lesson

Definition at line 45 of file locallib.php.

LESSON_MAX_EVENT_LENGTH = 432000 ; 5 days maximum

Definition at line 60 of file locallib.php.

Jump to Next Page

Definition at line 43 of file locallib.php.

Jump to Previous Page

Definition at line 49 of file locallib.php.

Jump to a random Branch

Definition at line 53 of file locallib.php.

Jump to a random page within a branch and end of branch or end of lesson

Definition at line 51 of file locallib.php.

Include the files that are required by this module This page

Definition at line 37 of file locallib.php.

Next page -> any page not answered correctly

Definition at line 41 of file locallib.php.

Undefined

Definition at line 57 of file locallib.php.

Jump to an unseen page within a branch and end of branch or end of lesson

Definition at line 47 of file locallib.php.

Next page -> any page not seen before

Definition at line 39 of file locallib.php.


Function Documentation

lesson_add_fake_blocks ( page,
cm,
lesson,
timer = null 
)
Parameters:
$cm
$lesson
$page
Returns:
unknown_type

Definition at line 418 of file locallib.php.

Here is the call graph for this function:

lesson_add_header_buttons ( cm,
context,
extraeditbuttons = false,
lessonpageid = null 
)

Adds header buttons to the page for the lesson

Parameters:
object$cm
object$context
bool$extraeditbuttons
int$lessonpageid

Definition at line 570 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

lesson_clock_block_contents ( cmid,
lesson,
timer,
page 
)

If a timed lesson and not a teacher, then return a block_contents containing the clock.

Parameters:
int$cmidCourse Module ID for this lesson
object$lessonFull lesson record object
object$timerFull timer record object
Returns:
block_contents

Definition at line 484 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Any other lesson functions go here. Each of them must have a name that starts with lesson_ Checks to see if a LESSON_CLUSTERJUMP or a LESSON_UNSEENBRANCHPAGE is used in a lesson.

This function is only executed when a teacher is checking the navigation for a lesson.

Parameters:
stdClass$lessonId of the lesson that is to be checked.
Returns:
boolean True or false.

Definition at line 77 of file locallib.php.

lesson_displayleftif ( lesson)

Determines if a user can view the left menu. The determining factor is whether a user has a grade greater than or equal to the lesson setting of displayleftif

Parameters:
object$lessonLesson object of the current lesson
Returns:
boolean 0 if the user cannot see, or $lesson->displayleft to keep displayleft unchanged

Definition at line 392 of file locallib.php.

lesson_get_media_html ( lesson,
context 
)

This is a function used to detect media types and generate html code.

object $CFG object $PAGE

Parameters:
object$lesson
object$context
Returns:
string $code the html code of media

Definition at line 592 of file locallib.php.

Here is the call graph for this function:

lesson_grade ( lesson,
ntries,
userid = 0 
)

Calculates a user's grade for a lesson.

Parameters:
object$lessonThe lesson that the user is taking.
int$retriesThe attempt number.
int$useridId of the user (optional, default current user).
Returns:
object { nquestions => number of questions answered attempts => number of question attempts total => max points possible earned => points earned by student grade => calculated percentage grade nmanual => number of manually graded questions manualpoints => point value for manually graded questions }

Definition at line 274 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

lesson_mediafile_block_contents ( cmid,
lesson 
)

If there is a media file associated with this lesson, return a block_contents that displays it.

Parameters:
int$cmidCourse Module ID for this lesson
object$lessonFull lesson record object
Returns:
block_contents

Definition at line 447 of file locallib.php.

Here is the caller graph for this function:

lesson_menu_block_contents ( cmid,
lesson 
)

If left menu is turned on, then this will print the menu in a block

Parameters:
int$cmidCourse Module ID for this lesson
lesson$lessonFull lesson record object
Returns:
void

Definition at line 516 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

lesson_random_question_jump ( lesson,
pageid 
)

Handles the random jump between a branch table and end of branch or end of lesson (LESSON_RANDOMPAGE).

Parameters:
lesson$lesson
int$pageidThe id of the page that we are jumping from (?)
Returns:
int The pageid of a random page that is within a branch table

Definition at line 231 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

lesson_unseen_branch_jump ( lesson,
userid 
)

Handles the unseen branch table jump.

Parameters:
lesson$lesson
int$useridUser id.
Returns:
int Will return the page id of a branch table or end of lesson

Definition at line 174 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

lesson_unseen_question_jump ( lesson,
user,
pageid 
)

Interprets the LESSON_UNSEENBRANCHPAGE jump.

will return the pageid of a random unseen page that is within a branch

Parameters:
lesson$lesson
int$useridId of the user.
int$pageidId of the page from which we are jumping.
Returns:
int Id of the next page.

Definition at line 107 of file locallib.php.

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations