SLK Integration & API?

Topics: Developer Forum
Apr 27, 2009 at 12:56 PM
Hi Guys,

I am trying to asscertain the options I have for integrating an application I am developing with SLK.
With regards to this is there any documentation or samples or user samples of use the SLK API?

Functionaltiy I would like to integrate with is
1. Create an Assignment and add users
2. Launch an assignment
3. Retrieve assignment results for a user.

I have tried to take a stab at implementing 1. however when I call 

    slkStore.CreateAssignment(web, documentUrl

, null, SlkRole.Learner, new AssignmentProperties());

I get an access denied exception.  The user under whom the code is being executed is a SLK Instructor.
Is there any advise as to what pre-requisites need to be set, or anything I am missing for this call to suceed?

Appreciate your commetns.

Thanks
Tariq

Coordinator
Apr 30, 2009 at 4:00 PM
Hi Tariq,

What sort of application is this in. It will need access to the SLK database.

Regards,
Richard
SLK Co-ordinator
http://blog.salamandersoft.co.uk
May 5, 2009 at 2:08 PM
Hi Richard,
I did a bit of playing around, have been able to take a few steps forward with the CreateAssignnments functionality using the API (the CreateAssignments.cs sample code was usefull there).

However I am stuck again, but I think this time my question should be something more familiar since I have seen quite a few questions regarding queries on the discussion board.

I wanted to get a list of the assignments that have already been created so I tried to write code to query it.

However the following exception gets thrown back no matter whichever view I call
 View 'AllAssignmentsInstructor' not found in the schema

 

LearningStoreJob job = slkStore.LearningStore.CreateJob();
LearningStoreQuery query = slkStore.LearningStore.CreateQuery("AllAssignmentsInstructor");

Anyone have any thoughts on how to debug. Maybe I am missing somethign really basic.

Thanks in advance for any help,
Tariq

 

May 5, 2009 at 2:11 PM
p.s. 
System.InvalidOperationException: View 'AllAssignmentsInstructor' not found in the schema. at Microsoft.LearningComponents.Storage.LearningStore.CreateQuery(String viewName) at SLKTest.SLKTestWebPart.Query(SPWeb web) at SLKTest.SLKTestWebPart.TestSLK()
Coordinator
May 5, 2009 at 9:43 PM
Hi Tariq,

There doesn't appear to be a AllAssignmentsInstructor view in the schema, which would be why it's failing. If you look at SlkSchema.sql in the source code (just search for *.sql once you've downloaded the source) then search for <View Name=", you'll see what they are called. You're probably looking for something like AssignmentListForInstructors.

Richard
May 6, 2009 at 5:54 AM
Hi Richard,

Thanks for the help.
I was trynig the query names based on the api documentation.
I am guessing the the api documentation is need of an update at this point :)
Again thanks very much for the help

Tariq



"Instructor assignment queries: These queries all return assignments for which the current user is an instructor.
  • ActiveInstructor: Includes assignments for which at least one learner assignment is not in the "final" state (i.e. returned to the learner).
  • ReadyToGradeInstructor: Includes assignments for which at least one learner assignment is in the "completed" state (i.e. ready to grade).
  • OverdueInstructor: Includes assignments that are overdue (i.e. have a due date that's in the past) for which at least one learner assignment is in the "not started" or "active" state. Assignments with no due date are not included.
  • DueTodayInstructor: Includes all assignments due today.
  • DueThisWeekInstructor: Includes all assignments due this week.
  • DueNextWeekInstructor: Includes all assignments due next week.
  • ReturnedInstructor: Includes all assignments for which all learner assignments are in the "final" state.
  • AllAssignmentsInstructor: Includes all assignments.
Coordinator
May 9, 2009 at 10:56 PM

Hi Tariq,

It's probably well behind the releases. Where did you find it?

Richard

Mar 12, 2010 at 1:31 PM

Where is this CreateAssignment.cs file you speak of?  I spent some time going back through the source trying to find where and when it got removed but failed miserably.

Feb 19, 2013 at 9:05 AM
Can anyone please tell me what should be the "documenturl" in the following method:

slkStore.CreateAssignment(web, documentUrl, null, SlkRole.Learner, new AssignmentProperties());

calling slkStore.CreateAssignment raises the following exception:


System.ArgumentException: Incorrect location string syntax Parameter name: packageLocation

Please help me out.
Coordinator
Mar 5, 2013 at 8:22 PM
markwoodlief wrote:
Where is this CreateAssignment.cs file you speak of?  I spent some time going back through the source trying to find where and when it got removed but failed miserably.
It's in slk\samples\createassignments.

It's still there in the latest code.
Coordinator
Mar 5, 2013 at 8:23 PM
talalbsse wrote:
Can anyone please tell me what should be the "documenturl" in the following method:

slkStore.CreateAssignment(web, documentUrl, null, SlkRole.Learner, new AssignmentProperties());

calling slkStore.CreateAssignment raises the following exception:


System.ArgumentException: Incorrect location string syntax Parameter name: packageLocation
It's a SharePointFileLocation

e.g.
        string packageLocation = new SharePointFileLocation(packageWeb, spFile.UniqueId, spFile.UIVersion).ToString();
Mar 5, 2013 at 8:28 PM
welcome back, :)