Fixed preview and clothes bug

This commit is contained in:
Jerome Coudron
2023-05-14 12:37:36 +00:00
committed by Dries Van Schuylenbergh
parent 1e09f09dae
commit 7df6ea1ecd
5 changed files with 47 additions and 28 deletions

View File

@@ -14,101 +14,101 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
title: Kleren en Kleuren title: Kleren en Kleuren
description: Van rok tot sok description: Van rok tot sok
themeIndex: 1 themeIndex: 7
modelIndex: 0 modelIndex: 0
learnables: learnables:
- name: Blauw - name: Blauw
image: {fileID: 21300000, guid: 182fb89eba9c64041bef31ca35c4bcd8, type: 3} image: {fileID: 21300000, guid: 182fb89eba9c64041bef31ca35c4bcd8, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: ddbd51ba81efa0d4386063f0908dddbc, type: 3} clip: {fileID: 32900000, guid: ddbd51ba81efa0d4386063f0908dddbc, type: 3}
- name: Bril - name: Bril
image: {fileID: 21300000, guid: c671ae6bf5c5e90419add134a669aec1, type: 3} image: {fileID: 21300000, guid: c671ae6bf5c5e90419add134a669aec1, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 50ab64534fbf206448eae89e7f849536, type: 3} clip: {fileID: 32900000, guid: 50ab64534fbf206448eae89e7f849536, type: 3}
- name: Geel - name: Geel
image: {fileID: 21300000, guid: c7006b8cc5cff974b9ff307fe13fdd5e, type: 3} image: {fileID: 21300000, guid: c7006b8cc5cff974b9ff307fe13fdd5e, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 7e14190a75067624abdb6a2872a4afac, type: 3} clip: {fileID: 32900000, guid: 7e14190a75067624abdb6a2872a4afac, type: 3}
- name: Grijs - name: Grijs
image: {fileID: 21300000, guid: 7d4fdd972dcef1747bcbcc598b075504, type: 3} image: {fileID: 21300000, guid: 7d4fdd972dcef1747bcbcc598b075504, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: f71578e140d29484580a9b9ab6ef1b50, type: 3} clip: {fileID: 32900000, guid: f71578e140d29484580a9b9ab6ef1b50, type: 3}
- name: Groen - name: Groen
image: {fileID: 21300000, guid: d1f80913126d4c94285c1160f9e50c24, type: 3} image: {fileID: 21300000, guid: d1f80913126d4c94285c1160f9e50c24, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: e275659c79beb764b882ed5293d70087, type: 3} clip: {fileID: 32900000, guid: e275659c79beb764b882ed5293d70087, type: 3}
- name: Hemd - name: Hemd
image: {fileID: 21300000, guid: 28d5b4df34fc2b049b2455f303461f45, type: 3} image: {fileID: 21300000, guid: 28d5b4df34fc2b049b2455f303461f45, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 732b94d1c76ad8a4bb3fee5c686c0d8e, type: 3} clip: {fileID: 32900000, guid: 732b94d1c76ad8a4bb3fee5c686c0d8e, type: 3}
- name: Hoed - name: Hoed
image: {fileID: 21300000, guid: cede6c6f958f0ae4bbba6282528292cf, type: 3} image: {fileID: 21300000, guid: cede6c6f958f0ae4bbba6282528292cf, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 6a3028c09a55d4a418b56ea4a716777a, type: 3} clip: {fileID: 32900000, guid: 6a3028c09a55d4a418b56ea4a716777a, type: 3}
- name: Jas - name: Jas
image: {fileID: 21300000, guid: 4a61d44b0e2ccb242a97681b429b8343, type: 3} image: {fileID: 21300000, guid: 4a61d44b0e2ccb242a97681b429b8343, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 558ee737100d298479641a10ae09852e, type: 3} clip: {fileID: 32900000, guid: 558ee737100d298479641a10ae09852e, type: 3}
- name: Kous - name: Kous
image: {fileID: 21300000, guid: 83b7dc2f696a1c443acf92f310a61cc3, type: 3} image: {fileID: 21300000, guid: 83b7dc2f696a1c443acf92f310a61cc3, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: cf8a1b846823a074d90075f29753b679, type: 3} clip: {fileID: 32900000, guid: cf8a1b846823a074d90075f29753b679, type: 3}
- name: Zwart - name: Zwart
image: {fileID: 21300000, guid: 5527d4c18ce148a4c8ce7de7b927cb5e, type: 3} image: {fileID: 21300000, guid: 5527d4c18ce148a4c8ce7de7b927cb5e, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 2895a22e7719def418818a5b532bfbf5, type: 3} clip: {fileID: 32900000, guid: 2895a22e7719def418818a5b532bfbf5, type: 3}
- name: Wit - name: Wit
image: {fileID: 21300000, guid: 5387f0486602abf479f049d9afa9d3cb, type: 3} image: {fileID: 21300000, guid: 5387f0486602abf479f049d9afa9d3cb, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 351aac8168f9ea34f95878dd90ef5f3b, type: 3} clip: {fileID: 32900000, guid: 351aac8168f9ea34f95878dd90ef5f3b, type: 3}
- name: Trui - name: Trui
image: {fileID: 21300000, guid: 2413cb0f9b70cd84aae8a3aa1b83e7e8, type: 3} image: {fileID: 21300000, guid: 2413cb0f9b70cd84aae8a3aa1b83e7e8, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: c907e04793964864dad921a6a01af8a7, type: 3} clip: {fileID: 32900000, guid: c907e04793964864dad921a6a01af8a7, type: 3}
- name: Handschoenen - name: Handschoenen
image: {fileID: 21300000, guid: 12d9777dbc9d4f543b822e38838e47d4, type: 3} image: {fileID: 21300000, guid: 12d9777dbc9d4f543b822e38838e47d4, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: cf67ee32acd99eb4d935a4fedb7e1fb1, type: 3} clip: {fileID: 32900000, guid: cf67ee32acd99eb4d935a4fedb7e1fb1, type: 3}
- name: Muts - name: Muts
image: {fileID: 21300000, guid: b620a409ad2371d43b418b851715df4d, type: 3} image: {fileID: 21300000, guid: b620a409ad2371d43b418b851715df4d, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 125c5c87cf540e94098608da4a956b21, type: 3} clip: {fileID: 32900000, guid: 125c5c87cf540e94098608da4a956b21, type: 3}
- name: Oranje - name: Oranje
image: {fileID: 21300000, guid: 16f645dc2176fa248af566b5295b451a, type: 3} image: {fileID: 21300000, guid: 16f645dc2176fa248af566b5295b451a, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: d64c7a8ee9206e848b5b3e8ccce0db41, type: 3} clip: {fileID: 32900000, guid: d64c7a8ee9206e848b5b3e8ccce0db41, type: 3}
- name: Paars - name: Paars
image: {fileID: 21300000, guid: d574bf2c96bb5b74080b4cf8ca51312d, type: 3} image: {fileID: 21300000, guid: d574bf2c96bb5b74080b4cf8ca51312d, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: b19ed4b06b9556d4081c0683b495e71a, type: 3} clip: {fileID: 32900000, guid: b19ed4b06b9556d4081c0683b495e71a, type: 3}
- name: Rood - name: Rood
image: {fileID: 21300000, guid: 47a49435e7b8c9a49b162fb4d6f9ceaa, type: 3} image: {fileID: 21300000, guid: 47a49435e7b8c9a49b162fb4d6f9ceaa, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 552079dd964f93643a4ca82452c49f35, type: 3} clip: {fileID: 32900000, guid: 552079dd964f93643a4ca82452c49f35, type: 3}
- name: Roze - name: Roze
image: {fileID: 21300000, guid: e3c4feacdb7710349b326280e2163a84, type: 3} image: {fileID: 21300000, guid: e3c4feacdb7710349b326280e2163a84, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 6d35ec9a9a78cf3429a1366279003e06, type: 3} clip: {fileID: 32900000, guid: 6d35ec9a9a78cf3429a1366279003e06, type: 3}
- name: Schoen - name: Schoen
image: {fileID: 21300000, guid: 2b98a98c11c5bbf4782d9d41b1c9f213, type: 3} image: {fileID: 21300000, guid: 2b98a98c11c5bbf4782d9d41b1c9f213, type: 3}
handGuide: {fileID: 0} handGuide: {fileID: 0}
thresholdPrecentage: 0.9 thresholdDistance: 2
clip: {fileID: 32900000, guid: 422c7afc0cb753b42bf72e281c743097, type: 3} clip: {fileID: 32900000, guid: 422c7afc0cb753b42bf72e281c743097, type: 3}

View File

@@ -81,12 +81,13 @@ public class CourseActivityScreen : MonoBehaviour
// Set progress // Set progress
PersistentDataController.GetInstance().Load(); PersistentDataController.GetInstance().Load();
progress = UserList.GetCurrentUser().GetCourseProgress(course.index); progress = UserList.GetCurrentUser().GetCourseProgress(course.index);
if (progress != null && course.theme.modelIndex != ModelIndex.NONE) if (progress != null)
{ {
progressBar.value = progress.progress; progressBar.value = progress.progress;
if (progress.progress == 1.0f) if (progress.progress == 1.0f)
{ {
playButton.SetActive(false); playButton.SetActive(false);
previewButton.SetActive(false);
progressObject.SetActive(false); progressObject.SetActive(false);
completedObject.SetActive(true); completedObject.SetActive(true);
} }

View File

@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f6b23e64e6ffb12459ed4f37d7305852, type: 3} m_Script: {fileID: 11500000, guid: f6b23e64e6ffb12459ed4f37d7305852, type: 3}
m_Name: ClothesCourse m_Name: ClothesCourse
m_EditorClassIdentifier: m_EditorClassIdentifier:
index: 1 index: 7
title: Kleren en Kleuren title: Kleren en Kleuren
description: // TBA description: // TBA
thumbnail: {fileID: 21300000, guid: 4913be0505c981a49bdbee0bbe6c33fe, type: 3} thumbnail: {fileID: 21300000, guid: 4913be0505c981a49bdbee0bbe6c33fe, type: 3}

View File

@@ -253,12 +253,7 @@ public class CoursesController : AbstractFeedback
{ {
PersistentDataController.SavedLearnableProgress learnable = progress.GetRandomLearnable(); PersistentDataController.SavedLearnableProgress learnable = progress.GetRandomLearnable();
int panelChosen; int panelChosen;
if (course.theme.modelIndex == ModelIndex.NONE) if (learnable.progress > 2.0f)
{
// only multiple choice works in preview mode
panelChosen = 1;
}
else if (learnable.progress > 2.0f)
{ {
panelChosen = 2; panelChosen = 2;
} }
@@ -285,6 +280,14 @@ public class CoursesController : AbstractFeedback
//if (isNextSignInTransit || maxWords < progress.completedLearnables) //if (isNextSignInTransit || maxWords < progress.completedLearnables)
if (isNextSignInTransit) return; if (isNextSignInTransit) return;
// Code for preview-progress, skipping should give progress unless it is multipleChoice
if (course.theme.modelIndex == ModelIndex.NONE)
{
string currentName = course.theme.learnables[currentWordIndex].name;
// This works both to allow panel 0 to allow progress via skipping and also to allow panel 2 to be skipped.
if (progress.FindLearnable(currentName).progress <= 1f || progress.FindLearnable(currentName).progress >= 2f) progress.UpdateLearnable(currentName, 1.5f);
}
progress.progress = (float)progress.completedLearnables / (float)maxWords; progress.progress = (float)progress.completedLearnables / (float)maxWords;
progressBar.fillAmount = progress.progress; progressBar.fillAmount = progress.progress;

View File

@@ -135,6 +135,21 @@ public class CoursesControllerTests
var coursesController = GameObject.FindObjectOfType<CoursesController>(); var coursesController = GameObject.FindObjectOfType<CoursesController>();
Assert.IsNotNull(coursesController); Assert.IsNotNull(coursesController);
Assert.AreEqual(coursesController.GetPanelId(), 0);
// Check that you reach multiple-choice after 6 NextSigns
coursesController.NextSign();
yield return new WaitForSeconds(1f);
coursesController.NextSign();
yield return new WaitForSeconds(1f);
coursesController.NextSign();
yield return new WaitForSeconds(1f);
coursesController.NextSign();
yield return new WaitForSeconds(1f);
coursesController.NextSign();
yield return new WaitForSeconds(1f);
coursesController.NextSign();
yield return new WaitForSeconds(1f);
Assert.AreEqual(coursesController.GetPanelId(), 1); Assert.AreEqual(coursesController.GetPanelId(), 1);
} }