Resolve WES-181 "Missing code doc"
This commit is contained in:
committed by
Louis Adriaens
parent
7505ae7262
commit
3d99184717
@@ -93,6 +93,9 @@ public class CoursesController : AbstractFeedback
|
||||
/// </summary>
|
||||
private Image feedbackProgressImage;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the video player
|
||||
/// </summary>
|
||||
public VideoPlayer videoPlayer;
|
||||
|
||||
/// <summary>
|
||||
@@ -206,7 +209,7 @@ public class CoursesController : AbstractFeedback
|
||||
/// </summary>
|
||||
public void StartCourseController()
|
||||
{
|
||||
|
||||
|
||||
// Setting up course
|
||||
course = courselist.courses[courselist.currentCourseIndex];
|
||||
maxWords = course.theme.learnables.Count;
|
||||
@@ -333,9 +336,10 @@ public class CoursesController : AbstractFeedback
|
||||
private GameObject SetupPanel()
|
||||
{
|
||||
if (corruptPanelId == true)
|
||||
{
|
||||
{
|
||||
(currentWordIndex, panelId) = (1, CorruptedPanelIDValue);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
(currentWordIndex, panelId) = FetchSign().ToValueTuple();
|
||||
}
|
||||
@@ -432,7 +436,7 @@ public class CoursesController : AbstractFeedback
|
||||
if (currentWordIndex < course.theme.learnables.Count && panelId != 1 && !hasAnswered)
|
||||
{
|
||||
// Get current sign
|
||||
|
||||
|
||||
Learnable sign = course.theme.learnables[currentWordIndex];
|
||||
string currentSign = sign.name.ToUpper().Replace(" ", "-");
|
||||
|
||||
@@ -552,6 +556,10 @@ public class CoursesController : AbstractFeedback
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wait 0.75 seconds and proceed to the next sign
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private IEnumerator WaitNextSign()
|
||||
{
|
||||
// Wait for 0.75 seconds
|
||||
@@ -588,7 +596,7 @@ public class CoursesController : AbstractFeedback
|
||||
UserList.Save();
|
||||
SystemController.GetInstance().BackToPreviousScene();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns panelId for testing
|
||||
/// </summary>
|
||||
@@ -597,6 +605,7 @@ public class CoursesController : AbstractFeedback
|
||||
{
|
||||
return panelId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns currentSign for testing
|
||||
/// </summary>
|
||||
@@ -606,6 +615,7 @@ public class CoursesController : AbstractFeedback
|
||||
Learnable sign = course.theme.learnables[currentWordIndex];
|
||||
return sign.name.ToUpper().Replace(" ", "-");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used for testing an out of bounds PanelId
|
||||
/// </summary>
|
||||
@@ -642,6 +652,4 @@ public class CoursesController : AbstractFeedback
|
||||
CorruptedPanelIDValue = 1;
|
||||
yield return CRNextSign();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Video;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Class to handle panel with multiple choice options
|
||||
/// </summary>
|
||||
public class PanelMultipleChoice : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
@@ -108,7 +110,7 @@ public class PanelMultipleChoice : MonoBehaviour
|
||||
}
|
||||
|
||||
List<Learnable> randomSigns = new List<Learnable>();
|
||||
foreach(var sign in test.Take(3))
|
||||
foreach (var sign in test.Take(3))
|
||||
{
|
||||
randomSigns.Add(signs[sign.index]);
|
||||
}
|
||||
@@ -152,7 +154,6 @@ public class PanelMultipleChoice : MonoBehaviour
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -211,13 +212,11 @@ public class PanelMultipleChoice : MonoBehaviour
|
||||
playButton.sprite = pauseSprite;
|
||||
videoPlayer.Play();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
// Pause video and and switch sprite of button
|
||||
playButton.sprite = playSprite;
|
||||
videoPlayer.Pause();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,24 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Class to handle panel with only image and webcam
|
||||
/// </summary>
|
||||
public class PanelWithImage : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference to the feedback progress bar
|
||||
/// </summary>
|
||||
public GameObject feedbackProgressObject;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the object containing the message for when the course is loaded in preview mode
|
||||
/// </summary>
|
||||
public GameObject previewMessage;
|
||||
|
||||
/// <summary>
|
||||
/// True if the course is loaded in preview mode, false otherwise
|
||||
/// </summary>
|
||||
public bool isPreview;
|
||||
|
||||
/// <summary>
|
||||
@@ -14,8 +28,14 @@ public class PanelWithImage : MonoBehaviour
|
||||
/// </summary>
|
||||
public Transform signImageContainer;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the prefab for displaying the image
|
||||
/// </summary>
|
||||
public GameObject signImagePrefab;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the webcam
|
||||
/// </summary>
|
||||
public RawImage webcamScreen;
|
||||
|
||||
/// <summary>
|
||||
@@ -33,9 +53,19 @@ public class PanelWithImage : MonoBehaviour
|
||||
/// </summary>
|
||||
public Image feedbackProgressImage;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the list of learnables
|
||||
/// </summary>
|
||||
public List<Learnable> signs;
|
||||
|
||||
/// <summary>
|
||||
/// Index of the current learnable in the list with learnables
|
||||
/// </summary>
|
||||
public int currentSignIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Update the display of this panel
|
||||
/// </summary>
|
||||
public void Display()
|
||||
{
|
||||
Learnable currentSign = signs[currentSignIndex];
|
||||
|
||||
@@ -4,20 +4,49 @@ using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Video;
|
||||
|
||||
/// <summary>
|
||||
/// Class to handle panel with image, video and webcam
|
||||
/// </summary>
|
||||
public class PanelWithVideoAndImage : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference to the feedback progress bar
|
||||
/// </summary>
|
||||
public GameObject feedbackProgressObject;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the object containing the message for when the course is loaded in preview mode
|
||||
/// </summary>
|
||||
public GameObject previewMessage;
|
||||
|
||||
/// <summary>
|
||||
/// True if the course is loaded in preview mode, false otherwise
|
||||
/// </summary>
|
||||
public bool isPreview;
|
||||
|
||||
/// <summary>
|
||||
/// Video 'play' sprite
|
||||
/// </summary>
|
||||
public Sprite playSprite;
|
||||
|
||||
/// <summary>
|
||||
/// Video 'pause' sprite
|
||||
/// </summary>
|
||||
public Sprite pauseSprite;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to instructional video player
|
||||
/// </summary>
|
||||
public VideoPlayer videoPlayer;
|
||||
|
||||
/// <summary>
|
||||
/// Refrence to the video play/pause button
|
||||
/// </summary>
|
||||
public Image playButton;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the webcam
|
||||
/// </summary>
|
||||
public RawImage webcamScreen;
|
||||
|
||||
/// <summary>
|
||||
@@ -25,6 +54,9 @@ public class PanelWithVideoAndImage : MonoBehaviour
|
||||
/// </summary>
|
||||
public Transform signImageContainer;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the prefab for displaying the image
|
||||
/// </summary>
|
||||
public GameObject signImagePrefab;
|
||||
|
||||
/// <summary>
|
||||
@@ -42,9 +74,19 @@ public class PanelWithVideoAndImage : MonoBehaviour
|
||||
/// </summary>
|
||||
public Image feedbackProgressImage;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the list of learnables
|
||||
/// </summary>
|
||||
public List<Learnable> signs;
|
||||
|
||||
/// <summary>
|
||||
/// Index of the current learnable in the list with learnables
|
||||
/// </summary>
|
||||
public int currentSignIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Update the display of this panel
|
||||
/// </summary>
|
||||
public void Display()
|
||||
{
|
||||
Learnable currentSign = signs[currentSignIndex];
|
||||
@@ -79,13 +121,11 @@ public class PanelWithVideoAndImage : MonoBehaviour
|
||||
playButton.sprite = pauseSprite;
|
||||
videoPlayer.Play();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
// Pause video and and switch sprite of button
|
||||
playButton.sprite = playSprite;
|
||||
videoPlayer.Pause();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user