SAK-26602 Refactor slightly so that the implementation works with both 10.x and trunk APIs

git-svn-id: https://source.sakaiproject.org/contrib/turnitin/trunk@86811 fdecad78-55fc-0310-b1b2-d7d25cf747c9