Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Assign feedback plugins: Difference between revisions

From MoodleDocs
(Created page with "== Introduction == This page gives an overview of assignment feedback plugins. === Overview of an assignment feedback plugin === <gallery> </gallery> == History == Assignment...")
 
No edit summary
Line 3: Line 3:


=== Overview of an assignment feedback plugin ===
=== Overview of an assignment feedback plugin ===
An assignment feedback plugin can do many things including providing feedback to students about a submission. The grading interface for the assignment module provides many hooks that allow plugins to add their own entries and participate in the grading workflow.


<gallery>
<gallery>
Line 12: Line 13:


== Template ==
== Template ==
A great example is the "file" feedback plugin included with Moodle core.  
A good example is the "file" feedback plugin included with core because it uses most of the features of feedback plugins.  


== File structure ==
== File structure ==
The files for a custom feedback plugin sit under "mod/assign/feedback/<pluginname>". A plugin should not include any custom files outside of it's own plugin folder.
Note: The plugin name should be no longer than 13 characters - this is because the database tables for a submission plugin must be prefixed with "assignfeedback_" + pluginname (15 chars + X) and the table names can be no longer than 28 chars (thanks oracle). If a plugin requires multiple database tables, the plugin name will need to be shorter to allow different table names to fit under the 28 character limit.
All examples in this document exclude the required copyright and license information from source files for brevity.


=== backup/* ===
 
A plugin may also take part in backup and restore. The required files are not listed here because they are standard and follow the [[Backup_API]].
=== version.php ===
 
To start with we need to tell Moodle the version information for our new plugin so that it can be installed and upgraded correctly. This information is added to version.php as with any other type of Moodle plugin. The component name must begin with "assignfeedback_" to identify this as a feedback plugin.
 
See [[version.php]] for more information.
<pre>
defined('MOODLE_INTERNAL') || die();                                                                                               
                                                                                                                                   
$plugin->version  = 2012112900;                                                                                                   
$plugin->requires  = 2012112900;                                                                                                   
$plugin->component = 'assignfeedback_file';
</pre>

Revision as of 07:47, 22 April 2013

Introduction

This page gives an overview of assignment feedback plugins.

Overview of an assignment feedback plugin

An assignment feedback plugin can do many things including providing feedback to students about a submission. The grading interface for the assignment module provides many hooks that allow plugins to add their own entries and participate in the grading workflow.

History

Assignment feedback plugins were added with the assignment module rewrite for Moodle 2.3.

Template

A good example is the "file" feedback plugin included with core because it uses most of the features of feedback plugins.

File structure

The files for a custom feedback plugin sit under "mod/assign/feedback/<pluginname>". A plugin should not include any custom files outside of it's own plugin folder. Note: The plugin name should be no longer than 13 characters - this is because the database tables for a submission plugin must be prefixed with "assignfeedback_" + pluginname (15 chars + X) and the table names can be no longer than 28 chars (thanks oracle). If a plugin requires multiple database tables, the plugin name will need to be shorter to allow different table names to fit under the 28 character limit. All examples in this document exclude the required copyright and license information from source files for brevity.


version.php

To start with we need to tell Moodle the version information for our new plugin so that it can be installed and upgraded correctly. This information is added to version.php as with any other type of Moodle plugin. The component name must begin with "assignfeedback_" to identify this as a feedback plugin.

See version.php for more information.

defined('MOODLE_INTERNAL') || die();                                                                                                
                                                                                                                                    
$plugin->version   = 2012112900;                                                                                                    
$plugin->requires  = 2012112900;                                                                                                    
$plugin->component = 'assignfeedback_file';