<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gallegre</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gallegre"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Gallegre"/>
	<updated>2026-04-22T00:47:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Logging_2&amp;diff=41304</id>
		<title>Logging 2</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Logging_2&amp;diff=41304"/>
		<updated>2013-07-10T00:58:56Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: logging of long events (moved)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Logging stage 2&lt;br /&gt;
|state = In very early specification&lt;br /&gt;
|tracker = MDL-37658&lt;br /&gt;
|discussion = &lt;br /&gt;
|assignee = moodle.com DEV team&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Mandate =&lt;br /&gt;
&lt;br /&gt;
To rewrite the logging API in Moodle to:&lt;br /&gt;
* Capture richer information from plugins/core about actions.&lt;br /&gt;
* Cover “all” of Moodle.&lt;br /&gt;
* Provide control over how much is logged.&lt;br /&gt;
* Improve efficiency by separating writing and reading so it can scale.&lt;br /&gt;
* Allow simpler control over how much logging history is kept.&lt;br /&gt;
* Support research, reporting and analytics.&lt;br /&gt;
* Support personal timelines.&lt;br /&gt;
&lt;br /&gt;
= Why is Logging an important topic? =&lt;br /&gt;
&lt;br /&gt;
Logging is fundamental to research, reporting and analytics. &lt;br /&gt;
&lt;br /&gt;
* Not much of new Moodle development is based on measured data.  We need to &lt;br /&gt;
** Prove there is a problem&lt;br /&gt;
** Prove that a given change is an improvement.&lt;br /&gt;
*Data comes from logging&lt;br /&gt;
*Better data would allow researchers to study what happens in online teaching.&lt;br /&gt;
*Better data would give admins more feedback on how to run their site (both technically and process)&lt;br /&gt;
*Better data would give teachers better feedback to improve their teaching process. &lt;br /&gt;
*Better data would give students better feedback to improve the learning process.&lt;br /&gt;
*We can&#039;t predict all the analysis that might happen in future.&lt;br /&gt;
&lt;br /&gt;
= Examples of possible developments that would require better logs =&lt;br /&gt;
&lt;br /&gt;
Here are some random ideas, please add more!&lt;br /&gt;
&lt;br /&gt;
* Timely notifications of critical events (defined by users), eg more than five people posted in the same forum within an hour.&lt;br /&gt;
* &amp;quot;Red circle&amp;quot; notification badge counter icons everywhere in Moodle highlighting things that need attention for each user.&lt;br /&gt;
* Colour heatmaps overlaid on course page showing recent usage patterns on a course&lt;br /&gt;
* Visualisation of live activity across a whole site (for admins)&lt;br /&gt;
* Live engagement analytics that take every little action into account&lt;br /&gt;
* Identification of students at risk based on complete history&lt;br /&gt;
&lt;br /&gt;
= Existing Problems =&lt;br /&gt;
&lt;br /&gt;
* Logging is added adhoc by developers, has spotty coverage.  No admin logging!&lt;br /&gt;
* Some logged actions do not contain necessary information.&lt;br /&gt;
* Performance and scalability problem.&lt;br /&gt;
** Log tables are joined in many popular queries and are slow.&lt;br /&gt;
** All logs go to database and it&#039;s not scalable.&lt;br /&gt;
** It is not possible to configure level of logging&lt;br /&gt;
** Large number of database writes even when carrying out ‘read-only’ requests.&lt;br /&gt;
* No archiving, so have to delete old logs.&lt;br /&gt;
* Deletion is wholesale, no control.&lt;br /&gt;
* No synchronization with server logs to help debugging performance issues&lt;br /&gt;
* No storage of traces when there are problems, so we can debug Moodle issues&lt;br /&gt;
&lt;br /&gt;
= Existing log usage analysis =&lt;br /&gt;
&lt;br /&gt;
See [[Logging_usage]]&lt;br /&gt;
&lt;br /&gt;
= Places where we need more logs =&lt;br /&gt;
* Errors and warnings&lt;br /&gt;
** People report errors, but cannot duplicate it.&lt;br /&gt;
** Logging history with stack trace would be very useful&lt;br /&gt;
** Also dump session variables and all other data that can be useful for debugging&lt;br /&gt;
* Admin activities&lt;br /&gt;
* Micro activities in a page (more than one per load)&lt;br /&gt;
* AJAX calls (eg on course page)&lt;br /&gt;
* Should be careful about logging confidential information (e.g. do not log any POST data)&lt;br /&gt;
* Shouldn’t delete logs when course is deleted&lt;br /&gt;
* All events should all be logged&lt;br /&gt;
** Add more events (they are cheap and very useful)&lt;br /&gt;
** Need more standardisation of event data for all triggered events&lt;br /&gt;
** Add a catch-all handler that pushes events to the logging system&lt;br /&gt;
* --&amp;gt; Action logging improvements META - MDL-28443&lt;br /&gt;
* Logging of long events (such as ldap synchronization) should have &lt;br /&gt;
** one unique identifier per event (like for example postfix mail server) to help admin monitor the cron processes&lt;br /&gt;
** at least 2 log entries (begining and end) for each event, possibly more&lt;br /&gt;
&lt;br /&gt;
= Logging Proposal =&lt;br /&gt;
&lt;br /&gt;
This section is deliberately not called &amp;quot;Logging API&amp;quot; because Moodle does not provide any logging API. All plugins that perform logging and analyse logs to display reports can do it as they wish.&lt;br /&gt;
&lt;br /&gt;
* In places where we previously added information to &#039;the&#039; log we must generate the new event.&lt;br /&gt;
* The standard Moodle distribution will include simple DB logging plugin storing the data in new format. There will also be an section (optional) legacy logging plugin that will store data in the old format in {log} table. All standard reports will be upgraded to use the new logging system that will use a logging retrieval plugin to access log information. Custom report plugins will be able to query the {log} table, but should ideally shift to the new logging system over time, so that organisations are not forced to continue double logging.&lt;br /&gt;
&lt;br /&gt;
== Example scenario ==&lt;br /&gt;
&lt;br /&gt;
# Student submits an assignment.&lt;br /&gt;
# Event is triggered by assignment module.&lt;br /&gt;
# The logging handler (plugin) observes the event and determines if it is log-worthy.&lt;br /&gt;
# The logging handler decides which plugin(s) will store the log.&lt;br /&gt;
# Logging storage plugin(s) stores the information about the submission (on disc, in DB or wherever).&lt;br /&gt;
# Teacher requests report of student submissions.&lt;br /&gt;
# Report requests user submission counts from the logging access API (plugin).&lt;br /&gt;
# The logging API decides which logging retrieval plugin can supply the submission counts and requests it.&lt;br /&gt;
# The chosen logging retrieval plugin responds to the logging API with submission count.&lt;br /&gt;
# The logging API returns the counts.&lt;br /&gt;
# Report receives counts and displays count.&lt;br /&gt;
&lt;br /&gt;
== From event to report ==&lt;br /&gt;
&lt;br /&gt;
There are four steps of how event is converted into report:&lt;br /&gt;
&lt;br /&gt;
# Handling of events and filtering what needs to be logged.&lt;br /&gt;
# Storing the events data in the log storage (DB, filesystem, etc.).&lt;br /&gt;
# Retrieving the data from log storage - each plugin implements some methods to query and extract logs back to Moodle.&lt;br /&gt;
# Displaying the data in the report.&lt;br /&gt;
&lt;br /&gt;
One plugin can cover one or several steps. It is also possible to create a report that has built-in logging and listens to events (all 4 steps). Also external logging systems do not need to care about steps 3 and 4 at all.&lt;br /&gt;
&lt;br /&gt;
Moodle standard distribution provides a suggestion on logging-report chain that can be followed by 3rd party plugins and may be not.&lt;br /&gt;
&lt;br /&gt;
[[Image:logging_plugins_relation.png|frame|center|Logging plugins relation]]&lt;br /&gt;
&lt;br /&gt;
[[Image:logging_sequence.png|frame|center|Logging plugins sequence diagram]]&lt;br /&gt;
&lt;br /&gt;
== Standard logging plugins ==&lt;br /&gt;
&lt;br /&gt;
Standard Moodle 2.6 distribution will include 3 plugins:&lt;br /&gt;
&lt;br /&gt;
=== Event logging handling plugin (tool_eventobserver) ===&lt;br /&gt;
&lt;br /&gt;
Responsible for step 1 from above. Has functions pluginname_register_log_instance() and pluginname_unregister_log_instance() that allow to add/remove log storage instance and also allows admin to configure what kind of events to store for each log instance.&lt;br /&gt;
&lt;br /&gt;
=== Event logging DB storage plugin (tool_logdbstorage) ===&lt;br /&gt;
&lt;br /&gt;
Responsible for step 2 from above. Has function pluginname_get_log_instances(). Allows admin to create storage instances and assign event handling plugin to fill each of them&lt;br /&gt;
&lt;br /&gt;
=== Event logging driver plugin (tool_logdbdriver) ===&lt;br /&gt;
&lt;br /&gt;
Responsible for step 3 from above. This plugin can only work with tool_logdbstorage. It provides functions to access data in log.&lt;br /&gt;
&lt;br /&gt;
== Mockups ==&lt;br /&gt;
=== Log storage settings page===&lt;br /&gt;
[[File:dblogstoragemockup.png |frame|center| Log storage settings page]]&lt;br /&gt;
=== Log storage Instance configuration page===&lt;br /&gt;
[[File:dblogstorageinstancemockup.png |frame|center| Log storage instance configuration page]]&lt;br /&gt;
=== File log instance configuration page===&lt;br /&gt;
[[File:Filelogger.png |frame|center| File Log instance configuration page]]&lt;br /&gt;
=== Event observer initial configuration page ===&lt;br /&gt;
[[File:event-observer.png |frame|center| Event observer initial configuration page]]&lt;br /&gt;
=== Event observer individual logging device event management page ===&lt;br /&gt;
[[File:event-observer-2.png |frame|center| Event observer individual logging device event management page]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
We can&#039;t actually predict all the use cases so we must think generically and plan for worst cases.&lt;br /&gt;
&lt;br /&gt;
* Things that don&#039;t need to use logs should not use logs. (Recent activity, etc)&lt;br /&gt;
* Make logging calls as cheap as possible&lt;br /&gt;
* Use Events API for the originating calls to create lots of hooks for other things&lt;br /&gt;
* Use MUC-like plug-ins to determine where to put logs permanently (NoSQL, SAS, file...).  Default will be to the current log table.&lt;br /&gt;
* Log everything we possibly can think of.&lt;br /&gt;
* Define log level settings (on each logging call) so different sites can choose what they want logged and so control size, speed etc&lt;br /&gt;
* add_to_log retained for backward compatibility, make it a wrapper for new logger function.&lt;br /&gt;
* provide hooks to expose logs everywhere.  For example, each page should have a link that shows logs and stats for that page.&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
* [[Event 2]]&lt;br /&gt;
&lt;br /&gt;
Example logging systems:&lt;br /&gt;
* http://logstash.net/ &lt;br /&gt;
* http://fluentd.org/&lt;br /&gt;
* http://logging.apache.org/log4php/&lt;br /&gt;
&lt;br /&gt;
Examples of data-based learning technology development:&lt;br /&gt;
* http://onlinelibrary.wiley.com/doi/10.1111/j.1467-8535.2008.00928.x/abstract &lt;br /&gt;
* http://www.sciencedirect.com/science/article/pii/S0360131510000461 -&amp;gt; qtype_pmatch&lt;br /&gt;
* http://www.tandfonline.com/doi/abs/10.1080/02680513.2011.567754&lt;br /&gt;
* http://oro.open.ac.uk/24619/&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Logging_2&amp;diff=41303</id>
		<title>Logging 2</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Logging_2&amp;diff=41303"/>
		<updated>2013-07-10T00:52:06Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: /* Examples of possible developments that would require better logs */ + long events begin/end&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Logging stage 2&lt;br /&gt;
|state = In very early specification&lt;br /&gt;
|tracker = MDL-37658&lt;br /&gt;
|discussion = &lt;br /&gt;
|assignee = moodle.com DEV team&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Mandate =&lt;br /&gt;
&lt;br /&gt;
To rewrite the logging API in Moodle to:&lt;br /&gt;
* Capture richer information from plugins/core about actions.&lt;br /&gt;
* Cover “all” of Moodle.&lt;br /&gt;
* Provide control over how much is logged.&lt;br /&gt;
* Improve efficiency by separating writing and reading so it can scale.&lt;br /&gt;
* Allow simpler control over how much logging history is kept.&lt;br /&gt;
* Support research, reporting and analytics.&lt;br /&gt;
* Support personal timelines.&lt;br /&gt;
&lt;br /&gt;
= Why is Logging an important topic? =&lt;br /&gt;
&lt;br /&gt;
Logging is fundamental to research, reporting and analytics. &lt;br /&gt;
&lt;br /&gt;
* Not much of new Moodle development is based on measured data.  We need to &lt;br /&gt;
** Prove there is a problem&lt;br /&gt;
** Prove that a given change is an improvement.&lt;br /&gt;
*Data comes from logging&lt;br /&gt;
*Better data would allow researchers to study what happens in online teaching.&lt;br /&gt;
*Better data would give admins more feedback on how to run their site (both technically and process)&lt;br /&gt;
*Better data would give teachers better feedback to improve their teaching process. &lt;br /&gt;
*Better data would give students better feedback to improve the learning process.&lt;br /&gt;
*We can&#039;t predict all the analysis that might happen in future.&lt;br /&gt;
&lt;br /&gt;
= Examples of possible developments that would require better logs =&lt;br /&gt;
&lt;br /&gt;
Here are some random ideas, please add more!&lt;br /&gt;
&lt;br /&gt;
* Timely notifications of critical events (defined by users), eg more than five people posted in the same forum within an hour.&lt;br /&gt;
* &amp;quot;Red circle&amp;quot; notification badge counter icons everywhere in Moodle highlighting things that need attention for each user.&lt;br /&gt;
* Colour heatmaps overlaid on course page showing recent usage patterns on a course&lt;br /&gt;
* Visualisation of live activity across a whole site (for admins)&lt;br /&gt;
* Live engagement analytics that take every little action into account&lt;br /&gt;
* Identification of students at risk based on complete history&lt;br /&gt;
* Logging of long events (such as sync with ldap) should have 1) one identifier per event and 2) at least 2 log entries (begining and end) for each event, possibly more&lt;br /&gt;
&lt;br /&gt;
= Existing Problems =&lt;br /&gt;
&lt;br /&gt;
* Logging is added adhoc by developers, has spotty coverage.  No admin logging!&lt;br /&gt;
* Some logged actions do not contain necessary information.&lt;br /&gt;
* Performance and scalability problem.&lt;br /&gt;
** Log tables are joined in many popular queries and are slow.&lt;br /&gt;
** All logs go to database and it&#039;s not scalable.&lt;br /&gt;
** It is not possible to configure level of logging&lt;br /&gt;
** Large number of database writes even when carrying out ‘read-only’ requests.&lt;br /&gt;
* No archiving, so have to delete old logs.&lt;br /&gt;
* Deletion is wholesale, no control.&lt;br /&gt;
* No synchronization with server logs to help debugging performance issues&lt;br /&gt;
* No storage of traces when there are problems, so we can debug Moodle issues&lt;br /&gt;
&lt;br /&gt;
= Existing log usage analysis =&lt;br /&gt;
&lt;br /&gt;
See [[Logging_usage]]&lt;br /&gt;
&lt;br /&gt;
= Places where we need more logs =&lt;br /&gt;
* Errors and warnings&lt;br /&gt;
** People report errors, but cannot duplicate it.&lt;br /&gt;
** Logging history with stack trace would be very useful&lt;br /&gt;
** Also dump session variables and all other data that can be useful for debugging&lt;br /&gt;
* Admin activities&lt;br /&gt;
* Micro activities in a page (more than one per load)&lt;br /&gt;
* AJAX calls (eg on course page)&lt;br /&gt;
* Should be careful about logging confidential information (e.g. do not log any POST data)&lt;br /&gt;
* Shouldn’t delete logs when course is deleted&lt;br /&gt;
* All events should all be logged&lt;br /&gt;
** Add more events (they are cheap and very useful)&lt;br /&gt;
** Need more standardisation of event data for all triggered events&lt;br /&gt;
** Add a catch-all handler that pushes events to the logging system&lt;br /&gt;
* --&amp;gt; Action logging improvements META - MDL-28443&lt;br /&gt;
&lt;br /&gt;
= Logging Proposal =&lt;br /&gt;
&lt;br /&gt;
This section is deliberately not called &amp;quot;Logging API&amp;quot; because Moodle does not provide any logging API. All plugins that perform logging and analyse logs to display reports can do it as they wish.&lt;br /&gt;
&lt;br /&gt;
* In places where we previously added information to &#039;the&#039; log we must generate the new event.&lt;br /&gt;
* The standard Moodle distribution will include simple DB logging plugin storing the data in new format. There will also be an section (optional) legacy logging plugin that will store data in the old format in {log} table. All standard reports will be upgraded to use the new logging system that will use a logging retrieval plugin to access log information. Custom report plugins will be able to query the {log} table, but should ideally shift to the new logging system over time, so that organisations are not forced to continue double logging.&lt;br /&gt;
&lt;br /&gt;
== Example scenario ==&lt;br /&gt;
&lt;br /&gt;
# Student submits an assignment.&lt;br /&gt;
# Event is triggered by assignment module.&lt;br /&gt;
# The logging handler (plugin) observes the event and determines if it is log-worthy.&lt;br /&gt;
# The logging handler decides which plugin(s) will store the log.&lt;br /&gt;
# Logging storage plugin(s) stores the information about the submission (on disc, in DB or wherever).&lt;br /&gt;
# Teacher requests report of student submissions.&lt;br /&gt;
# Report requests user submission counts from the logging access API (plugin).&lt;br /&gt;
# The logging API decides which logging retrieval plugin can supply the submission counts and requests it.&lt;br /&gt;
# The chosen logging retrieval plugin responds to the logging API with submission count.&lt;br /&gt;
# The logging API returns the counts.&lt;br /&gt;
# Report receives counts and displays count.&lt;br /&gt;
&lt;br /&gt;
== From event to report ==&lt;br /&gt;
&lt;br /&gt;
There are four steps of how event is converted into report:&lt;br /&gt;
&lt;br /&gt;
# Handling of events and filtering what needs to be logged.&lt;br /&gt;
# Storing the events data in the log storage (DB, filesystem, etc.).&lt;br /&gt;
# Retrieving the data from log storage - each plugin implements some methods to query and extract logs back to Moodle.&lt;br /&gt;
# Displaying the data in the report.&lt;br /&gt;
&lt;br /&gt;
One plugin can cover one or several steps. It is also possible to create a report that has built-in logging and listens to events (all 4 steps). Also external logging systems do not need to care about steps 3 and 4 at all.&lt;br /&gt;
&lt;br /&gt;
Moodle standard distribution provides a suggestion on logging-report chain that can be followed by 3rd party plugins and may be not.&lt;br /&gt;
&lt;br /&gt;
[[Image:logging_plugins_relation.png|frame|center|Logging plugins relation]]&lt;br /&gt;
&lt;br /&gt;
[[Image:logging_sequence.png|frame|center|Logging plugins sequence diagram]]&lt;br /&gt;
&lt;br /&gt;
== Standard logging plugins ==&lt;br /&gt;
&lt;br /&gt;
Standard Moodle 2.6 distribution will include 3 plugins:&lt;br /&gt;
&lt;br /&gt;
=== Event logging handling plugin (tool_eventobserver) ===&lt;br /&gt;
&lt;br /&gt;
Responsible for step 1 from above. Has functions pluginname_register_log_instance() and pluginname_unregister_log_instance() that allow to add/remove log storage instance and also allows admin to configure what kind of events to store for each log instance.&lt;br /&gt;
&lt;br /&gt;
=== Event logging DB storage plugin (tool_logdbstorage) ===&lt;br /&gt;
&lt;br /&gt;
Responsible for step 2 from above. Has function pluginname_get_log_instances(). Allows admin to create storage instances and assign event handling plugin to fill each of them&lt;br /&gt;
&lt;br /&gt;
=== Event logging driver plugin (tool_logdbdriver) ===&lt;br /&gt;
&lt;br /&gt;
Responsible for step 3 from above. This plugin can only work with tool_logdbstorage. It provides functions to access data in log.&lt;br /&gt;
&lt;br /&gt;
== Mockups ==&lt;br /&gt;
=== Log storage settings page===&lt;br /&gt;
[[File:dblogstoragemockup.png |frame|center| Log storage settings page]]&lt;br /&gt;
=== Log storage Instance configuration page===&lt;br /&gt;
[[File:dblogstorageinstancemockup.png |frame|center| Log storage instance configuration page]]&lt;br /&gt;
=== File log instance configuration page===&lt;br /&gt;
[[File:Filelogger.png |frame|center| File Log instance configuration page]]&lt;br /&gt;
=== Event observer initial configuration page ===&lt;br /&gt;
[[File:event-observer.png |frame|center| Event observer initial configuration page]]&lt;br /&gt;
=== Event observer individual logging device event management page ===&lt;br /&gt;
[[File:event-observer-2.png |frame|center| Event observer individual logging device event management page]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
We can&#039;t actually predict all the use cases so we must think generically and plan for worst cases.&lt;br /&gt;
&lt;br /&gt;
* Things that don&#039;t need to use logs should not use logs. (Recent activity, etc)&lt;br /&gt;
* Make logging calls as cheap as possible&lt;br /&gt;
* Use Events API for the originating calls to create lots of hooks for other things&lt;br /&gt;
* Use MUC-like plug-ins to determine where to put logs permanently (NoSQL, SAS, file...).  Default will be to the current log table.&lt;br /&gt;
* Log everything we possibly can think of.&lt;br /&gt;
* Define log level settings (on each logging call) so different sites can choose what they want logged and so control size, speed etc&lt;br /&gt;
* add_to_log retained for backward compatibility, make it a wrapper for new logger function.&lt;br /&gt;
* provide hooks to expose logs everywhere.  For example, each page should have a link that shows logs and stats for that page.&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
* [[Event 2]]&lt;br /&gt;
&lt;br /&gt;
Example logging systems:&lt;br /&gt;
* http://logstash.net/ &lt;br /&gt;
* http://fluentd.org/&lt;br /&gt;
* http://logging.apache.org/log4php/&lt;br /&gt;
&lt;br /&gt;
Examples of data-based learning technology development:&lt;br /&gt;
* http://onlinelibrary.wiley.com/doi/10.1111/j.1467-8535.2008.00928.x/abstract &lt;br /&gt;
* http://www.sciencedirect.com/science/article/pii/S0360131510000461 -&amp;gt; qtype_pmatch&lt;br /&gt;
* http://www.tandfonline.com/doi/abs/10.1080/02680513.2011.567754&lt;br /&gt;
* http://oro.open.ac.uk/24619/&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Allegre_Guillaume&amp;diff=34535</id>
		<title>User:Allegre Guillaume</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Allegre_Guillaume&amp;diff=34535"/>
		<updated>2012-07-23T10:41:35Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
I use Moodle in a professional context : I am co-leader of [http://www.silecs.info SILECS],&lt;br /&gt;
a small free software IT service company based in Grenoble, France. &lt;br /&gt;
Our customers are mainly french universities.&lt;br /&gt;
We propose to them Moodle installation, customization and support.&lt;br /&gt;
&lt;br /&gt;
For the documentation effort, I try to participate in the french documentation, by &lt;br /&gt;
updating obsolete translations and beginning new ones.&lt;br /&gt;
&lt;br /&gt;
I also try to contribute to english documentation, mainly by completing existing pages, sharing my experiences.&lt;br /&gt;
My philosophy is &amp;quot;write the doc you&#039;d like to have found&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[fr:Utilisateur:Allegre Guillaume]]&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Frankenstyle&amp;diff=34534</id>
		<title>Frankenstyle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Frankenstyle&amp;diff=34534"/>
		<updated>2012-07-23T10:36:10Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: /* Usage */  + config_plugins&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;Frankenstyle component names&#039; refers to the naming convention that is used to uniquely identify a Moodle plugin based on the type of plugin and its name.  They are used throughout the Moodle code (with a notable exception being the css class names in the themes).&lt;br /&gt;
&lt;br /&gt;
Martin Dougiamas invented the word &#039;frankenstyle&#039; to describe this naming system which was invented by Petr Skoda.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
Frankenstyle component names have a prefix and then a folder name, separated by an underscore. &lt;br /&gt;
&lt;br /&gt;
# The prefix is determined by the type of plugin. For example, the prefix for an activity module is &#039;&#039;&#039;mod&#039;&#039;&#039;.&lt;br /&gt;
# The name is the folder name of the plugin, always lower case.  For example, the name for Quiz is &#039;&#039;&#039;quiz&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
So the frankenstyle component name for the quiz module is &#039;&#039;&#039;mod_quiz&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Plugin types ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Plugin type&lt;br /&gt;
! Frankenstyle prefix&lt;br /&gt;
! Moodle path&lt;br /&gt;
|-&lt;br /&gt;
| [[Activity modules]]&lt;br /&gt;
| mod&lt;br /&gt;
| /mod&lt;br /&gt;
|-&lt;br /&gt;
| [[Admin reports]]&lt;br /&gt;
| report&lt;br /&gt;
| /admin/report&lt;br /&gt;
|-&lt;br /&gt;
| [[Admin tools]]&lt;br /&gt;
| tool&lt;br /&gt;
| /admin/tool&lt;br /&gt;
|-&lt;br /&gt;
| [[Assignment types]]&lt;br /&gt;
| assignment&lt;br /&gt;
| /mod/assignment/type&lt;br /&gt;
|-&lt;br /&gt;
| [[Authentication plugins]]&lt;br /&gt;
| auth&lt;br /&gt;
| /auth&lt;br /&gt;
|-&lt;br /&gt;
| [[Blocks]]&lt;br /&gt;
| block&lt;br /&gt;
| /blocks&lt;br /&gt;
|-&lt;br /&gt;
| Core subsystems&lt;br /&gt;
| core&lt;br /&gt;
| / (not a true plugin, see below for details)&lt;br /&gt;
|-&lt;br /&gt;
| [[Course formats]]&lt;br /&gt;
| format&lt;br /&gt;
| /course/format&lt;br /&gt;
|-&lt;br /&gt;
| [[Course reports]]&lt;br /&gt;
| coursereport&lt;br /&gt;
| /course/report&lt;br /&gt;
|-&lt;br /&gt;
| [[Database fields]]&lt;br /&gt;
| datafield&lt;br /&gt;
| /mod/data/field&lt;br /&gt;
|-&lt;br /&gt;
| [[Database presets]]&lt;br /&gt;
| datapreset&lt;br /&gt;
| /mod/data/preset&lt;br /&gt;
|-&lt;br /&gt;
| [[Editors]]&lt;br /&gt;
| editor&lt;br /&gt;
| /lib/editor&lt;br /&gt;
|-&lt;br /&gt;
| [[Enrolment plugins]]&lt;br /&gt;
| enrol&lt;br /&gt;
| /enrol&lt;br /&gt;
|-&lt;br /&gt;
| [[Filters]]&lt;br /&gt;
| filter&lt;br /&gt;
| /filter&lt;br /&gt;
|-&lt;br /&gt;
| [[Gradebook export]]&lt;br /&gt;
| gradeexport&lt;br /&gt;
| /grade/export&lt;br /&gt;
|-&lt;br /&gt;
| [[Gradebook import]]&lt;br /&gt;
| gradeimport&lt;br /&gt;
| /grade/import&lt;br /&gt;
|-&lt;br /&gt;
| [[Gradebook reports]]&lt;br /&gt;
| gradereport&lt;br /&gt;
| /grade/report&lt;br /&gt;
|-&lt;br /&gt;
| [[Grading methods]]&lt;br /&gt;
| gradingform&lt;br /&gt;
| /grade/grading/form&lt;br /&gt;
|-&lt;br /&gt;
| [[Local plugins]]&lt;br /&gt;
| local&lt;br /&gt;
| /local&lt;br /&gt;
|-&lt;br /&gt;
| [[Messaging consumers]]&lt;br /&gt;
| message&lt;br /&gt;
| /message/output&lt;br /&gt;
|-&lt;br /&gt;
| [[Mnet services]]&lt;br /&gt;
| mnetservice&lt;br /&gt;
| /mnet/service&lt;br /&gt;
|-&lt;br /&gt;
| [[Plagiarism plugins]]&lt;br /&gt;
| plagiarism&lt;br /&gt;
| /plagiarism&lt;br /&gt;
|-&lt;br /&gt;
| [[Portfolio plugins]]&lt;br /&gt;
| portfolio&lt;br /&gt;
| /portfolio&lt;br /&gt;
|-&lt;br /&gt;
| [[Question behaviours]]&lt;br /&gt;
| qbehaviour&lt;br /&gt;
| /question/behaviour&lt;br /&gt;
|-&lt;br /&gt;
| [[Question formats]]&lt;br /&gt;
| qformat&lt;br /&gt;
| /question/format&lt;br /&gt;
|-&lt;br /&gt;
| [[Question types]]&lt;br /&gt;
| qtype&lt;br /&gt;
| /question/type&lt;br /&gt;
|-&lt;br /&gt;
| [[Quiz reports]]&lt;br /&gt;
| quiz&lt;br /&gt;
| /mod/quiz/report&lt;br /&gt;
|-&lt;br /&gt;
| [[Repository plugins]]&lt;br /&gt;
| repository&lt;br /&gt;
| /repository&lt;br /&gt;
|-&lt;br /&gt;
| [[SCORM reports]]&lt;br /&gt;
| scormreport&lt;br /&gt;
| /mod/scorm/report&lt;br /&gt;
|-&lt;br /&gt;
| [[Themes]]&lt;br /&gt;
| theme&lt;br /&gt;
| /theme&lt;br /&gt;
|-&lt;br /&gt;
| [[User profile fields]]&lt;br /&gt;
| profilefield&lt;br /&gt;
| /user/profile/field&lt;br /&gt;
|-&lt;br /&gt;
| [[Webservice protocols]]&lt;br /&gt;
| webservice&lt;br /&gt;
| /webservice&lt;br /&gt;
|-&lt;br /&gt;
| [[Workshop allocation strategies]]&lt;br /&gt;
| workshopallocation&lt;br /&gt;
| /mod/workshop/allocation&lt;br /&gt;
|-&lt;br /&gt;
| [[Workshop evaluation plugins]]&lt;br /&gt;
| workshopeval&lt;br /&gt;
| /mod/workshop/eval&lt;br /&gt;
|-&lt;br /&gt;
| [[Workshop grading forms]]&lt;br /&gt;
| workshopform&lt;br /&gt;
| /mod/workshop/form&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get a definitive list in your version of Moodle 2.x, use a small Moodle script with &amp;lt;tt&amp;gt;print_object(get_plugin_types());&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Core subsystems ==&lt;br /&gt;
&lt;br /&gt;
Subsystems in Moodle are not plugins themselves but can be referred to using &#039;&#039;&#039;core_xxx&#039;&#039;&#039; where xxx is the subsystem name as defined in get_core_subsystems().   &lt;br /&gt;
&lt;br /&gt;
You can see these being used in the @package parameter in phpdocs, or in the [[Web_services_Roadmap|webservice function names]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Core subsystem&lt;br /&gt;
! Frankenstyle component name&lt;br /&gt;
|-&lt;br /&gt;
| Access&lt;br /&gt;
| core_access&lt;br /&gt;
|-&lt;br /&gt;
| Conditional availability&lt;br /&gt;
| core_condition&lt;br /&gt;
|-&lt;br /&gt;
| Comment&lt;br /&gt;
| core_comment&lt;br /&gt;
|-&lt;br /&gt;
| Completion&lt;br /&gt;
| core_completion&lt;br /&gt;
|-&lt;br /&gt;
| Course&lt;br /&gt;
| core_course&lt;br /&gt;
|-&lt;br /&gt;
| Enrol&lt;br /&gt;
| core_enrol&lt;br /&gt;
|-&lt;br /&gt;
| Files&lt;br /&gt;
| core_files&lt;br /&gt;
|-&lt;br /&gt;
| Forms&lt;br /&gt;
| core_form&lt;br /&gt;
|-&lt;br /&gt;
| Grade&lt;br /&gt;
| core_grade&lt;br /&gt;
|-&lt;br /&gt;
| Groups&lt;br /&gt;
| core_group&lt;br /&gt;
|-&lt;br /&gt;
| Messages&lt;br /&gt;
| core_message&lt;br /&gt;
|-&lt;br /&gt;
| Mnet&lt;br /&gt;
| core_mnet&lt;br /&gt;
|-&lt;br /&gt;
| My home page&lt;br /&gt;
| core_my&lt;br /&gt;
|-&lt;br /&gt;
| Notes&lt;br /&gt;
| core_notes&lt;br /&gt;
|-&lt;br /&gt;
| Ratings&lt;br /&gt;
| core_rating&lt;br /&gt;
|-&lt;br /&gt;
| Role&lt;br /&gt;
| core_role&lt;br /&gt;
|-&lt;br /&gt;
| RSS&lt;br /&gt;
| core_rss&lt;br /&gt;
|-&lt;br /&gt;
| Tag&lt;br /&gt;
| core_tag&lt;br /&gt;
|-&lt;br /&gt;
| User&lt;br /&gt;
| core_user&lt;br /&gt;
|-&lt;br /&gt;
| Web service&lt;br /&gt;
| core_webservice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Frankenstyle component names are used in:&lt;br /&gt;
&lt;br /&gt;
=== Table names ===&lt;br /&gt;
&lt;br /&gt;
All table names for a plugin must begin with its frankenstyle name (after the standard Moodle table prefix).  &lt;br /&gt;
&lt;br /&gt;
(The exception to this rule is Moodle activities which (for historical reasons) do not have mod_ in front of the plugin name)&lt;br /&gt;
&lt;br /&gt;
Examples: mdl_&#039;&#039;&#039;local_coolreport&#039;&#039;&#039;, mdl_&#039;&#039;&#039;local_coolreport&#039;&#039;&#039;_users&lt;br /&gt;
&lt;br /&gt;
=== Plugin configuration table ===&lt;br /&gt;
&lt;br /&gt;
In the &#039;&#039;&#039;config_plugins&#039;&#039;&#039; table, column &#039;&#039;&#039;plugin&#039;&#039;&#039;, the frankenstyle name is used.&lt;br /&gt;
&lt;br /&gt;
=== Capabilities ===&lt;br /&gt;
&lt;br /&gt;
All capabilities for a plugin use the frankenstyle name, except with a / instead of a _.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;&#039;mod/quiz&#039;&#039;&#039;:viewattempt&lt;br /&gt;
&lt;br /&gt;
=== Language files===&lt;br /&gt;
&lt;br /&gt;
The main language file for each plugin (with the notable exception of activity modules) is the frankenstyle component name. &lt;br /&gt;
&lt;br /&gt;
Examples:  /blocks/participants/lang/en/&#039;&#039;&#039;block_participants&#039;&#039;&#039;.php&lt;br /&gt;
&lt;br /&gt;
=== Renderers ===&lt;br /&gt;
&lt;br /&gt;
=== Other places (TODO) ===&lt;br /&gt;
&lt;br /&gt;
* @package declarations in phpdocs, see [[Coding_style#PHPDoc]]&lt;br /&gt;
* [[Web_services_Roadmap|web service function names]]&lt;br /&gt;
* [http://moodle.org Moodle Plugins database]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please add more as they come up.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Plugins]]&lt;br /&gt;
* [[Core APIs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Plugin_types&amp;diff=34533</id>
		<title>Plugin types</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Plugin_types&amp;diff=34533"/>
		<updated>2012-07-23T10:30:36Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: script for listing plugin types&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The M in Moodle stands for modular.  The easiest and most maintainable way to add new functionality to Moodle is by writing one of these types of plugin. &lt;br /&gt;
If none of the standardized types fits your needs, you can use the &amp;quot;local&amp;quot; type.&lt;br /&gt;
&lt;br /&gt;
You can get the most recent list of types with the following script, or refer to the table below.&lt;br /&gt;
 &amp;lt;?php                                                                                                        &lt;br /&gt;
 define(&#039;CLI_SCRIPT&#039;, true);&lt;br /&gt;
 require(&#039;path/to/config.php&#039;); // global moodle config file.&lt;br /&gt;
 print_object(get_plugin_types());&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Plugin type&lt;br /&gt;
! Component name&lt;br /&gt;
! Moodle path&lt;br /&gt;
! Description&lt;br /&gt;
! Moodle versions&lt;br /&gt;
|-&lt;br /&gt;
| [[Activity modules]]&lt;br /&gt;
| mod&lt;br /&gt;
| /mod&lt;br /&gt;
| Activity modules are the most important type of plugins.  They provide activities in courses.  For example: Forum, Quiz and Assignment.&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Admin reports]]&lt;br /&gt;
| report&lt;br /&gt;
| /admin/report&lt;br /&gt;
| Provides useful views of data in a Moodle site, for admins only.&lt;br /&gt;
| Up to 2.1 (for 2.2+ see [[Reports]])&lt;br /&gt;
|-&lt;br /&gt;
| [[Admin tools]]&lt;br /&gt;
| tool&lt;br /&gt;
| /admin/tool&lt;br /&gt;
| Provides utility scripts useful for admins to examine and modify a Moodle site&lt;br /&gt;
| 2.2+&lt;br /&gt;
|-&lt;br /&gt;
| [[Assignment types|Assignment 2.2 types]]&lt;br /&gt;
| assignment&lt;br /&gt;
| /mod/assignment/type&lt;br /&gt;
| Different forms of assignments to be graded by teachers&lt;br /&gt;
| 1.x - 2.2&lt;br /&gt;
|-&lt;br /&gt;
| Assignment 2.3 submissions&lt;br /&gt;
| assignsubmission&lt;br /&gt;
| /mod/assign/submission&lt;br /&gt;
| Different forms of assignment submissions&lt;br /&gt;
| 2.3+&lt;br /&gt;
|-&lt;br /&gt;
| Assignment 2.3 feedbacks&lt;br /&gt;
| assignfeedback&lt;br /&gt;
| /mod/assign/feedback&lt;br /&gt;
| Different forms of assignment feedbacks&lt;br /&gt;
| 2.3+&lt;br /&gt;
|-&lt;br /&gt;
| [[Authentication plugins]]&lt;br /&gt;
| auth&lt;br /&gt;
| /auth&lt;br /&gt;
| Allows connection to external sources of authentication&lt;br /&gt;
| 2.0&lt;br /&gt;
|-&lt;br /&gt;
| [[Blocks]]&lt;br /&gt;
| block&lt;br /&gt;
| /blocks&lt;br /&gt;
| Small information-displays or tools that can be moved around pages&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Course formats]]&lt;br /&gt;
| format&lt;br /&gt;
| /course/format&lt;br /&gt;
| Different ways of laying out the activities and blocks in a course&lt;br /&gt;
| 1.3+&lt;br /&gt;
|-&lt;br /&gt;
| [[Course reports]]&lt;br /&gt;
| coursereport&lt;br /&gt;
| /course/report&lt;br /&gt;
| Reports of activity within the course&lt;br /&gt;
| Up to 2.1 (for 2.2+ see [[Reports]])&lt;br /&gt;
|-&lt;br /&gt;
| [[Database fields]]&lt;br /&gt;
| datafield&lt;br /&gt;
| /mod/data/field&lt;br /&gt;
| Different types of data that may be added to databases&lt;br /&gt;
| 1.6+&lt;br /&gt;
|-&lt;br /&gt;
| [[Database presets]]&lt;br /&gt;
| datapreset&lt;br /&gt;
| /mod/data/preset&lt;br /&gt;
| Pre-defined templates for databases&lt;br /&gt;
| 1.6+&lt;br /&gt;
|-&lt;br /&gt;
| [[Editors]]&lt;br /&gt;
| editor&lt;br /&gt;
| /lib/editor&lt;br /&gt;
| Alternative text editors for editing content&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Enrolment plugins]]&lt;br /&gt;
| enrol&lt;br /&gt;
| /enrol&lt;br /&gt;
| Ways to control who is enrolled in courses&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Filters]]&lt;br /&gt;
| filter&lt;br /&gt;
| /filter&lt;br /&gt;
| Automatically convert, highlight, and transmogrify text posted into Moodle.&lt;br /&gt;
| 1.4+&lt;br /&gt;
|-&lt;br /&gt;
| [[Gradebook export]]&lt;br /&gt;
| gradeexport&lt;br /&gt;
| /grade/export&lt;br /&gt;
| Export grades in various formats&lt;br /&gt;
| 1.9+&lt;br /&gt;
|-&lt;br /&gt;
| [[Gradebook import]]&lt;br /&gt;
| gradeimport&lt;br /&gt;
| /grade/import&lt;br /&gt;
| Import grades in various formats &lt;br /&gt;
| 1.9+&lt;br /&gt;
|-&lt;br /&gt;
| [[Gradebook reports]]&lt;br /&gt;
| gradereport&lt;br /&gt;
| /grade/report&lt;br /&gt;
| Display/edit grades in various layouts and reports&lt;br /&gt;
| 1.9+&lt;br /&gt;
|-&lt;br /&gt;
| [[Grading methods]]&lt;br /&gt;
| gradingform&lt;br /&gt;
| /grade/grading/form&lt;br /&gt;
| Interfaces for actually performing grading in activity modules (eg Rubrics).&lt;br /&gt;
| 2.2+&lt;br /&gt;
|-&lt;br /&gt;
| [[Local plugins]]&lt;br /&gt;
| local&lt;br /&gt;
| /local&lt;br /&gt;
| Generic plugins for local customisations&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Messaging consumers]]&lt;br /&gt;
| message&lt;br /&gt;
| /message/output&lt;br /&gt;
| Send messages to users via different methods (email, sms, jabber, etc)&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Plagiarism plugins]]&lt;br /&gt;
| plagiarism&lt;br /&gt;
| /plagiarism&lt;br /&gt;
| Define external services to process submitted files and content&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Portfolio plugins]]&lt;br /&gt;
| portfolio&lt;br /&gt;
| /portfolio&lt;br /&gt;
| Connect external portfolio services as destinations for users to store Moodle content&lt;br /&gt;
| 1.9+&lt;br /&gt;
|-&lt;br /&gt;
| [[Question behaviours]]&lt;br /&gt;
| qbehaviour&lt;br /&gt;
| /question/behaviour&lt;br /&gt;
| Control how student interact with questions during an attempt&lt;br /&gt;
| 2.1+&lt;br /&gt;
|-&lt;br /&gt;
| [[Question formats]]&lt;br /&gt;
| qformat&lt;br /&gt;
| /question/format&lt;br /&gt;
| Import and export question definitions to/from the question bank&lt;br /&gt;
| 1.6+&lt;br /&gt;
|-&lt;br /&gt;
| [[Question types]]&lt;br /&gt;
| qtype&lt;br /&gt;
| /question/type&lt;br /&gt;
| Different types of question (e.g. multiple-choice, drag-and-drop) that can be used in quizzes and other activities&lt;br /&gt;
| 1.6+&lt;br /&gt;
|-&lt;br /&gt;
| [[Quiz access rules]]&lt;br /&gt;
| quizaccess&lt;br /&gt;
| /mod/quiz/accessrule&lt;br /&gt;
| Add conditions to when or where quizzes can be attempted, for example only from some IP addresses, or student must enter a password first&lt;br /&gt;
| 2.2+&lt;br /&gt;
|-&lt;br /&gt;
| [[Quiz reports]]&lt;br /&gt;
| quiz&lt;br /&gt;
| /mod/quiz/report&lt;br /&gt;
| Display and analyse the results of quizzes, or just plug miscellaneous behaviour into the quiz module&lt;br /&gt;
| 1.1+&lt;br /&gt;
|-&lt;br /&gt;
| [[Reports]]&lt;br /&gt;
| report&lt;br /&gt;
| /report&lt;br /&gt;
| Provides useful views of data in a Moodle site for admins and teachers&lt;br /&gt;
| 2.2+&lt;br /&gt;
|-&lt;br /&gt;
| [[Repository plugins]]&lt;br /&gt;
| repository&lt;br /&gt;
| /repository&lt;br /&gt;
| Connect to external sources of files to use in Moodle&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[SCORM reports]]&lt;br /&gt;
| scormreport&lt;br /&gt;
| /mod/scorm/report&lt;br /&gt;
| Analysis of SCORM attempts&lt;br /&gt;
| 2.2+&lt;br /&gt;
|-&lt;br /&gt;
| [[Themes]]&lt;br /&gt;
| theme&lt;br /&gt;
| /theme&lt;br /&gt;
| Change the look of Moodle by changing the the HTML and the CSS.  See also [[Themes 1.9]].&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[User profile fields]]&lt;br /&gt;
| profilefield&lt;br /&gt;
| /user/profile/field&lt;br /&gt;
| Add new types of data to user profiles&lt;br /&gt;
| 1.9+&lt;br /&gt;
|-&lt;br /&gt;
| [[Webservice protocols]]&lt;br /&gt;
| webservice&lt;br /&gt;
| /webservice&lt;br /&gt;
| Define new protocols for web service communication (such as SOAP, XML-RPC, JSON, REST ...)&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Workshop allocation methods]]&lt;br /&gt;
| workshopallocation&lt;br /&gt;
| /mod/workshop/allocation&lt;br /&gt;
| Define ways how submissions are assigned for assessment in the [[Workshop]] module&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Workshop evaluation methods]]&lt;br /&gt;
| workshopeval&lt;br /&gt;
| /mod/workshop/eval&lt;br /&gt;
| Implement the calculation of the grade for assessment (grading grade) in the [[Workshop]] module&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Workshop grading strategies]]&lt;br /&gt;
| workshopform&lt;br /&gt;
| /mod/workshop/form&lt;br /&gt;
| Define the type of the grading form and implement the calculation of the grade for submission in the [[Workshop]] module&lt;br /&gt;
| 2.0+&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Guidelines_for_contributed_code|Guidelines for contributing code]]&lt;br /&gt;
* [[Core APIs]]&lt;br /&gt;
* [[Frankenstyle]]&lt;br /&gt;
* [http://moodle.org/plugins Moodle Plugins database] - lists all the modules that people have contributed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|Plugins]]&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_reports&amp;diff=34523</id>
		<title>Course reports</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_reports&amp;diff=34523"/>
		<updated>2012-07-20T18:50:30Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: Removed obsolete or incorrect documentation about mod.php&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A course report plugin is just another folder inside course/report/. It follows standard plugin practice and may have lang, db etc. sub-folders if these are required. A version.php file must be included. &lt;br /&gt;
&lt;br /&gt;
In order to add a menu entry for your plugin, you must define a function named &#039;&#039;FOOBAR_report_extend_navigation&#039;&#039; in your &#039;&#039;lib.php&#039;&#039; file, where FOOBAR is your plugin name.&lt;br /&gt;
For example, for a module named &#039;&#039;synopsis&#039;&#039; (coursereport_synopsis in standardized form), the code will be :&lt;br /&gt;
&lt;br /&gt;
 function synopsis_report_extend_navigation($reportnav, $course, $context) {&lt;br /&gt;
     $url = new moodle_url(&#039;/course/report/synopsis/index.php&#039;, array(&#039;id&#039; =&amp;gt; $course-&amp;gt;id));&lt;br /&gt;
     $reportnav-&amp;gt;add(get_string(&#039;Synopsis&#039;, &#039;coursereport_synopsis&#039;), $url);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_reports&amp;diff=34522</id>
		<title>Course reports</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_reports&amp;diff=34522"/>
		<updated>2012-07-20T18:48:17Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: added correct documentation for menu entries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A course report plugin is just another folder inside course/report/. It follows standard plugin practice and may have lang, db etc. sub-folders if these are required. A version.php file must be included. &lt;br /&gt;
&lt;br /&gt;
In order to add a menu entry for your plugin, you must define a function named &#039;&#039;FOOBAR_report_extend_navigation&#039;&#039; in your &#039;&#039;lib.php&#039;&#039; file, where FOOBAR is your plugin name.&lt;br /&gt;
For example, for a module named &#039;&#039;synopsis&#039;&#039; (coursereport_synopsis in standardized form), the code will be :&lt;br /&gt;
&lt;br /&gt;
 function synopsis_report_extend_navigation($reportnav, $course, $context) {&lt;br /&gt;
     $url = new moodle_url(&#039;/course/report/synopsis/index.php&#039;, array(&#039;id&#039; =&amp;gt; $course-&amp;gt;id));&lt;br /&gt;
     $reportnav-&amp;gt;add(get_string(&#039;Synopsis&#039;, &#039;coursereport_synopsis&#039;), $url);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A mod.php file must be included. This is responsible for creating the HTML fragment that will appear on the course report page as one of the report options. This can be anything. Typically, it will simply generate a link to another page in the report folder (usually index.php) that produces the report. It may, like the logs report generate a form to be completed.&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Allegre_Guillaume&amp;diff=20483</id>
		<title>User:Allegre Guillaume</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Allegre_Guillaume&amp;diff=20483"/>
		<updated>2008-05-22T14:14:24Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: first english version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
I use Moodle in a professional context : I am co-leader of [http://www.silecs.info SILECS],&lt;br /&gt;
a small free software IT service company based in Grenoble, France. &lt;br /&gt;
We propose to our customers Moodle installation, customization and support.&lt;br /&gt;
&lt;br /&gt;
For the documentation effort, I try to participate in the french documentation, by &lt;br /&gt;
updating obsolete translations and beginning new ones.&lt;br /&gt;
I also have already added small details to the english documentation.&lt;br /&gt;
&lt;br /&gt;
[https://docs.moodle.org/fr/index.php?title=Utilisateur:Allegre_Guillaume French version of my homepage]&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:Repository_API&amp;diff=27261</id>
		<title>Talk:Repository API</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:Repository_API&amp;diff=27261"/>
		<updated>2008-03-05T23:04:17Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: /* Editing Repository Files / Version Control ? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(Ideas will be deleted from the comments section as they are resolved or merged into the main spec)&lt;br /&gt;
&lt;br /&gt;
===Missing concept of trusted files===&lt;br /&gt;
Files are not created equal, some of them are to be trusted, some can not be trusted at all. Web browsers trust everything received from the server, files from server may access cookie information and thus scripting technologies may allow them to do anything user can do. We do have to trust our teachers because they are supposed to create the learning content, but we definitely can not trust all students.&lt;br /&gt;
&lt;br /&gt;
Imagine if students were allowed to upload arbitrary files to server, like html file loaded with javascript and the server would happily serve them to all Moodle users. Our solution is to use html cleaning filters for submitted texts and force downloads of student uploaded files. To do this we must know if we trust the files or not. Unfortunately the forced downloads of student uploaded files and cleaning of html texts does not solve all problems, because bugs in browsers and especially browser plug-ins may sometimes be used to work around our protections.&lt;br /&gt;
&lt;br /&gt;
The best solution would be to use separate web addresses for trusted and not trusted files (two wwwroots in config.php), not all sites may afford two different addresses but we should be imo prepared for this.  [[User:Skodak|Skodak]] 16:42, 28 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
 Great idea, yes.  In fact couldn&#039;t all the files be served via $CFG-&amp;gt;fileroot all the time?  &lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
userid field could be used for this, but separate flag might be better in order to allow teachers to upload untrusted files (teacher uploads assignment submission for the student).&lt;br /&gt;
&lt;br /&gt;
===Relative file links===&lt;br /&gt;
Flash, Java and SCORM require relative links and directory hierarchy in general - we must support it. Some SCORM packages load hundreds of files per page which means the file serving must be very fast with minimum of db access.&lt;br /&gt;
&lt;br /&gt;
Reading the proposal above it seems the API is about serving of isolated files referenced by repository ids. HTML requires to use relative or absolute locators with file names, we can not use repository ids directly in relative links. In case of scorm we have absolute path to base of SCORM package of given activity and SCORM files use relative links inside the package.&lt;br /&gt;
Solution could be to store relative paths directly in filename field ex:directory1/directory2/filename.ext.&lt;br /&gt;
&lt;br /&gt;
 Yes I agree, we definitely need to support (virtual) directories and slasharguments.&lt;br /&gt;
 We could just match the file argument to a path in the db.  Perhaps add the fileid &lt;br /&gt;
 to the argument path as a primary key: fileid/directory1/directory2/filename.ext&lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Virtual directories and files===&lt;br /&gt;
Sometimes the content of files is generated on the fly (csv exports, etc.), there are many special files spread through codebase doing nearly the same, it should be imho possible to use the same file API for these.&lt;br /&gt;
&lt;br /&gt;
Another virtual example is assignment submissions and webdav. I would like to see an option to browse the assignment submissions as directory structure, the top directory would be a list of names of users, inside html files with online assignment and uploaded files. This would allow us to implement simple zip&amp;amp;go or webdav based offline grading solutions. The problem here is that the content of this virtual submissions directly needs to be created on the fly based on user references, the proposed repository structure can not be used for this.&lt;br /&gt;
&lt;br /&gt;
 Very interesting idea! [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Backup/restore relinking===&lt;br /&gt;
We are supporting relinking inside courses only. Till now it was easy to guess if absolute link will work after restore on another server.&lt;br /&gt;
There are several types of files:&lt;br /&gt;
*course files - relinked during restore, works on any server if from the same course&lt;br /&gt;
*module files - not relinked, urls are not permanent, link can not be copypasted (assignments, forum attachments, rss files, etc.)&lt;br /&gt;
*user files - not relinked, links work only on original server (blog attachments, personal files, etc.)&lt;br /&gt;
&lt;br /&gt;
 I think all this will be simplified in the proposed system because everything is &lt;br /&gt;
 represented using the same system: a file with an ACL (backup can quickly &lt;br /&gt;
 determine all the files in one course, probably using one SQL query). &lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Access needed for both file and its instances===&lt;br /&gt;
We need two types of access control - first who can create instances (link files), second who can access the instance (download the file).&lt;br /&gt;
&lt;br /&gt;
 For the first don&#039;t we already have those capabilities? (like mod/forum:createattachment,&lt;br /&gt;
 moodle/course:managefiles) but they probably could use rationalising.   We&#039;ll need new &lt;br /&gt;
 ones per repository, too, of course.  &lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Cache lifetime===&lt;br /&gt;
There should be a way to specify cache filetime for each instance of file. For example 0 for uploaded assignments, 1 day for resource file. It might be better to allow modules to decide about this, at present it is hardcoded in file.php.&lt;br /&gt;
&lt;br /&gt;
 Great idea.  [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
== Hierarchy in tables ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible that I don&#039;t undertand a key piece of the concept, but I wonder why there is no reference to any &amp;quot;parent id&amp;quot; in the file or file_instance table ?&lt;br /&gt;
In other words, how the hierarchical structure is supposed to be &amp;quot;imported&amp;quot; from repository to Moodle ?&lt;br /&gt;
If the hierarchy is reserved to the course context, and not to the repository context, it seems difficult to allow students to access&lt;br /&gt;
to a complete directory, for example.&lt;br /&gt;
&lt;br /&gt;
On the other hand, maybe it&#039;s only a question for the &amp;quot;local&amp;quot; repository type, and not to the &amp;quot;generic&amp;quot; repository API ?&lt;br /&gt;
[[User:Allegre Guillaume|Allegre Guillaume]] 16:43, 5 March 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
== Editing Repository Files / Version Control ? ==&lt;br /&gt;
&lt;br /&gt;
How do you imagine to handle the &amp;quot;editing file&amp;quot; problem ? &lt;br /&gt;
I can see several solutions :&lt;br /&gt;
# the simplest way : write access to a file really allows to edit (re-upload) the file, each instance being modified&lt;br /&gt;
# the &amp;quot;cheap copy&amp;quot; way : optionally, the modification is applied only to new file_instances (or those for which the teacher forces to). Here you have to handle two (then maybe more) revisions of this file.&lt;br /&gt;
This triggers the file revisions (or version control) question.&lt;br /&gt;
&lt;br /&gt;
A related question is about versionned files : &lt;br /&gt;
should it depend only upon the repository layer (for example, a plugin could implement a SVN &amp;quot;repository&amp;quot;) ?&lt;br /&gt;
Or should Moodle be aware of the file &amp;quot;revision number&amp;quot; ? &lt;br /&gt;
[[User:Allegre Guillaume|Allegre Guillaume]] 17:00, 5 March 2008 (CST)&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:Repository_API&amp;diff=27260</id>
		<title>Talk:Repository API</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:Repository_API&amp;diff=27260"/>
		<updated>2008-03-05T23:00:50Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: Editing Repository Files / Version Control ?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(Ideas will be deleted from the comments section as they are resolved or merged into the main spec)&lt;br /&gt;
&lt;br /&gt;
===Missing concept of trusted files===&lt;br /&gt;
Files are not created equal, some of them are to be trusted, some can not be trusted at all. Web browsers trust everything received from the server, files from server may access cookie information and thus scripting technologies may allow them to do anything user can do. We do have to trust our teachers because they are supposed to create the learning content, but we definitely can not trust all students.&lt;br /&gt;
&lt;br /&gt;
Imagine if students were allowed to upload arbitrary files to server, like html file loaded with javascript and the server would happily serve them to all Moodle users. Our solution is to use html cleaning filters for submitted texts and force downloads of student uploaded files. To do this we must know if we trust the files or not. Unfortunately the forced downloads of student uploaded files and cleaning of html texts does not solve all problems, because bugs in browsers and especially browser plug-ins may sometimes be used to work around our protections.&lt;br /&gt;
&lt;br /&gt;
The best solution would be to use separate web addresses for trusted and not trusted files (two wwwroots in config.php), not all sites may afford two different addresses but we should be imo prepared for this.  [[User:Skodak|Skodak]] 16:42, 28 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
 Great idea, yes.  In fact couldn&#039;t all the files be served via $CFG-&amp;gt;fileroot all the time?  &lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
userid field could be used for this, but separate flag might be better in order to allow teachers to upload untrusted files (teacher uploads assignment submission for the student).&lt;br /&gt;
&lt;br /&gt;
===Relative file links===&lt;br /&gt;
Flash, Java and SCORM require relative links and directory hierarchy in general - we must support it. Some SCORM packages load hundreds of files per page which means the file serving must be very fast with minimum of db access.&lt;br /&gt;
&lt;br /&gt;
Reading the proposal above it seems the API is about serving of isolated files referenced by repository ids. HTML requires to use relative or absolute locators with file names, we can not use repository ids directly in relative links. In case of scorm we have absolute path to base of SCORM package of given activity and SCORM files use relative links inside the package.&lt;br /&gt;
Solution could be to store relative paths directly in filename field ex:directory1/directory2/filename.ext.&lt;br /&gt;
&lt;br /&gt;
 Yes I agree, we definitely need to support (virtual) directories and slasharguments.&lt;br /&gt;
 We could just match the file argument to a path in the db.  Perhaps add the fileid &lt;br /&gt;
 to the argument path as a primary key: fileid/directory1/directory2/filename.ext&lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Virtual directories and files===&lt;br /&gt;
Sometimes the content of files is generated on the fly (csv exports, etc.), there are many special files spread through codebase doing nearly the same, it should be imho possible to use the same file API for these.&lt;br /&gt;
&lt;br /&gt;
Another virtual example is assignment submissions and webdav. I would like to see an option to browse the assignment submissions as directory structure, the top directory would be a list of names of users, inside html files with online assignment and uploaded files. This would allow us to implement simple zip&amp;amp;go or webdav based offline grading solutions. The problem here is that the content of this virtual submissions directly needs to be created on the fly based on user references, the proposed repository structure can not be used for this.&lt;br /&gt;
&lt;br /&gt;
 Very interesting idea! [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Backup/restore relinking===&lt;br /&gt;
We are supporting relinking inside courses only. Till now it was easy to guess if absolute link will work after restore on another server.&lt;br /&gt;
There are several types of files:&lt;br /&gt;
*course files - relinked during restore, works on any server if from the same course&lt;br /&gt;
*module files - not relinked, urls are not permanent, link can not be copypasted (assignments, forum attachments, rss files, etc.)&lt;br /&gt;
*user files - not relinked, links work only on original server (blog attachments, personal files, etc.)&lt;br /&gt;
&lt;br /&gt;
 I think all this will be simplified in the proposed system because everything is &lt;br /&gt;
 represented using the same system: a file with an ACL (backup can quickly &lt;br /&gt;
 determine all the files in one course, probably using one SQL query). &lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Access needed for both file and its instances===&lt;br /&gt;
We need two types of access control - first who can create instances (link files), second who can access the instance (download the file).&lt;br /&gt;
&lt;br /&gt;
 For the first don&#039;t we already have those capabilities? (like mod/forum:createattachment,&lt;br /&gt;
 moodle/course:managefiles) but they probably could use rationalising.   We&#039;ll need new &lt;br /&gt;
 ones per repository, too, of course.  &lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Cache lifetime===&lt;br /&gt;
There should be a way to specify cache filetime for each instance of file. For example 0 for uploaded assignments, 1 day for resource file. It might be better to allow modules to decide about this, at present it is hardcoded in file.php.&lt;br /&gt;
&lt;br /&gt;
 Great idea.  [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
== Hierarchy in tables ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible that I don&#039;t undertand a key piece of the concept, but I wonder why there is no reference to any &amp;quot;parent id&amp;quot; in the file or file_instance table ?&lt;br /&gt;
In other words, how the hierarchical structure is supposed to be &amp;quot;imported&amp;quot; from repository to Moodle ?&lt;br /&gt;
If the hierarchy is reserved to the course context, and not to the repository context, it seems difficult to allow students to access&lt;br /&gt;
to a complete directory, for example.&lt;br /&gt;
&lt;br /&gt;
On the other hand, maybe it&#039;s only a question for the &amp;quot;local&amp;quot; repository type, and not to the &amp;quot;generic&amp;quot; repository API ?&lt;br /&gt;
[[User:Allegre Guillaume|Allegre Guillaume]] 16:43, 5 March 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
== Editing Repository Files / Version Control ? ==&lt;br /&gt;
&lt;br /&gt;
How do you imagine to handle the &amp;quot;editing file&amp;quot; problem ? &lt;br /&gt;
I can see several solutions :&lt;br /&gt;
# the simplest way : write access to a file really allows to edit (re-upload) the file, each instance being modified&lt;br /&gt;
# the &amp;quot;cheap copy&amp;quot; way : optionally, the modification is applied only to new file_instances (or those for which the teacher forces to).&lt;br /&gt;
This triggers the file revisions (or version control) question.&lt;br /&gt;
&lt;br /&gt;
A related question is about versionned files : &lt;br /&gt;
should it depend only upon the repository layer (for example, a plugin could implement a SVN &amp;quot;repository&amp;quot;) ?&lt;br /&gt;
Or should Moodle be aware of the file &amp;quot;revision number&amp;quot; ? &lt;br /&gt;
[[User:Allegre Guillaume|Allegre Guillaume]] 17:00, 5 March 2008 (CST)&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:Repository_API&amp;diff=27259</id>
		<title>Talk:Repository API</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:Repository_API&amp;diff=27259"/>
		<updated>2008-03-05T22:43:01Z</updated>

		<summary type="html">&lt;p&gt;Gallegre: Hierarchy in tables ?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(Ideas will be deleted from the comments section as they are resolved or merged into the main spec)&lt;br /&gt;
&lt;br /&gt;
===Missing concept of trusted files===&lt;br /&gt;
Files are not created equal, some of them are to be trusted, some can not be trusted at all. Web browsers trust everything received from the server, files from server may access cookie information and thus scripting technologies may allow them to do anything user can do. We do have to trust our teachers because they are supposed to create the learning content, but we definitely can not trust all students.&lt;br /&gt;
&lt;br /&gt;
Imagine if students were allowed to upload arbitrary files to server, like html file loaded with javascript and the server would happily serve them to all Moodle users. Our solution is to use html cleaning filters for submitted texts and force downloads of student uploaded files. To do this we must know if we trust the files or not. Unfortunately the forced downloads of student uploaded files and cleaning of html texts does not solve all problems, because bugs in browsers and especially browser plug-ins may sometimes be used to work around our protections.&lt;br /&gt;
&lt;br /&gt;
The best solution would be to use separate web addresses for trusted and not trusted files (two wwwroots in config.php), not all sites may afford two different addresses but we should be imo prepared for this.  [[User:Skodak|Skodak]] 16:42, 28 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
 Great idea, yes.  In fact couldn&#039;t all the files be served via $CFG-&amp;gt;fileroot all the time?  &lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
userid field could be used for this, but separate flag might be better in order to allow teachers to upload untrusted files (teacher uploads assignment submission for the student).&lt;br /&gt;
&lt;br /&gt;
===Relative file links===&lt;br /&gt;
Flash, Java and SCORM require relative links and directory hierarchy in general - we must support it. Some SCORM packages load hundreds of files per page which means the file serving must be very fast with minimum of db access.&lt;br /&gt;
&lt;br /&gt;
Reading the proposal above it seems the API is about serving of isolated files referenced by repository ids. HTML requires to use relative or absolute locators with file names, we can not use repository ids directly in relative links. In case of scorm we have absolute path to base of SCORM package of given activity and SCORM files use relative links inside the package.&lt;br /&gt;
Solution could be to store relative paths directly in filename field ex:directory1/directory2/filename.ext.&lt;br /&gt;
&lt;br /&gt;
 Yes I agree, we definitely need to support (virtual) directories and slasharguments.&lt;br /&gt;
 We could just match the file argument to a path in the db.  Perhaps add the fileid &lt;br /&gt;
 to the argument path as a primary key: fileid/directory1/directory2/filename.ext&lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Virtual directories and files===&lt;br /&gt;
Sometimes the content of files is generated on the fly (csv exports, etc.), there are many special files spread through codebase doing nearly the same, it should be imho possible to use the same file API for these.&lt;br /&gt;
&lt;br /&gt;
Another virtual example is assignment submissions and webdav. I would like to see an option to browse the assignment submissions as directory structure, the top directory would be a list of names of users, inside html files with online assignment and uploaded files. This would allow us to implement simple zip&amp;amp;go or webdav based offline grading solutions. The problem here is that the content of this virtual submissions directly needs to be created on the fly based on user references, the proposed repository structure can not be used for this.&lt;br /&gt;
&lt;br /&gt;
 Very interesting idea! [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Backup/restore relinking===&lt;br /&gt;
We are supporting relinking inside courses only. Till now it was easy to guess if absolute link will work after restore on another server.&lt;br /&gt;
There are several types of files:&lt;br /&gt;
*course files - relinked during restore, works on any server if from the same course&lt;br /&gt;
*module files - not relinked, urls are not permanent, link can not be copypasted (assignments, forum attachments, rss files, etc.)&lt;br /&gt;
*user files - not relinked, links work only on original server (blog attachments, personal files, etc.)&lt;br /&gt;
&lt;br /&gt;
 I think all this will be simplified in the proposed system because everything is &lt;br /&gt;
 represented using the same system: a file with an ACL (backup can quickly &lt;br /&gt;
 determine all the files in one course, probably using one SQL query). &lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Access needed for both file and its instances===&lt;br /&gt;
We need two types of access control - first who can create instances (link files), second who can access the instance (download the file).&lt;br /&gt;
&lt;br /&gt;
 For the first don&#039;t we already have those capabilities? (like mod/forum:createattachment,&lt;br /&gt;
 moodle/course:managefiles) but they probably could use rationalising.   We&#039;ll need new &lt;br /&gt;
 ones per repository, too, of course.  &lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
===Cache lifetime===&lt;br /&gt;
There should be a way to specify cache filetime for each instance of file. For example 0 for uploaded assignments, 1 day for resource file. It might be better to allow modules to decide about this, at present it is hardcoded in file.php.&lt;br /&gt;
&lt;br /&gt;
 Great idea.  [[User:Martin Dougiamas|Martin Dougiamas]] 07:08, 29 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
== Hierarchy in tables ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible that I don&#039;t undertand a key piece of the concept, but I wonder why there is no reference to any &amp;quot;parent id&amp;quot; in the file or file_instance table ?&lt;br /&gt;
In other words, how the hierarchical structure is supposed to be &amp;quot;imported&amp;quot; from repository to Moodle ?&lt;br /&gt;
If the hierarchy is reserved to the course context, and not to the repository context, it seems difficult to allow students to access&lt;br /&gt;
to a complete directory, for example.&lt;br /&gt;
&lt;br /&gt;
On the other hand, maybe it&#039;s only a question for the &amp;quot;local&amp;quot; repository type, and not to the &amp;quot;generic&amp;quot; repository API ?&lt;br /&gt;
[[User:Allegre Guillaume|Allegre Guillaume]] 16:43, 5 March 2008 (CST)&lt;/div&gt;</summary>
		<author><name>Gallegre</name></author>
	</entry>
</feed>