Skip to content

Commit 904d619

Browse files
committed
Fixing experiment issues
1 parent fec51e2 commit 904d619

File tree

5 files changed

+33
-42
lines changed

5 files changed

+33
-42
lines changed

StroopTest/Controllers/ExpositionController.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ public static void beginStroopTest(string programName, string participantName, c
3535
FormExposition ormExposition = new FormExposition(programName, participantName, mark);
3636
ormExposition.StartPosition = FormStartPosition.Manual;
3737
ormExposition.Location = Screen.AllScreens[showOnMonitor(form)].WorkingArea.Location;
38-
SendKeys.SendWait("i");
39-
ormExposition.Show();
38+
SendKeys.SendWait("i");
39+
var dialogResult = ormExposition.ShowDialog();
40+
while(ormExposition.DialogResult != DialogResult.OK)
41+
{
42+
/** do nothing*/
43+
}
4044
}
4145
catch (Exception ex) { MessageBox.Show(ex.Message); }
4246
}

StroopTest/TestPlatform.csproj

+20-21
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@
117117
<Compile Include="Models\StroopTest.cs" />
118118
<Compile Include="Models\Validations.cs" />
119119
<Compile Include="Settings.cs" />
120-
<Compile Include="Views\AboutBox.cs">
120+
<Compile Include="Views\MainForms\AboutBox.cs">
121121
<SubType>Form</SubType>
122122
</Compile>
123-
<Compile Include="Views\AboutBox.Designer.cs">
123+
<Compile Include="Views\MainForms\AboutBox.Designer.cs">
124124
<DependentUpon>AboutBox.cs</DependentUpon>
125125
</Compile>
126126
<Compile Include="Controllers\DGVManipulation.cs" />
@@ -143,10 +143,10 @@
143143
<DependentUpon>FormExperimentExposition.cs</DependentUpon>
144144
</Compile>
145145
<Compile Include="Views\ExpositionsViews.cs" />
146-
<Compile Include="Views\FormDefineTest.cs">
146+
<Compile Include="Views\MainForms\FormDefineTest.cs">
147147
<SubType>Form</SubType>
148148
</Compile>
149-
<Compile Include="Views\FormDefineTest.Designer.cs">
149+
<Compile Include="Views\MainForms\FormDefineTest.Designer.cs">
150150
<DependentUpon>FormDefineTest.cs</DependentUpon>
151151
</Compile>
152152
<Compile Include="Models\Global.cs" />
@@ -210,10 +210,10 @@
210210
<Compile Include="Views\ListsPages\FormListConfig.Designer.cs">
211211
<DependentUpon>FormListConfig.cs</DependentUpon>
212212
</Compile>
213-
<Compile Include="Views\FormShowAudio.cs">
213+
<Compile Include="Views\ListsPages\FormShowAudio.cs">
214214
<SubType>UserControl</SubType>
215215
</Compile>
216-
<Compile Include="Views\FormShowAudio.Designer.cs">
216+
<Compile Include="Views\ListsPages\FormShowAudio.Designer.cs">
217217
<DependentUpon>FormShowAudio.cs</DependentUpon>
218218
</Compile>
219219
<Compile Include="Views\ListsPages\FormAudioConfig.cs">
@@ -228,16 +228,16 @@
228228
<Compile Include="Views\ListsPages\FormImgConfig.Designer.cs">
229229
<DependentUpon>FormImgConfig.cs</DependentUpon>
230230
</Compile>
231-
<Compile Include="Views\FormMain.cs">
231+
<Compile Include="Views\MainForms\FormMain.cs">
232232
<SubType>Form</SubType>
233233
</Compile>
234-
<Compile Include="Views\FormMain.Designer.cs">
234+
<Compile Include="Views\MainForms\FormMain.Designer.cs">
235235
<DependentUpon>FormMain.cs</DependentUpon>
236236
</Compile>
237-
<Compile Include="Views\FormDefine.cs">
237+
<Compile Include="Views\MainForms\FormDefine.cs">
238238
<SubType>Form</SubType>
239239
</Compile>
240-
<Compile Include="Views\FormDefine.Designer.cs">
240+
<Compile Include="Views\MainForms\FormDefine.Designer.cs">
241241
<DependentUpon>FormDefine.cs</DependentUpon>
242242
</Compile>
243243
<Compile Include="Views\StroopPages\FormPrgConfig.cs">
@@ -246,11 +246,11 @@
246246
<Compile Include="Views\StroopPages\FormPrgConfig.Designer.cs">
247247
<DependentUpon>FormPrgConfig.cs</DependentUpon>
248248
</Compile>
249-
<Compile Include="Views\FormInstructions.cs">
249+
<Compile Include="Views\MainForms\FormHelp.cs">
250250
<SubType>Form</SubType>
251251
</Compile>
252-
<Compile Include="Views\FormInstructions.Designer.cs">
253-
<DependentUpon>FormInstructions.cs</DependentUpon>
252+
<Compile Include="Views\MainForms\FormHelp.Designer.cs">
253+
<DependentUpon>FormHelp.cs</DependentUpon>
254254
</Compile>
255255
<Compile Include="Views\StroopPages\FormExposition.cs">
256256
<SubType>Form</SubType>
@@ -285,7 +285,7 @@
285285
<DependentUpon>Resources.resx</DependentUpon>
286286
</Compile>
287287
<Compile Include="Models\StroopProgram.cs" />
288-
<EmbeddedResource Include="Views\AboutBox.resx">
288+
<EmbeddedResource Include="Views\MainForms\AboutBox.resx">
289289
<DependentUpon>AboutBox.cs</DependentUpon>
290290
<SubType>Designer</SubType>
291291
</EmbeddedResource>
@@ -298,7 +298,7 @@
298298
<EmbeddedResource Include="Views\ExperimentPages\FormExperimentExposition.resx">
299299
<DependentUpon>FormExperimentExposition.cs</DependentUpon>
300300
</EmbeddedResource>
301-
<EmbeddedResource Include="Views\FormDefineTest.resx">
301+
<EmbeddedResource Include="Views\MainForms\FormDefineTest.resx">
302302
<DependentUpon>FormDefineTest.cs</DependentUpon>
303303
</EmbeddedResource>
304304
<EmbeddedResource Include="Views\ReactionPages\FormReactExposition.resx">
@@ -331,7 +331,7 @@
331331
<EmbeddedResource Include="Views\ListsPages\FormListConfig.resx">
332332
<DependentUpon>FormListConfig.cs</DependentUpon>
333333
</EmbeddedResource>
334-
<EmbeddedResource Include="Views\FormShowAudio.resx">
334+
<EmbeddedResource Include="Views\ListsPages\FormShowAudio.resx">
335335
<DependentUpon>FormShowAudio.cs</DependentUpon>
336336
</EmbeddedResource>
337337
<EmbeddedResource Include="Views\ListsPages\FormAudioConfig.resx">
@@ -340,20 +340,20 @@
340340
<EmbeddedResource Include="Views\ListsPages\FormImgConfig.resx">
341341
<DependentUpon>FormImgConfig.cs</DependentUpon>
342342
</EmbeddedResource>
343-
<EmbeddedResource Include="Views\FormMain.resx">
343+
<EmbeddedResource Include="Views\MainForms\FormMain.resx">
344344
<DependentUpon>FormMain.cs</DependentUpon>
345345
<SubType>Designer</SubType>
346346
</EmbeddedResource>
347-
<EmbeddedResource Include="Views\FormDefine.resx">
347+
<EmbeddedResource Include="Views\MainForms\FormDefine.resx">
348348
<DependentUpon>FormDefine.cs</DependentUpon>
349349
<SubType>Designer</SubType>
350350
</EmbeddedResource>
351351
<EmbeddedResource Include="Views\StroopPages\FormPrgConfig.resx">
352352
<DependentUpon>FormPrgConfig.cs</DependentUpon>
353353
<SubType>Designer</SubType>
354354
</EmbeddedResource>
355-
<EmbeddedResource Include="Views\FormInstructions.resx">
356-
<DependentUpon>FormInstructions.cs</DependentUpon>
355+
<EmbeddedResource Include="Views\MainForms\FormHelp.resx">
356+
<DependentUpon>FormHelp.cs</DependentUpon>
357357
<SubType>Designer</SubType>
358358
</EmbeddedResource>
359359
<EmbeddedResource Include="Views\StroopPages\FormExposition.resx">
@@ -388,7 +388,6 @@
388388
<DependentUpon>Settings.settings</DependentUpon>
389389
<DesignTimeSharedInput>True</DesignTimeSharedInput>
390390
</Compile>
391-
<None Include="TestPlatform_TemporaryKey.pfx" />
392391
</ItemGroup>
393392
<ItemGroup>
394393
<None Include="App.config" />

StroopTest/Views/ExperimentPages/FormExperimentExposition.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ private async Task startTesting()
7373
foreach (Program program in executingTest.ProgramInUse.ProgramList)
7474
{
7575
index++;
76+
await Task.Delay(executingTest.ProgramInUse.IntervalTime);
7677
executingTest.ExpositionTime = DateTime.Now;
78+
7779
if (program.GetType() == typeof(StroopProgram))
7880
{
7981
ExpositionController.beginStroopTest(program.ProgramName, executingTest.ParticipantName, executingTest.Mark, this);
@@ -82,8 +84,7 @@ private async Task startTesting()
8284
{
8385
ExpositionController.beginReactionTest(program.ProgramName, executingTest.ParticipantName, executingTest.Mark, this);
8486
}
85-
executingTest.writeLineOutput(index, program);
86-
await Task.Delay(executingTest.ProgramInUse.IntervalTime);
87+
executingTest.writeLineOutput(index, program);
8788
}
8889
Program.writeOutputFile(outputFile, string.Join("\n", executingTest.Output.ToArray()));
8990
Close();

StroopTest/Views/MainForms/FormMain.Designer.cs

+1-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StroopTest/Views/StroopPages/FormExposition.cs

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
6161
MessageBox.Show("A exposição foi cancelada.");
6262
if(programInUse.AudioCapture)
6363
audioControl.saveRecording();
64+
this.DialogResult = DialogResult.Cancel;
6465
this.Close();
6566
return true;
6667
}
@@ -275,6 +276,7 @@ private async Task startWordExposition() // starts colored words exposition - cl
275276
changeBackgroundColor(programInUse, false); // retorna à cor de fundo padrão
276277

277278
StroopProgram.writeOutputFile(outputFile, string.Join("\n", outputContent.ToArray()));
279+
this.DialogResult = DialogResult.OK;
278280
Close(); // finaliza exposição após execução
279281
}
280282
catch(TaskCanceledException)
@@ -510,6 +512,7 @@ private async Task startImageExposition() // inicia exposição de imagem
510512
wordLabel.Font = new Font(wordLabel.Font.FontFamily, 160);
511513
wordLabel.ForeColor = Color.Black;
512514
StroopProgram.writeOutputFile(outputFile, string.Join("\n", outputContent.ToArray()));
515+
this.DialogResult = DialogResult.OK;
513516
Close();
514517
}
515518
catch (TaskCanceledException)

0 commit comments

Comments
 (0)