submitting only successful assignments from frameset

Topics: Developer Forum, User Forum
May 9, 2009 at 11:35 AM

hi all!

i have configured the "save and close" (located on the frameset) button so my users are corrently submitting their assignments, automatically, from the save&close button. i'd like to configure it once again to submit only succesful trainings. I tried to use the "isTrainingComplete" method from the framesetMgr.js file, but that function retrieves "false" at any case (failure and success).

Any suggestions?

Thanks,

Yuval.  

 

Coordinator
May 9, 2009 at 11:19 PM

Hi Yuval,

What do you mean that you have "configured the "save and close" (located on the frameset) button"?

The isTrainingComplete method is only set to true when the TrainingComplete method has been called by the content. If the content doesn't call this then it's always going to be false.

Richard

SLK Co-ordinator

http://blog.salamandersoft.co.uk

May 10, 2009 at 11:59 AM

Hi!

Thanks for ur answer.

"configurung the save and close buttton" means that i am calling the "DoSubmit" method from that button, what causes a submittion of an assignment regardless its 'fail' or 'pass' state. Now, i would like to check, from within the "save and close" button (title.htm),  if the current assignment has completed successfully, and if it has - to submit it. I am looking for a method, that can be used inside title.htm, that will inform me if the current assignment is successfully completed.

Thanks again,

Yuval.

 

Coordinator
May 28, 2009 at 10:29 PM

Hi Yuval,

You could try something along the lines of

function checkComplete()
{
    var objCount = retrieveDataValue("cmi.objectives._count");
    if (objCount > 0)
    {
        for (n=0;n<objCount;n++)
        {
                        if (retrieveDataValue("cmi.objectives."+n+".success_status") != "passed")
                        {
                            return false;
                        }
        }
    }
    else return true;
}

function retrieveDataValue( name )
{
   // do not call a set after finish was called
   if ( terminated != "true" )
   {
      var api = getAPIHandle();

      if ( api == null )
      {
         return "";
      }
      else
      {
         var value = api.GetValue( name );

         var errCode = api.GetLastError();

         if ( errCode != "0" )
         {
            var errCode = retrieveLastErrorCode();

            displayErrorInfo( errCode );
         }
         else
         {
            return value;
         }
      }
   }

   return;
}

I haven't tested this so don't know if it will work without some tweaking. I pulled some code from the Solitaire example where they were using

    if(checkObjectiveStatus("KlondikeSatisfied")=="passed")

and changed the checkObjectiveStatus into CheckComplete.

Richard

Aug 30, 2009 at 3:43 PM

Thanks Richard for your trouble.

the problem with the code you have suggested, is that it uses the scorm API ("cmi...").  At the time of checking the grade of the assignment (and then deciding if to submit or not), the training is already over, so using the the scorm api retrieves error 123 (terminated).

actually, what i am looking for is the answer to the question where does the grade of the last assignment is being held from the time the training is over until the time it is submitted . i know it is somewhere on the frameset, but i just can not retrieve that grade.

If you could help me with that issue i'll be greatful.

 

Thanks!