rpwillis / SharePoint-Learning-Kit

15 stars 8 forks source link

IE Compatibility mode still a problem with SLK v1.8.2 #2

Open varunmshetty opened 6 years ago

varunmshetty commented 6 years ago

Hi,

I upgraded my environment to the latest SLK version 1.8.2 yesterday from 1.3.1. However, from my tests I find the IE compatibility mode is still causing me problems. I have to add my site to the compatibility list for the module to load on IE browsers. Is it just me? Am I doing something wrong? If anyone has any inputs, please let me know.

Thanks, Varun

rpwillis commented 6 years ago

I think I did some work around SLK compatibility mode for the 1.8 release but I can't remember what it was. It's not something I've looked at in a while.

varunmshetty commented 6 years ago

Thanks for your response Richard.

I observe the issue is only with IE 11. IE 10 works well. On a similar note, we have been using a custom solution wherein we are using the API to create assignments. The implementation is as shown here:

if (learnerAssignmentGuidId == Guid.Empty) { AssignmentProperties properties = slkStore.GetNewAssignmentDefaultProperties(SPContext.Current.Web, Location, OrganizationIndex, SlkRole.Learner, out packageWarnings);

AssignmentItemIdentifier assignmentId = slkStore.CreateAssignment(SPContext.Current.Web, Location, OrganizationIndex, SlkRole.Learner, properties);

learnerAssignmentGuidId = slkStore.GetCurrentUserLearnerAssignment(assignmentId);

//start attempt AttemptItemIdentifier attemptId = slkStore.StartAttemptOnLearnerAssignment(learnerAssignmentGuidId);

executionType = AssignmentView.Execute; }

However, with v1.8.2, the GetNewAssignmentDefaultProperties() method is no longer available. CreateAssignment() doesn't take 5 arguments.

Do you have any suggestions as to how I can implement this function with the latest binaries?

I have managed to tweak the previous implementation in the following area:

  1. LearningStoreHelper class isn't available. Hence doing an explicit conversion.
  2. Replaced the following: a. slkStore.GetCurrentUserId(); with slkStore.CurrentUserId; b. slkStore.GetAssignmentProperties(id, SlkRole.Learner); with slkStore.LoadAssignmentProperties(id, SlkRole.Learner); c. slkStore.GetCurrentUserLearnerAssignment(id); with slkStore.xGetCurrentUserLearnerAssignment(id);

Please let me know your thoughts.

Thanks, Varun

rpwillis commented 6 years ago

Have a look at AssignmentProperties.aspx.cs to see how it works now. At one point it's doing

AssignmentProperties = AssignmentProperties.CreateNewAssignmentObject(SlkStore, SPWeb, SlkRole.Instructor); AssignmentProperties.SetLocation(Location, OrgIndex, Request.QueryString["title"]);

varunmshetty commented 6 years ago

Thanks for the pointer Richard! It worked. This is how my final implementation looks:

========================= AssignmentProperties properties1 = AssignmentProperties.CreateNewAssignmentObject(slkStore, SPContext.Current.Web, SlkRole.Learner); properties1.Title = ModuleTitle; properties1.SetLocation(Location1, OrganizationIndex, ModuleTitle);

AssignmentItemIdentifier assignmentId1 = slkStore.CreateAssignment(properties1); learnerAssignmentGuidId = slkStore.xGetCurrentUserLearnerAssignment(assignmentId1);

AttemptItemIdentifier attemptId1 = slkStore.StartAttemptOnLearnerAssignment(learnerAssignmentGuidId); executionType = AssignmentView.Execute;

Still trying to figure out the original issue (need of compatibility view for IE11) as I am still forced to add my website to the compatible list for the modules to render. Any help on this would be greatly appreciated!