/// <summary> /// Prompt the learner modeling component to update its node probabilities. /// </summary> /// <param name="session">Session</param> /// <param name="addTopic">Topic used in addition</param> /// <param name="subTopic">Topic used in subtraction</param> private void UpdateNode(StabilizationSession session, SceneTopic addTopic, SceneTopic subTopic) { if (this.learnerModelingComponent == null) { InitializeLearnerModelingComponent(); } //count the correct and wrong attempts for addition float correctAdditionCount = (float)session.Count(true, SessionTags.Operation.ADDITION); float wrongAdditionCount = (float)session.Count(false, SessionTags.Operation.ADDITION); //add them together to get total addition attempts float additionCount = correctAdditionCount + wrongAdditionCount; //if there are addition attempts... if (additionCount != 0) { //get score by dividing correct attempts over total attempts float score = correctAdditionCount / additionCount; Debug.Log("num den for score IS " + correctAdditionCount + " " + additionCount); // score = score - (float)(session.SessionTime () / session.GetSceneAvgSolveTime ()); // Debug.LogError ("SCORE MINUS IS "+(session.SessionTime () / session.GetSceneAvgSolveTime ())); // score = score; Debug.Log("SCORE IS " + score); //depending on topic, update the respective node switch (addTopic) { case SceneTopic.SIMILAR_ADD: this.learnerModelingComponent.UpdateNode(LearnerModel.Node.Similar, LearnerModel.Operation.ADDITION, score); break; case SceneTopic.EQUIVALENT_ADD: this.learnerModelingComponent.UpdateNode(LearnerModel.Node.Equivalent, LearnerModel.Operation.ADDITION, score); break; case SceneTopic.DISSIMILAR_ADD: this.learnerModelingComponent.UpdateNode(LearnerModel.Node.Dissimilar, LearnerModel.Operation.ADDITION, score); break; } } //count the correct and wrong attempts for subtraction float correctSubtractionCount = (float)session.Count(true, SessionTags.Operation.SUBTRACTION); float wrongSubtractionCount = (float)session.Count(false, SessionTags.Operation.SUBTRACTION); //add them together to get total subtraction attempts float subtractionCount = correctSubtractionCount + wrongSubtractionCount; //if there are subtraction attempts... if (subtractionCount != 0) { //get score by dividing correct attempts over total attempts float score = correctSubtractionCount / subtractionCount; // TODO Also removed // score = score - (float)(session.SessionTime () / session.GetSceneAvgSolveTime ()); //depending on topic, update the respective node switch (subTopic) { case SceneTopic.SIMILAR_SUB: this.learnerModelingComponent.UpdateNode(LearnerModel.Node.Similar, LearnerModel.Operation.SUBTRACTION, score); break; case SceneTopic.EQUIVALENT_SUB: this.learnerModelingComponent.UpdateNode(LearnerModel.Node.Equivalent, LearnerModel.Operation.SUBTRACTION, score); break; case SceneTopic.DISSIMILAR_SUB: this.learnerModelingComponent.UpdateNode(LearnerModel.Node.Dissimilar, LearnerModel.Operation.SUBTRACTION, score); break; } } }