devilry_gradingsystem
— The devilry grading system plugin architecture¶
How we configure the grading system on an assignment¶
1 - Select a grading system plugin.¶
User selects one of the plugins in the devilry.devilry_gradingsystem.pluginregistry.gradingsystempluginregistry
.
2 - Configure the grading system plugin¶
User configures the grading system using the view pointed to by
devilry.devilry_gradingsystem.pluginregistry.GradingSystemPluginInterface.get_configuration_url()
.
Note
This step is skipped unless the plugin has set
requires_configuration
to True
3 - Configure the maximum number of points possible¶
User sets the maximum number of points possible.
Note
Plugins can opt out of this step by setting
sets_max_points_automatically
to True
4 - Choose how students are graded¶
- The user selects one of the possible values for
devilry.apps.core.models.Assignment.points_to_grade_mapper
): - Passed failed
- Raw points
- Custom table
5 - Configure the points to grade mapping table (only if custom-table
)¶
If the user selected custom-table
, they need to setup that table.
6 - Configure required points to pass¶
The user selects the number of points required to pass the assignment
(devilry.apps.core.models.Assignment.passing_grade_min_points
).
How they do this depends on the points_to_grade_mapper
:
- If
raw-points
orpassed-failed
: Select a number of points between0
andmax_points
, including both ends. - If custom table: Select a grade from the table.
Note
Plugins can opt out of this step by setting sets_passing_grade_min_points_automatically
)
Creating a Plugin¶
A grading system plugin must implement the
devilry.devilry_gradingsystem.pluginregistry.GradingSystemPluginInterface
, and
it must register the implemented class with
devilry.devilry_gradingsystem.pluginregistry.gradingsystempluginregistry
.
Please refer to one of the simple grading system plugins, such as
devilry_gradingsystemplugin_points
, for a starting point for implementing
your own plugin.
API¶
-
class
devilry.devilry_gradingsystem.pluginregistry.
GradingSystemPluginInterface
(assignment)¶ Bases:
object
Interface for new grading system plugins. Makes the grading system plugin ready for the global registry.
This interface must be implemented by each grade plugin in the running system. this holds all the global information necessary to be able to manage the grade plugin layout and to cover smooth transition between different grade plugins on different Assignments
-
id
= None¶ The ID of the registry. Should be a unique string, typically the python path of the module implementing the plugin. This attribute MUST be overidden by each plugin.
-
title
= None¶ The title of the plugin. Should be a short title, and it should be translated.
-
description
= None¶ The description of the plugin. Should be translated. Shown with css
white-space -- pre-wrap
.
-
requires_configuration
= False¶ True
if the plugin require configuration before it can be used. If a plugin sets this toTrue
,is_configured_correctly()
andget_configuration_url()
must be overridden.
-
sets_passing_grade_min_points_automatically
= False¶ True
if the plugin setsdevilry.apps.core.models.Assignment.passing_grade_min_points
automatically. If this isTrue
, the plugin must implementget_passing_grade_min_points()
.
-
sets_max_points_automatically
= False¶ True
if the plugin setsdevilry.apps.core.models.Assignment.max_points
automatically. If this isTrue
, the plugin must implementget_max_points()
.
-
get_passing_grade_min_points
()¶ Get the value for
devilry.apps.core.models.Assignment.passing_grade_min_points
for this assignment.MUST be implemented when
sets_passing_grade_min_points_automatically
isTrue
.
-
get_max_points
()¶ Get the value for
devilry.apps.core.models.Assignment.max_points
for this assignment.MUST be implemented when
sets_max_points_automatically
isTrue
.
-
is_configured
()¶ Is the plugins configured in a manner that makes it ready for use on this assignment.
MUST be implemented if
requires_configuration
isTrue
.
-
get_configuration_url
()¶ Get the configuration URL for this plugin for this assignment.
MUST be implemented if
requires_configuration
isTrue
.
-
get_edit_feedback_url
(deliveryid)¶ Get the feedback editing URL for this plugin for the given
deliveryid
.Parameters: deliveryid – The ID of the delivery to provide feedback for.
-
get_bulkedit_feedback_url
(assignmentid)¶ Get the feedback editing URL for this plugin for the given
assignmentid
.Parameters: assignmentid – The ID of the delivery to provide feedback for.
-
-
exception
devilry.devilry_gradingsystem.pluginregistry.
GradingSystemPluginNotInRegistryError
¶ Bases:
Exception
Raised by
GradingSystemPluginRegistry.get()
when a plugin that is not in the registry is requested.
-
exception
devilry.devilry_gradingsystem.pluginregistry.
NotGradingSystemPluginError
¶ Bases:
Exception
Raised by
GradingSystemPluginRegistry.add()
when adding a plugin that is not a subclass ofGradingSystemPluginInterface
.
-
class
devilry.devilry_gradingsystem.pluginregistry.
GradingSystemPluginRegistry
¶ Bases:
object
Global Registry for grading system plugins.
This registry holds information on each grading system plugin the current setup uses.
The registry is used to decouple providing points for grades from the rest of the grading framework.
-
add
(registryitemcls)¶ Add a plugin to the registry.
Parameters: registryitemcls – A subclass of GradingSystemPluginInterface
.Raises: NotGradingSystemPluginError – If registryitemcls
is not a subclass ofGradingSystemPluginInterface
.
-
get
(id)¶ Get a grading plugin API class by its ID.
Raises: GradingSystemPluginNotInRegistryError – If the plugin is not found in the registry.
-
iter_with_assignment
(assignment)¶ Returns an iterator over instances of all the plugins in the registry. Each instance is constructed with the given
assignment
as their first and only argument.
-
-
devilry.devilry_gradingsystem.pluginregistry.
gradingsystempluginregistry
= <devilry.devilry_gradingsystem.pluginregistry.GradingSystemPluginRegistry object>¶ The grading system plugin registry. An instance of
GradingSystemPluginRegistry
. Plugins register themselves through this instance.