[Building Sakai] [Using Sakai] Gradebook database relations

Mark J. Norton markjnorton at earthlink.net
Mon Sep 3 05:51:11 PDT 2012


There isn't much more to the code than the algorithm I providing in my 
previous message.  The actual code is proprietary.  Probably the hardest 
part is getting the GradebookService, which lives in the edu-services 
component.

Coding directly to the Sakai database tables is strongly discouraged.  
The whole point of creating a service with a published API is to avoid 
access to the underlying storage mechanism, which may change at any 
point in the future.  For example, grading information (in theory) could 
be stored in a Jackrabbit database, which is not relational.  Likely 
this doesn't matter since you are developing an application for your 
university rather than targeting many.

- Mark Norton

On 9/2/2012 11:15 PM, Gregory Guthrie wrote:
> Mark, thanks - is your code available to see what it does, and how?
>
> Actually I should have been clearer that I am trying to just do a direct database query for the data, to avoid for now having to learn all the innards of the Java APIs and development environment.
>
> I will post this to the Sakai-dev forum and move any follow-ups to there; thanks.
>
> I navigated around from GB_GRADEBOOK_T and could find gradable_objects and GB_Category's, but couldn't find the link from a course to the GRADEBOOK_UID to start the chain of graded entities.
>
> I suppose I could go from course -> Students and correlate them with GB_GRADING_EVENT_T's, but that seems circumspect.
>
> -------------------------------------------
>> Can anyone give me a quick hint on how to find a gradebook associated with a course, and then
>> the graded items in the gradebook?
>> I found many of the key relations, but could not yet connect to a course.
>>
>> I am trying to replicate the "assignments/grade report/download spreadsheet" data by a
>> database query.
>>
>> Is there a query in the source code somewhere I should look at for this?
>>> -------------------------------------------
>>> As it happens, I just did this very thing.
>>   1. Get an instance of the GradebookService either via injection or
>>      using the ComponentManager.
>>   2. GradebookService.getViewableAssignmentsForCurrentUser(String
>>      gradebookUid) gets a list of Assignments.
>>   3. For each assignment:
>>       1. Assignment.getName();
>>       2. Assignment.getId();
>>       3. GradebookService.getAssignmentScoreString(courseId,
>>          assignmentId, userId);
>>
>



More information about the sakai-dev mailing list