Automated Grade Exports
DRAFT
Automated Grade Exports
Gradebook2 internally uses a REST call to trigger final grade submissions. Since the client is somewhat tightly coupled to the server session that produces it, some assumptions are made downstream of the REST point about the availability of a current Sakai state: current tool, current site, current user, etc.
This provides the beneficial side-effect of securing the server process, albeit by 'tossing cookies' as a security tactic. This should be better 'decoupled' to allow for automated access to the REST point with, for example, a tool like wget or curl.
This page entry will begin by describing what code and configuration changes are necessary to allow for automated exporting of gradebooks via a REST call for gradebook2 1.2.x and 1.3.x. You should find appropriate sample patches attached.
About the patch files
1.2.x patch
OSIV Filter
Designed for GB2 v.1.2.0, this patch includes a mod. to the web.xml file to add a filter definition and application which implements an OpenSessionInView (OSIV) pattern for hibernate session to mitigate lazy loading issues. This is not likely needed unless you are using UCDavis' Coursemanagement Implementation, a derivative, or a similar lazy loading design. The export process triggers CourseManagement Service API calls.
If you do not need the OSIV filter, remove all the lines of the patch file related to web.xml,starting with 'Index: war/WEB-INF/web.xml' and removing all lines leading to, but not including, the next line that begins with 'Index:'.
Grade property name
Starting with GB2 v.1.3.0, all submitted grades are first saved as ActionRecord properties. This patch includes a back-port of that functionality.
It's recommended that you choose an appropriate property name to will identify the process that triggered the grade submission and to differentiate among multiple runs.
To change the name edit the patch file and search for 'Grade120' and replace it with the label that you want.
Take care with the naming of this property as it will be used as a virtual column name in the attached SQL script designed to make comparisons across multiple runs
For example, you may have trouble with some databases if the name starts with a number or contains dots and/or underscores