/// <summary>
 /// The learner preference delivery speed end edit event.
 /// </summary>
 /// <param name="value">Value.</param>
 public void OnLearnerPreferenceDeliverySpeedEndEdit(string value)
 {
     ScormManager.SetLearnerPreferenceDeliverySpeed(float.Parse(value));
 }
 /// <summary>
 /// The learner preference audio captioning end edit event.
 /// </summary>
 /// <param name="value">Value.</param>
 public void OnLearnerPreferenceAudioCaptioningEndEdit(string value)
 {
     ScormManager.SetLearnerPreferenceAudioCaptioning(int.Parse(value));
 }
 /// <summary>
 /// The learner preference audio level end edit event.
 /// </summary>
 /// <param name="value">Value.</param>
 public void OnLearnerPreferenceAudioLevelEndEdit(string value)
 {
     ScormManager.SetLearnerPreferenceAudioLevel(float.Parse(value));
 }
 /// <summary>
 /// The learner score minimum edit end event.
 /// </summary>
 /// <param name="value">Value.</param>
 public void OnLearnerScoreMinEditEnd(string value)
 {
     ScormManager.SetScoreMin(float.Parse(value));
 }
 /// <summary>
 /// The progress measure change event.
 /// </summary>
 /// <param name="value">Value.</param>
 public void OnProgressMeasureChange(float value)
 {
     GameObject.Find("LabelScoreProgressMeasureAmount").GetComponent <Text> ().text = value.ToString();
     ScormManager.SetProgressMeasure(value);
 }
 /// <summary>
 /// The exit SCORM button is pressed.
 /// </summary>
 public void ButtonExitSCORMPressed()
 {
     ScormManager.SetSessionTime(currentTime);                                                       // Set this sessions time from the timer
     ScormManager.SetExit(StudentRecord.ExitType.normal);                                            // In Blackboard, this will complete the SCO attenmpt, even if the Completion Status is not set to completed.
     ScormManager.Commit();
 }
    /// <summary>
    /// Initializes the data into the GUI.
    /// </summary>
    private void InitializeData()
    {
        //Learner Data
        GameObject.Find("TextID").GetComponent <Text> ().text   = ScormManager.GetLearnerId();
        GameObject.Find("TextName").GetComponent <Text> ().text = ScormManager.GetLearnerName();

        StudentRecord.LearnerPreference learnerPreference = ScormManager.GetLearnerPreference();
        GameObject.Find("InputFieldAudioCaptioning").GetComponent <InputField> ().text = learnerPreference.audioCaptioning.ToString();
        GameObject.Find("InputFieldAudioLevel").GetComponent <InputField> ().text      = learnerPreference.audioLevel.ToString();
        GameObject.Find("InputFieldDeliverySpeed").GetComponent <InputField> ().text   = learnerPreference.deliverySpeed.ToString();
        GameObject.Find("InputFieldLanguage").GetComponent <InputField> ().text        = learnerPreference.langauge;

        LoadCommentFromLearnerList();

        //SCORM Data
        GameObject.Find("TextSCORMAPIVersion").GetComponent <Text> ().text = ScormManager.GetVersion();

        GameObject.Find("TextCredit").GetComponent <Text> ().text          = ScormManager.GetCredit().ToString();
        GameObject.Find("TextEntry").GetComponent <Text> ().text           = ScormManager.GetEntry().ToString();
        GameObject.Find("TextMode").GetComponent <Text> ().text            = ScormManager.GetMode().ToString();
        GameObject.Find("TextLocation").GetComponent <Text> ().text        = ScormManager.GetLocation();
        GameObject.Find("TextMaxTimeAllowed").GetComponent <Text> ().text  = ScormManager.GetMaxTimeAllowed().ToString();
        GameObject.Find("TextTotalTime").GetComponent <Text> ().text       = ScormManager.GetTotalTime().ToString();
        GameObject.Find("TextTimeLimitAction").GetComponent <Text> ().text = ScormManager.GetTimeLimitAction().ToString();
        GameObject.Find("TextLaunchData").GetComponent <Text> ().text      = ScormManager.GetLaunchData();

        LoadCommentFromLMSList();

        //Score
        GameObject.Find("TextScaledPassingScore").GetComponent <Text> ().text = ScormManager.GetScaledPassingScore().ToString();

        StudentRecord.LearnerScore score = ScormManager.GetScore();
        GameObject.Find("InputFieldMin").GetComponent <InputField> ().text   = score.min.ToString();
        GameObject.Find("InputFieldMax").GetComponent <InputField> ().text   = score.max.ToString();
        GameObject.Find("InputFieldScore").GetComponent <InputField> ().text = score.raw.ToString();

        GameObject.Find("SliderScoreProgressMeasure").GetComponent <Slider> ().value   = ScormManager.GetProgressMeasure();
        GameObject.Find("LabelScoreProgressMeasureAmount").GetComponent <Text> ().text = ScormManager.GetProgressMeasure().ToString();
        //Objectives
        LoadObjectives();

        //Interactions
        LoadLearnerInteractions();

        //Exit
        GameObject.Find("TextCompletionThreshold").GetComponent <Text> ().text = ScormManager.GetCompletionThreshold().ToString();
        switch (ScormManager.GetSuccessStatus())
        {
        case StudentRecord.SuccessStatusType.passed:
            GameObject.Find("TogglePassedFinal").GetComponent <Toggle>().isOn = true;
            break;

        case StudentRecord.SuccessStatusType.failed:
            GameObject.Find("ToggleFailedFinal").GetComponent <Toggle>().isOn = true;
            break;

        case StudentRecord.SuccessStatusType.unknown:
            GameObject.Find("ToggleUnknownFinal").GetComponent <Toggle>().isOn = true;
            break;
        }

        switch (ScormManager.GetCompletionStatus())
        {
        case StudentRecord.CompletionStatusType.completed:
            GameObject.Find("ToggleCompletedFinal").GetComponent <Toggle>().isOn = true;
            break;

        case StudentRecord.CompletionStatusType.incomplete:
            GameObject.Find("ToggleIncompleteFinal").GetComponent <Toggle>().isOn = true;
            break;

        case StudentRecord.CompletionStatusType.not_attempted:
            GameObject.Find("ToggleNotAttemptedFinal").GetComponent <Toggle>().isOn = true;
            break;

        case StudentRecord.CompletionStatusType.unknown:
            GameObject.Find("ToggleUnknownCompletedFinal").GetComponent <Toggle>().isOn = true;
            break;

        case StudentRecord.CompletionStatusType.not_set:
            ScormManager.SetCompletionStatus(StudentRecord.CompletionStatusType.incomplete);                                    // Set this first for every SCORM object, otherwise the LMS tends to treat it as a completed SCO by default
            GameObject.Find("ToggleIncompleteFinal").GetComponent <Toggle>().isOn = true;
            break;
        }
    }
 /// <summary>
 /// Responds to the Scorm_Commit_Complete message from the ScormManager
 /// </summary>
 /// <description>
 /// This is the point where you should exit the Scorm object.
 /// Make sure the SCORM object does not exit until you receive this message.
 /// </description>
 public void Scorm_Commit_Complete()
 {
     ScormManager.Terminate();
 }