Gradebook
GradeBookSDK? Tips
1. Improving the performance using bulk methods
Often when developers think of update grades or retrieve grades, they think of processing records one at a time.
It's of course true that we have to process records one at time, However, it may not be the best practice when we deal with web service calls. Each web service call associates with overheads like translating method call to SOAP, set up network connection, and process SOAP on the server end. When we are updating hundreds of records, the overhead could cumulate and impact the performance .
To reduce the overhead, we could consider using bulk processing methods provided by GradeBookSDK?. For instance, GradeBookSDK?.setMemberValues() method can be used to set multiple column values for multiple users at once. Eg:
One good thing about the setMemberValues() method is that it's not limited to one function call per student, or per column. Since memberAttrValueVO object contains the memberId and columnId information, the memberAttrValueVO[] can hold the grade info from any column for any user. So if we have 100 students in a course and each has 3 column values to update, we can create a memberAttrValueVO[] of 300 elements and update all values in one single web service call. This way, we limit the web service overhead by reducing the number web service calls.
There are a lot of bulk processing methods in GradeBookSDK? that could be used improve the performance. They are:
| Method name |
Purpose |
| getAllMemberAttrValues(session, sectionId, sectionColumnId) |
Retrieve the grade info from given column for all students in the section |
| getMemberAttrValues(session, sectionId, memberIds, sectionColumnId) |
Retrieve the grade info from given column for all students given in the memberIds array |
| getMemberGradeValues(session, sectionId, memberId, sectionColumnIds) |
Retrieve the grade info from columns given in sectionColumnIds for one given student |
| setMemberValues(session, sectionId, memberValues) |
Set all grade info defined in the memberValues array |
Keep in mind that there could be performance bottlenecks for transferring large array list over web services, but we don't expect big problems with a few hundred grades.