Update Score Post Test
This commit is contained in:
parent
740db7fc04
commit
eb205f547a
|
@ -133,18 +133,7 @@ public class PostTestMenu : Menu<PostTestMenu>
|
|||
questionText.text = "Jawaban Salah";
|
||||
}
|
||||
|
||||
saveData.postTestStatistik = Mathf.RoundToInt(((float)correctAnswers / totalQuestions) * 100f);
|
||||
|
||||
float score = ((float)correctAnswers / totalQuestions) * 100f;
|
||||
|
||||
if (score >= 87f)
|
||||
{
|
||||
saveData.postTestStatistik = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
saveData.postTestStatistik = Mathf.RoundToInt(score);
|
||||
}
|
||||
saveData.preTestStatistik = (int)(((float)correctAnswers / totalQuestions) * 100f);
|
||||
}
|
||||
|
||||
|
||||
|
@ -173,5 +162,6 @@ public class PostTestMenu : Menu<PostTestMenu>
|
|||
saveData.postTestStatistik = finalScore;
|
||||
await Cloudsave.SaveData(saveData, "DataPlayer");
|
||||
MainMenu.Open();
|
||||
SelectLevel.Open();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ public class ProfileMenu : Menu<ProfileMenu>
|
|||
dataKesehatanGigiText.text = saveData.kesehatanGigiStatistik.ToString("F1");
|
||||
dataPenyakitGigiText.text = saveData.PenyakitGigiStatistik.ToString("F1");
|
||||
dataPreTestImage.fillAmount = saveData.preTestStatistik /100;
|
||||
dataPostTestImage.fillAmount = saveData.postTestStatistik / 9f;
|
||||
dataPostTestText.text = (saveData.postTestStatistik / 9f * 100f).ToString("F1") + "%";
|
||||
dataPostTestImage.fillAmount = saveData.postTestStatistik / 100f;
|
||||
dataPostTestText.text = saveData.postTestStatistik.ToString("F1") + "%";
|
||||
dataPreTestText.text = saveData.preTestStatistik.ToString("F1") + "%";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue