BWP Review View Implementation Error

Topics: Developer Forum, Project Management Forum, User Forum
Sep 13, 2007 at 11:00 AM
Hello:

I believe I'm very close to fully implementing the Review View for the BasicWebPlayer, however, I'm receiving what I believe is some sort of security or permission error. I'm calling the following constructor of the StoredLearningSession to start a review view of a SCORM package which I have already completed.

public StoredLearningSession(SessionView view, AttemptItemIdentifier attemptId, PackageStore packageStore) : base(view)

When the web player window opens, I'm receiving the following message:

"This training is not available. This may be because the training does not exist, or you do not have permission to view it. "

While debugging the application, I isolated the problem, I believe, to the following lines of code in ProcessPageLoad() method of the FramesetHelper class. Note this is lines 203 - 210.

if (!ProcessViewRequest(SessionView.Review, m_session))
return;

// Access a property. If the user doesn't have permission, this will throw exception
if (m_session.HasCurrentActivity)
{
// This is good. The 'if' statement is here to make compiler happy.
}

I do have event logging turned on, however, I am not receiving anything in the Windows event log, where I normally see errors if they arise in this application.

Do I need to do anything else, either before or after, besides calling the constructor of the StoredLearningSession above that ensures the user can view the training in "Review" mode? I'm not sure why the m_session.HasCurrentActivity will throw an error if the user does not have permission, but that seems to be the problem. Do have have to explicitly set some property(ies) before/after calling the constructor? Could the error be arising from the if(!ProcessViewRequest(...)) call above the call to HasCurrentActivity?

Any help in the right direction would be really appreciated.

Kevin
Sep 13, 2007 at 4:22 PM
I did confirm that a LearningStoredSecurityException is being thrown at:

if(!ProcessViewRequest(SessionView.Review, m_session)
return;

The ProcessViewRequest method resides in Frameset.aspx.cs. I've added the following code to allow Review mode:

case SessionView.Review:
// BWP does not provide review view
/*-------------------------------------------------------------------
* FOLLOWING ADDED TO APPLICATION
* ----------------------------------------------------------------*/
{
StoredLearningSession slsSession = session as StoredLearningSession;
if (slsSession != null)
{
// if the training is not complete, do not allow viewing in review mode
if (slsSession.AttemptStatus == AttemptStatus.Active)
{
RegisterError(ResHelper.GetMessage(FramesetResources.FRM_InvalidAttemptStatusForViewTitle),
ResHelper.GetMessage(FramesetResources.FRM_ReviewViewTrainingNotCompleteMsg), true);
return false;
}
if (slsSession.AttemptStatus == AttemptStatus.Abandoned)
{
RegisterError(ResHelper.GetMessage(FramesetResources.FRM_InvalidAttemptStatusForViewTitle),
ResHelper.GetMessage(FramesetResources.HID_SessionAbandonedTitle), true);
return false;
}
if (slsSession.AttemptStatus == AttemptStatus.Suspended)
{
RegisterError(ResHelper.GetMessage(FramesetResources.FRM_InvalidAttemptStatusForViewTitle),
ResHelper.GetMessage(FramesetResources.HID_SessionSuspendedTitle), true);
return false;
}
}
}
break;

The LearningStoreSecurityException is thrown at the first check of the AttemptStatus. This property check further calls DatabaseNavigator.Status, which in it's getter, calls LoadLearningDataModel(). Could this be throwing the error? If so, why can't the application make this call? I do know that for any Attempt that is set to Complete, they do not have a CurrentActivity. Must an attempt have a current activity to be launched in review mode?

Does the LearningStore db role need additional permissions to allow review mode?
Sep 13, 2007 at 8:04 PM
Edited Sep 13, 2007 at 8:07 PM
Further info:

I now have an error in my Windows Event Log; stack trace is below. As you can see, DatabaseNavigator calls LoadActivityTree(), which in turn runs a LearningStoreJob at job.Execute() - which is where the error is raised. Comments?

Stack Trace:

Exception information:
Exception type: LearningStoreSecurityException
Exception message: Security check failed.

Request information:
Request URL: http://localhost:2551/Frameset/Frameset.aspx?View=2&attemptid=50
Request path: /Frameset/Frameset.aspx
User host address: 127.0.0.1
User: domain\user
Is authenticated: True
Authentication Type: NTLM
Thread account name: domain\user

Thread information:
Thread ID: 4
Thread account name: domain\user
Is impersonating: False
Stack trace: at Microsoft.LearningComponents.Storage.LearningStoreJob.Execute()
at Microsoft.LearningComponents.Storage.DatabaseNavigator.LoadActivityTree()
at Microsoft.LearningComponents.Storage.ReviewNavigator.LoadActivityTree()
at Microsoft.LearningComponents.Storage.ReviewNavigator.LoadLearningDataModel()
at Microsoft.LearningComponents.Storage.DatabaseNavigator.get_PackageFormat()
at Microsoft.LearningComponents.LearningSession.get_PackageFormat()
at Microsoft.LearningComponents.Frameset.FramesetHelper.getScormVersionHtml() in C:\Inetpub\wwwroot\appname\MLC\Frameset\FramesetHelper.cs:line 250
at Microsoft.LearningComponents.Frameset.FramesetFrameset.getScormVersionHtml() in C:\Inetpub\wwwroot\app_name\Frameset\Frameset.aspx.cs:line 161
at ASP.framesetframesetaspx._Render_control2(HtmlTextWriter _w, Control parameterContainer) in c:\Inetpub\wwwroot\appname\Frameset\Frameset.aspx:line 38
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlHead.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at ASP.framesetframesetaspx._Render_control1(HtmlTextWriter _w, Control parameterContainer) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\ed3e6b3c\f4d4f665\AppWeb_-onqy-j0.0.cs:line 0
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Dec 30, 2009 at 8:27 PM
Edited Dec 30, 2009 at 8:27 PM

Kevin,

I think the exception that you are getting here is the same exception you get when performing an attempt on a package you don't "own"(from thread).  Are you still getting this since you removed the check on Owner?  I am also trying to get the Review Session to work instead of the session complete.

Thanks,

Ben

Dec 31, 2009 at 1:00 PM

Ben,

No, I'm no longer getting this error.  I was successfully able to implement the "review" session ability a few months ago and things are working beautifully.  I can't at the moment recount all the steps I took to get this operational, but if you have questions let me know and I'll try to be of some help to you.

Kevin

Apr 22, 2010 at 11:58 AM

Hi, how were you able to create a review mode? This doesn't seem to be finished in the BWP and creating a new attempt to allow your users to "refresh" themselves on the content is cumbersome and inefficient.

Al