Update score rounding to 100 when all correct

This commit is contained in:
Shavira 2025-06-11 09:27:35 +07:00
parent 77da2d468e
commit 8433cff12b
4 changed files with 16 additions and 8 deletions

View File

@ -35,7 +35,6 @@ public class AuntMenu : Menu<AuntMenu>
private void OnEnable()
{
AuthenticationService.Instance.SignedIn += NextToMenu;
}
private void Start()

View File

@ -120,7 +120,6 @@ public class PostTestMenu : Menu<PostTestMenu>
}
Image selectedImage = answerButtons[index].GetComponent<Image>();
if (index == correctAnswerIndex)
{
@ -133,10 +132,22 @@ public class PostTestMenu : Menu<PostTestMenu>
selectedImage.sprite = falseAnswerSprite;
questionText.text = "Jawaban Salah";
}
saveData.postTestStatistik = (int)(((float)correctAnswers / totalQuestions) * 100f);
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);
}
}
void ShowCorrectAnswer()
{
isAnswering = false;

View File

@ -15,7 +15,6 @@ public class ProfileMenu : Menu<ProfileMenu>
[SerializeField] private Image dataPenyakitGigiImage;
[SerializeField] private Image dataPreTestImage;
[SerializeField] private Image dataPostTestImage;
[SerializeField] private TextMeshProUGUI dataKesehatanGigiText;
[SerializeField] private TextMeshProUGUI dataPenyakitGigiText;
[SerializeField] private TextMeshProUGUI dataPreTestText;
@ -71,6 +70,5 @@ public class ProfileMenu : Menu<ProfileMenu>
public void StatisticProfileButton()
{
audioController.Instance.PlaySFX("TombolUmum", 0.5f);
}
}

View File

@ -802,11 +802,11 @@ PlayerSettings:
apiCompatibilityLevel: 6
activeInputHandler: 0
windowsGamepadBackendHint: 0
cloudProjectId: eb23755b-bad6-47c2-8913-d9a87307f7f0
cloudProjectId:
framebufferDepthMemorylessMode: 0
qualitySettingsNames: []
projectName: ToothyV
organizationId: shaviragirls
projectName:
organizationId:
cloudEnabled: 0
legacyClampBlendShapeWeights: 0
playerDataPath: