/// <summary> /// Method downgrading satisfaction, if needed /// </summary> public void updateSatisfaction() { MotivationState currentMs = getMotivationState(); MotivationState newMs = currentMs.getCopy(); if (checkSatisfactionDowngrade(newMs)) { storeNewMotivationState(newMs); } }
/// <summary> /// Updates the motivation state of a player with an motivation evidence. /// </summary> /// /// <param name="me"> Motivation evidence for the update. </param> internal void updateMotivationState(MotivationEvidence me) { loggingMAs("Start updating motivation state."); MotivationState currentMs = getMotivationState(); MotivationState newMs = currentMs.getCopy(); MotivationAssessmentAssetSettings maas = (MotivationAssessmentAssetSettings)getMAsA().Settings; if (me.EvidenceType == EvidenceType.LevelReached) { updatePrimaryMotivationAspect(newMs, "satisfaction", true); lastTimeUpdated = DateTime.Now; } else if (me.EvidenceType == EvidenceType.ProblemSolved) { if (me.FirstTryDuration < maas.FirstTryMinDuration) { updatePrimaryMotivationAspect(newMs, "attention", false); } else { if (me.SolvingDuration > maas.SolutionMaxDuration) { updatePrimaryMotivationAspect(newMs, "attention", false); } else { updatePrimaryMotivationAspect(newMs, "attention", true); } if (me.NoOfErrors > maas.MaxNoErrors || me.NoOfHelpRequests > maas.MaxNoHelpRequests) { updatePrimaryMotivationAspect(newMs, "confidence", false); } else { updatePrimaryMotivationAspect(newMs, "confidence", true); } } } else { loggingMAs("Warning: Evidence Type unknown!", Severity.Warning); } //downgrade satisfaction, if too much time passed by checkSatisfactionDowngrade(newMs); //Method for storing changes storeNewMotivationState(newMs); }