Resolve WES-133 "Multiple choice"

This commit is contained in:
Tibe Habils
2023-04-10 15:05:11 +00:00
committed by Jelle De Geest
parent 04d9a4bf2b
commit 4e9d801e61
49 changed files with 3310 additions and 1244 deletions

View File

@@ -755,10 +755,6 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 906197777}
m_Modifications:
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: Common/Scenes/StartScreen
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308514, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_Name
value: ButtonBack
@@ -793,11 +789,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_SizeDelta.x
value: 300
value: 100
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_SizeDelta.y
value: 120
value: 100
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalPosition.x
@@ -1920,7 +1916,6 @@ MonoBehaviour:
userPrefab: {fileID: 7566391564300576383, guid: f5103a1b6ba1b0445a0d049203b9b6b2, type: 3}
usersContainer: {fileID: 1438010722}
error: {fileID: 1815188481}
userList: {fileID: 11400000, guid: 072bec636a40f7e4e93b0ac624a3bda2, type: 2}
--- !u!4 &2129020787
Transform:
m_ObjectHideFlags: 0

View File

@@ -516,7 +516,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a59f8e8c48fbd4444a41df01694d13a7, type: 3}
m_Name:
m_EditorClassIdentifier:
userList: {fileID: 11400000, guid: 072bec636a40f7e4e93b0ac624a3bda2, type: 2}
username: {fileID: 1021209698}
avatar: {fileID: 1873954004}
playtime: {fileID: 1716832605}
@@ -904,10 +903,6 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 906197777}
m_Modifications:
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: Common/Scenes/StartScreen
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308514, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_Name
value: ButtonBack
@@ -942,11 +937,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_SizeDelta.x
value: 300
value: 100
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_SizeDelta.y
value: 120
value: 100
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalPosition.x

View File

@@ -113,6 +113,15 @@ public class User
storedUserData.courses.Add(progress);
}
/// <summary>
/// Reset progress of a course
/// </summary>
/// <param name="courseIndex">Index of course</param>
public void ResetCourseProgress(CourseIndex courseIndex)
{
storedUserData.courses.RemoveAll((p) => p.courseIndex == courseIndex);
}
/// <summary>
/// Get the progress of all minigames the user did
/// </summary>
@@ -140,4 +149,13 @@ public class User
{
storedUserData.minigames.Add(progress);
}
/// <summary>
/// Reset progress of a minigame
/// </summary>
/// <param name="minigameIndex">Index of the minigame</param>
public void ResetMinigameProgress(MinigameIndex minigameIndex)
{
storedUserData.minigames.RemoveAll((p) => p.minigameIndex == minigameIndex);
}
}

View File

@@ -139,6 +139,20 @@ public class UserTest
Assert.AreEqual(q.progress, 3.14159265f);
}
/// <summary>
/// Test progress of a course is correctly reset (aka removed)
/// </summary>
[Test]
public void Test_User_ResetCourseProgres()
{
var p = new PersistentDataController.SavedCourseProgress();
p.courseIndex = CourseIndex.FINGERSPELLING;
user.AddCourseProgress(p);
Assert.IsNotNull(user.GetCourseProgress(CourseIndex.FINGERSPELLING));
user.ResetCourseProgress(CourseIndex.FINGERSPELLING);
Assert.IsNull(user.GetCourseProgress(CourseIndex.FINGERSPELLING));
}
/// <summary>
/// Test GetMinigameProgress returns null when minigame cannot be found
/// </summary>
@@ -168,4 +182,18 @@ public class UserTest
Assert.Zero(q.latestScores.Count);
Assert.Zero(q.highestScores.Count);
}
/// <summary>
/// Test progress of a minigame is correctly reset (aka removed)
/// </summary>
[Test]
public void Test_User_ResetMinigameProgres()
{
var p = new PersistentDataController.SavedMinigameProgress();
p.minigameIndex = MinigameIndex.SPELLING_BEE;
user.AddMinigameProgress(p);
Assert.IsNotNull(user.GetMinigameProgress(MinigameIndex.SPELLING_BEE));
user.ResetMinigameProgress(MinigameIndex.SPELLING_BEE);
Assert.IsNull(user.GetMinigameProgress(MinigameIndex.SPELLING_BEE));
}
}