Skip to content

Commit

Permalink
Updated some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Sep 11, 2006
1 parent 8350325 commit 9e7f597
Showing 1 changed file with 46 additions and 30 deletions.
76 changes: 46 additions & 30 deletions enrol/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,56 @@ the functionality they are after.


Mandatory methods
-----------------
=================

config_form
process_config
config_form()
process_config()


Login-time methods
------------------

get_student_courses
get_teacher_courses

You probably will want to offer at least get_student_courses().

These methods are triggered when a user logs in successfully,
and they are expected to populate $USER->student and
$USER->teacher arrays and maintain (add/delete) entries from
user_students and user_teachers.

These methods are relevant for most plugins, and are the main
interest for plugins that work with a read-only backend such
as LDAP or a database. You probably will want to offer at
least get_student_courses().

Note that with the multi-enrol infrastructure two things have
changed. We now have an 'enrol' field in those tables, and
each plugin must maintain only its own enrolment records.
Conversely, the $USER->student and ->teacher arrays have the
enrolment type as value, like

$USER->student = array ( $courseid => $plugintype );

==================

Before Moodle 1.7
-----------------

get_student_courses()
get_teacher_courses()

You probably will want to offer at least get_student_courses().

These methods are triggered when a user logs in successfully,
and they are expected to populate $USER->student and
$USER->teacher arrays and maintain (add/delete) entries from
user_students and user_teachers.

These methods are relevant for most plugins, and are the main
interest for plugins that work with a read-only backend such
as LDAP or a database.

Note that with the multi-enrol infrastructure two things have
changed. We now have an 'enrol' field in those tables, and
each plugin must maintain only its own enrolment records.
Conversely, the $USER->student and ->teacher arrays have the
enrolment type as value, like

$USER->student = array ( $courseid => $plugintype );


Moodle 1.7 and later
--------------------

setup_enrolments()

With the advent of roles, there could well not be students and
teachers any more, so enrolment plugins have to be more flexible
about how they map outside data to the internal roles.

This one method should do everything, calling functions from
lib/accesslib.php as necessary to set up relationships.


Interactive enrolment methods
-----------------------------
=============================

print_entry()
check_entry()
Expand All @@ -68,7 +84,7 @@ set to specific interactive enrolment methods.


Cron
----
====

If your class offers a cron() method, it will be invoked by
the standard Moodle cron every 5 minutes. Note that if the
Expand Down

0 comments on commit 9e7f597

Please sign in to comment.