Note: This documentation is for Moodle 2.7. For up-to-date documentation see NEWMODULE Reference.

Development:NEWMODULE Reference

From MoodleDocs
Revision as of 19:21, 1 August 2010 by James Williamson (talk | contribs) (Cleaned up some typos)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.


Template:New Module

This is a first draft of the list of functions frequently used in Moodle modules. The number of occurrences of each function in the following list of 20 modules is found in parenthesis: assignment, chat, choice, data, exercise, feedback, forum, glossary, hotpot, journal, label, lams, lesson, questionnaire, quiz, resource, scorm, survey, wiki, workshop.

newmodule_add_instance (20)

Create a new newmodule activity

Given an object containing all the necessary data (defined by the form in mod.html), this function will create a new instance and return the id number of the new instance. The due date is added to the calendar. This is common to all assignment types.

newmodule_delete_instance (20)

Deletes an assignment activity

Deletes all database records, files and calendar events for this newmodule. This is common to all assignment types.

newmodule_update_instance (20)

Updates a new newmodule activity

Given an object containing all the necessary data (defined by the form in mod.html), this function will update the newmodule instance and return the id number. The due date is updated in the calendar. This is common to all assignment types.

newmodule_get_participants (19)

Returns the users with data in one newmodule

(users with records in ???)

newmodule_user_complete (19)

Print complete information about the user's interaction with the newmodule

newmodule_user_outline (19)

Return an outline of the user's interaction with the assignment.

The default method prints the grade and timemodified.

newmodule_get_post_actions (18)

newmodule_get_view_actions (18)

newmodule_cron (15)

newmodule_reset_userdata (12)

This function is used by the reset_course_userdata function in moodlelib.

This function will remove all posts from the specified newmodule and clean up any related data.

newmodule_print_recent_activity (11)

newmodule_reset_course_form_defaults (10)

newmodule_reset_course_form_definition (10)

Implementation of the function for printing the form elements that control whether the course reset functionality affects the assignment.

newmodule_get_user_grades (8)

newmodule_grade_item_delete (8)

newmodule_grade_item_update (8)

newmodule_grades (8)

newmodule_update_grades (8)

newmodule_reset_gradebook (7)

newmodule_scale_used (7)

newmodule_scale_used_anywhere (6)

newmodule_get_recent_mod_activity (5)

newmodule_log_info (5)

newmodule_print_overview (5)

newmodule_print_recent_mod_activity (5)

newmodule_refresh_events (5)

newmodule_file_area (4)

newmodule_file_area_name (4)