Creating a plugin

Added by Matthew Leingang almost 9 years ago


I have written a perl script to return annotated graded sheets via WebDAV. At the moment it is an altered version of that I run on the command line.

I am interested in converting it to a plugin, so that I can configure and run it through the AMC GUI. But there's very little documentation of the plugin system that I can find. A web search revealed these two examples:

I gather that I need to extend certain modules, but which? And if I need to add fields to the GUI panes, can I do that?

Thanks in advance for any guidance---however broad---you can provide.

Replies (2)

RE: Creating a plugin - Added by Alexis Bienvenüe almost 9 years ago

There are only two kinds of module:
  • Filter modules, to convert an exam from a given format to LaTeX format (such as the plain one, that converts the AMC-TXT source file to a LaTeX file using the automultiplechoice package)
  • Export module, that exports marks to a given format (such as the ods, CSV or List ones, that exports marks to a ODS or CSV sheet file, or builds a PDF list with final grades)
In the GUI, an Export module will be accessible in the Reports tab, within the Marks export frame. You could use this kind of modules for your task, but the user will have to build the annotated answer sheets before going back to the Marks export frame to send them, that can be rather misleading. Unfortunately, there are no 'Send' modules…
If you want to go on this way however, you will have to define the following perl modules (assuming you will name your Export module 'webdav'):
  • AMC::Export::register::webdav, that will define methods to return general information about your module, including fields to be added to the GUI
  • AMC::Export::webdav, that will define methods to actually do the job sending annotated papers via Webdav.

You can have a look at the corresponding files for the CSV Export module to see how it works — unfortunately I did not write documentation about this process.
You can place your two files at ~/.AMC.d/plugins/webdav/perl/AMC/Export/register/ and ~/.AMC.d/plugins/webdav/perl/AMC/Export/ for testing. A 'plugin' that can be used by other users is a zip file containing these two files from the ~/.AMC.d/plugins/ directory point of view.
The right way would be to add a 'Send plugin' capability to AMC…

RE: Creating a plugin - Added by Matthew Leingang almost 9 years ago

Thanks, this is actually very helpful. After my initial post I poked around the source code a little longer and determined that only Filter and Export modules were possible. I agree with you the Export is the better option of the two. I'll keep experimenting, and do keep us posted about Send plugins! :-)