MDL-18229 gradebook: Fix for loading activities.

Was using local variable iteminstance rather than cmid.