Skip to content

Commit 77e6094

Browse files
committed
Moved some code from a project I was working on to PsyForge because I put it in the wrong place
1 parent e21c5ab commit 77e6094

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

Runtime/Scripts/Experiment/MathDistractor.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ public async Task RunInitialTimings() {
4949
}
5050

5151
public async Task Run(bool isPractice, int trialNum, bool setProblemTimings = false) {
52-
if (isPractice) {
53-
await ExpHelpers.PressAnyKey("instructions math distractor", LangStrings.IntroSlidesMathDistractorTitle(),
54-
LangStrings.IntroSlidesMathDistractor().Aggregate((a, b) => a + b));
55-
}
56-
5752
ExpHelpers.SetExperimentStatus(HostPcStatusMsg.DISTRACT(trialNum));
5853
var trueDistractorDurationMs = isPractice ? practiceDistractorDurationMs : distractorDurationMs;
5954

Runtime/Scripts/Experiment/VerbalFreeRecall.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ public VerbalFreeRecall(int practiceVerbalFreeRecallDurationMs, int verbalFreeRe
3030
this.verbalFreeRecallDurationMs = verbalFreeRecallDurationMs;
3131
}
3232

33-
public async Task Run(bool isPractice, uint trialNum) {
34-
if (isPractice) {
35-
await ExpHelpers.PressAnyKey("instructions verbal free recall", LangStrings.IntroSlidesVerbalFreeRecallTitle(), LangStrings.PracticeVerbalFreeRecall());
36-
}
33+
public async Task Run(bool isPractice, uint trialNum, LangString verbalRecallDisplay = null) {
34+
verbalRecallDisplay ??= LangStrings.VerbalRecallDisplay();
3735

3836
// Setup
3937
var realVerbalFreeRecallDurationMs = isPractice ?
@@ -45,7 +43,7 @@ public async Task Run(bool isPractice, uint trialNum) {
4543

4644
// Play start beep
4745
manager.lowBeep.Play();
48-
textDisplayer.Display("verbal recall display", text: LangStrings.VerbalRecallDisplay());
46+
textDisplayer.Display("verbal recall display", text: verbalRecallDisplay);
4947

5048
while (manager.lowBeep.isPlaying) { await Awaitable.NextFrameAsync(); }
5149
await manager.Delay(100); // This is needed so you don't hear the end of the beep in the recording

Runtime/Scripts/ExternalDevices/HostPcMsg.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ protected HostPcStatusMsg(string name, Dictionary<string, object> dict = null)
5151

5252
public static HostPcStatusMsg PAUSE(bool pauseStart) { return new HostPcStatusMsg("PAUSE", new() { {"pause start", pauseStart} }); }
5353
public static HostPcStatusMsg WAITING() { return new HostPcStatusMsg("WAITING"); }
54+
public static HostPcStatusMsg DISTRACT(int trailNum) { return new HostPcStatusMsg("DISTRACT", new() {{"trial", trailNum}}); }
55+
public static HostPcStatusMsg MATH(bool correct, string problem, string answer, int responseTimeMs) { return new HostPcStatusMsg("MATH",
56+
new() { { "correct", correct }, { "problem", problem }, { "answer", answer }, { "responseTimeMs", responseTimeMs } }
57+
); }
58+
public static HostPcStatusMsg ENCODING(uint trailNum) { return new HostPcStatusMsg("ENCODING", new() {{"trial", trailNum}}); }
59+
public static HostPcStatusMsg RECALL(float duration, uint trailNum) { return new HostPcStatusMsg("RECALL", new() {{"duration", duration}, {"trial", trailNum}}); }
5460
}
5561

5662
// Host PC Closed Loop Message

Runtime/Scripts/Utilities/MyLangStrings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ public static partial class LangStrings {
9292
{ Language.English, "*****" },
9393
{ Language.German, "*****" },
9494
}); }
95+
public static LangString MathDistractorPreTrial() { return new( new() {
96+
{ Language.English, "Press any key to start the math task." },
97+
{ Language.German, "Drücken Sie eine beliebige Taste, um die Mathematikaufgabe zu starten." },
98+
}); }
9599
public static LangString ElememConnection() { return new( new() {
96100
{ Language.English, "Waiting for Elemem connection..." },
97101
{ Language.German, "Warte auf Elemem-Verbindung..." },

0 commit comments

Comments
 (0)