diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 773d307..c802bd7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,3 +66,39 @@ You can run tests using visual studio default configurations. Please send a [GitHub Pull Request to TestPlatform](https://github.com/lab-neuro-comp/Test-Platform/pull/new/master) stating what you've done. The Pull Request will only be accepted if the contribution works in all cultures (en-US and pt-BR). + + +# Deployment + + + +For this project deployment, follow the steps below (You need WinRAR to be installed in your computer) + + + +1. Change localization to specific culture that will be released. Don't forget to also change version in AssemblyInfo.cs (Inside Properties) + + +![enter image description here](https://github.com/lab-neuro-comp/Test-Platform/blob/master/images/main_culture.png?raw=true) + + + +2. Go to project properties and click on the left menu on publish, changing application files accordingly to culture being published. Then, click on the Publish Wizard + + + +![enter image description here](https://github.com/lab-neuro-comp/Test-Platform/blob/master/images/publish_projects.png?raw=true) + + + +3. Right click on the folder created after published, and click to add to file (using WinRAR). + + +4. Use WinRAR advanced SFX options to create an executable of the compressed files + + +![enter image description here](https://github.com/lab-neuro-comp/Test-Platform/blob/master/images/sfx_shortcut.png?raw=true) + + + +![enter image description here](https://github.com/lab-neuro-comp/Test-Platform/blob/master/images/sfx_text.png?raw=true) diff --git a/StroopTest/Controllers/ExpositionController.cs b/StroopTest/Controllers/ExpositionController.cs index f57e940..2a8f2d0 100644 --- a/StroopTest/Controllers/ExpositionController.cs +++ b/StroopTest/Controllers/ExpositionController.cs @@ -208,5 +208,27 @@ public static void BeginExperimentTest(string programName, string participantNam } } + + public static void formSecondScreen(Form form) + { + Screen[] sc; + sc = Screen.AllScreens; + if (sc.Count() > 1) + { + foreach (Screen s in sc) + { + if (!s.Primary) + { + form.WindowState = FormWindowState.Maximized; + form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + form.Bounds = s.Bounds; + form.MaximizeBox = true; + } + } + } + + } + + } } diff --git a/StroopTest/Models/General/StrList.cs b/StroopTest/Models/General/StrList.cs index fc5a244..082e887 100644 --- a/StroopTest/Models/General/StrList.cs +++ b/StroopTest/Models/General/StrList.cs @@ -152,11 +152,12 @@ public bool saveContent(bool shouldSave) { string listDestination = Global.testFilesPath + Global.listFolderName + ListName + Type + "/"; Directory.CreateDirectory(listDestination); + int i = 0; foreach (string content in listContent) { try { - File.Copy(content, listDestination + Path.GetFileName(content), true); + File.Copy(content, listDestination + i + Path.GetFileName(content), true); } catch @@ -165,6 +166,7 @@ public bool saveContent(bool shouldSave) CultureInfo currentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture; MessageBox.Show(LocRM.GetString("fileNotFound", currentCulture) + "\n" + content); } + i++; } return true; } diff --git a/StroopTest/Models/Tests/Reaction/ReactionProgram.cs b/StroopTest/Models/Tests/Reaction/ReactionProgram.cs index c27d1a2..a96e9a2 100644 --- a/StroopTest/Models/Tests/Reaction/ReactionProgram.cs +++ b/StroopTest/Models/Tests/Reaction/ReactionProgram.cs @@ -422,7 +422,7 @@ public string StimuluShape set { - if (!value || value && numberPositions == 0) + if (!value || value && numberPositions == 1) { expandImage = value; } diff --git a/StroopTest/Properties/AssemblyInfo.cs b/StroopTest/Properties/AssemblyInfo.cs index 459cfc0..936ec33 100644 --- a/StroopTest/Properties/AssemblyInfo.cs +++ b/StroopTest/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.0")] -[assembly: AssemblyFileVersion("3.0")] +[assembly: AssemblyVersion("3.1")] +[assembly: AssemblyFileVersion("3.1")] diff --git a/StroopTest/TestPlatform.csproj b/StroopTest/TestPlatform.csproj index f42d689..f94a5d5 100644 --- a/StroopTest/TestPlatform.csproj +++ b/StroopTest/TestPlatform.csproj @@ -17,7 +17,7 @@ 4e4db72659e84ec1ab96ac2196fa1559 - C:\Users\fabio\Desktop\UnB\Iniciação Científica\en-US\ + C:\Users\fabio\Desktop\UnB\Iniciação Científica\pt-BR\ true Disk false @@ -36,7 +36,7 @@ publish.htm false 0 - 3.0.0.0 + 3.1.0.0 false true true @@ -532,7 +532,6 @@ FormMatchConfig.cs - Designer MatchingExposition.cs @@ -736,8 +735,6 @@ - - @@ -803,7 +800,7 @@ en-US - Include + Exclude True Satellite @@ -812,7 +809,7 @@ pt-BR - Exclude + Include True Satellite diff --git a/StroopTest/Views/ListsPages/FormImgConfig.cs b/StroopTest/Views/ListsPages/FormImgConfig.cs index fa0605a..b414066 100644 --- a/StroopTest/Views/ListsPages/FormImgConfig.cs +++ b/StroopTest/Views/ListsPages/FormImgConfig.cs @@ -41,8 +41,6 @@ public FormImgConfig(string imgListEdit) private void openImgList() { - try - { FormDefine defineFilePath = defineFilePath = new FormDefine(LocRM.GetString("imageList", currentCulture), Global.testFilesPath + Global.listFolderName, "dir","_image",true, false); var result = defineFilePath.ShowDialog(); @@ -55,17 +53,13 @@ private void openImgList() isListNameValid = false; return; } - imgListNameTextBox.Text = listName.Remove(listName.Length - 6); // removes the _img identification from file while editing (when its saved it is always added again) + imgListNameTextBox.Text = listName; // removes the _img identification from file while editing (when its saved it is always added again) imageList = new StrList(listName, IMAGE); string[] filePaths = imageList.ListContent.ToArray(); readImagesIntoDGV(filePaths, imgPathDataGridView); } - } - catch (Exception ex) - { - MessageBox.Show(ex.Message); - } + } private void btnOpen_Click(object sender, EventArgs e) diff --git a/StroopTest/Views/ListsPages/FormImgConfig.resx b/StroopTest/Views/ListsPages/FormImgConfig.resx index ccd92dc..218ac93 100644 --- a/StroopTest/Views/ListsPages/FormImgConfig.resx +++ b/StroopTest/Views/ListsPages/FormImgConfig.resx @@ -297,12 +297,27 @@ True + + Nome do Arquivo + + + 120 + True + + Imagem + + + 120 + True + + Localização + 25, 357 @@ -327,30 +342,6 @@ 11 - - True - - - Nome do Arquivo - - - 120 - - - True - - - Imagem - - - 120 - - - True - - - Localização - Top, Bottom, Left @@ -625,7 +616,7 @@ True - 133, 351 + 133, 337 4, 0, 4, 0 diff --git a/StroopTest/Views/MatchingPages/MatchingExposition.cs b/StroopTest/Views/MatchingPages/MatchingExposition.cs index 7e8d00c..b3a877d 100644 --- a/StroopTest/Views/MatchingPages/MatchingExposition.cs +++ b/StroopTest/Views/MatchingPages/MatchingExposition.cs @@ -138,11 +138,14 @@ public MatchingExposition(string prgName, string participantName, char mark) this.FormBorderStyle = FormBorderStyle.None; this.MaximizeBox = true; this.StartPosition = FormStartPosition.Manual; + ExpositionController.formSecondScreen(this); + InitializeComponent(); startTime = hour + "_" + minutes + "_" + seconds; executingTest.ParticipantName = participantName; executingTest.setProgramInUse(path + "/prg/", prgName); executingTest.Mark = mark; + stimuluControls = new List(); outputFile = outputDataPath + executingTest.ParticipantName + "_" + executingTest.ProgramInUse.ProgramName + ".txt"; startExposition(); diff --git a/StroopTest/Views/ReactionPages/FormReactExposition.cs b/StroopTest/Views/ReactionPages/FormReactExposition.cs index e181ad8..2550a8a 100644 --- a/StroopTest/Views/ReactionPages/FormReactExposition.cs +++ b/StroopTest/Views/ReactionPages/FormReactExposition.cs @@ -75,6 +75,7 @@ public FormReactExposition(string prgName, string participantName, char mark) this.FormBorderStyle = FormBorderStyle.None; this.MaximizeBox = true; this.StartPosition = FormStartPosition.Manual; + ExpositionController.formSecondScreen(this); InitializeComponent(); startTime = hour + "_" + minutes + "_" + seconds; executingTest.ParticipantName = participantName; @@ -715,14 +716,15 @@ private void expositionBW_RunWorkerCompleted(object sender, RunWorkerCompletedEv private void intervalBW_DoWork(object sender, DoWorkEventArgs e) { - ExpositionController.makingFixPoint(executingTest.ProgramInUse.FixPoint, executingTest.ProgramInUse.FixPointColor, - this); + executingTest.InitialTime = DateTime.Now; accumulativeStopWatch.Start(); for (int counter = 0; counter < executingTest.ProgramInUse.NumExpositions && !cancelExposition; counter++) { + ExpositionController.makingFixPoint(executingTest.ProgramInUse.FixPoint, executingTest.ProgramInUse.FixPointColor, + this); currentExposition = counter; //preparing execution expositionBackground(); @@ -832,7 +834,7 @@ private Point randomScreenThreePositions(Size size) /* creates a x and y vector on center of the screen */ private Point centerShapePosition(Size size) { - currentPosition = 0; + currentPosition = 2; StimulusPosition stimulusPosition = new StimulusPosition(ClientSize, size); Point newPoint = stimulusPosition.threePointsPosition(currentPosition); currentPositionOutput = stimulusPosition.CurrentPosition; @@ -1023,11 +1025,11 @@ private Point[] createTrianglePoints() private void intervalBW_ProgressChanged(object sender, ProgressChangedEventArgs e) { - if (exposing) + if (exposing && !cancelExposition) { this.Controls.Add((Control)e.UserState); } - else + else if (!cancelExposition) { this.Controls.Remove((Control)e.UserState); } diff --git a/StroopTest/Views/ReactionPages/FormTRConfig.resx b/StroopTest/Views/ReactionPages/FormTRConfig.resx index 2b1a31a..2d5da26 100644 --- a/StroopTest/Views/ReactionPages/FormTRConfig.resx +++ b/StroopTest/Views/ReactionPages/FormTRConfig.resx @@ -178,7 +178,7 @@ 1 - 399, 391 + 399, 404 3, 2, 3, 2 @@ -397,7 +397,7 @@ 0 - 399, 166 + 399, 179 3, 2, 3, 2 @@ -671,7 +671,7 @@ Ponto: 7 - 399, 283 + 399, 296 3, 2, 3, 2 @@ -782,7 +782,7 @@ Ponto: 2 - 399, 471 + 399, 484 3, 2, 3, 2 @@ -1034,7 +1034,7 @@ Ponto: 7 - 399, 33 + 399, 46 3, 2, 3, 2 @@ -1307,7 +1307,7 @@ Ponto: 7 - 13, 383 + 13, 396 3, 2, 3, 2 @@ -1337,7 +1337,7 @@ Ponto: 6 - 13, 555 + 13, 568 3, 2, 3, 2 @@ -2154,7 +2154,7 @@ Ponto: 25 - 13, 33 + 13, 46 3, 2, 3, 2 @@ -2187,7 +2187,7 @@ Ponto: True - 13, 537 + 13, 550 77, 17 @@ -2274,7 +2274,7 @@ Ponto: 3, 2, 3, 2 - 794, 674 + 794, 686 1 @@ -2298,7 +2298,7 @@ Ponto: Popup - 4, 681 + 4, 696 4, 4, 4, 4 @@ -2331,7 +2331,7 @@ Ponto: Popup - 696, 681 + 696, 696 4, 4, 4, 4 diff --git a/StroopTest/Views/StroopPages/FormExposition.cs b/StroopTest/Views/StroopPages/FormExposition.cs index 2b526a9..db4f4cc 100644 --- a/StroopTest/Views/StroopPages/FormExposition.cs +++ b/StroopTest/Views/StroopPages/FormExposition.cs @@ -55,6 +55,7 @@ public partial class FormExposition : Form private string currentStimulus = "false"; private string currentAudio = "false"; private int wordCounter = 0, colorCounter = 0, audiocounter = 0, subtitlecounter = 0, imageCounter = 0; + /// /// This is the constructor method for stroop test exposition form. /// Program name is the name of the current StroopProgram that wil be executed. @@ -74,6 +75,9 @@ public FormExposition(string prgName, string usrName, char mark) currentTest.Mark = mark; currentTest.InitialDate = DateTime.Now; + + ExpositionController.formSecondScreen(this); + configureCurrentTest(); startExpo(); this.ShowDialog(); @@ -102,10 +106,6 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { runExposition = false; cts.Cancel(); - - this.Close(); - this.Dispose(); - this.DialogResult = DialogResult.Cancel; } return base.ProcessCmdKey(ref msg, keyData); } @@ -296,7 +296,11 @@ private async Task startWordExposition() // starts colored words exposition - cl } catch (TaskCanceledException) { - StroopProgram.writeOutputFile(outputFile, string.Join("\n", outputContent.ToArray())); + if (currentTest.ProgramInUse.AudioCapture) + { + stopRecordingAudio(); + } + finishExposition(); } catch (Exception ex) { @@ -349,7 +353,7 @@ private async Task startWordAudioExposition() catch (TaskCanceledException) { Player.Stop(); - StroopProgram.writeOutputFile(outputFile, string.Join("\n", outputContent.ToArray())); + finishExposition(); } catch (Exception ex) { @@ -537,12 +541,11 @@ private async Task startImageWordExposition() } catch (TaskCanceledException) { - StroopProgram.writeOutputFile(outputFile, string.Join("\n", outputContent.ToArray())); - // beginAudio if (currentTest.ProgramInUse.AudioCapture) { stopRecordingAudio(); } + finishExposition(); } catch (Exception ex) { @@ -636,12 +639,11 @@ private async Task startWordImageExposition() } catch (TaskCanceledException) { - StroopProgram.writeOutputFile(outputFile, string.Join("\n", outputContent.ToArray())); - // beginAudio if (currentTest.ProgramInUse.AudioCapture) { stopRecordingAudio(); } + finishExposition(); } catch (Exception ex) { @@ -716,7 +718,7 @@ private async Task startImageExposition() { stopRecordingAudio(); } - StroopProgram.writeOutputFile(outputFile, string.Join("\n", outputContent.ToArray())); + finishExposition(); } catch (Exception ex) { @@ -757,15 +759,23 @@ private void defineSubPosition(int subtitleLocation) private async Task showInstructions(StroopProgram program, CancellationToken token) { - if (program.InstructionText != null) + try { - instructionLabel.Enabled = true; instructionLabel.Visible = true; - for (int i = 0; i < program.InstructionText.Count; i++) + if (program.InstructionText != null) { - instructionLabel.Text = program.InstructionText[i]; - await Task.Delay(Program.instructionAwaitTime); + instructionLabel.Enabled = true; instructionLabel.Visible = true; + for (int i = 0; i < program.InstructionText.Count; i++) + { + instructionLabel.Text = program.InstructionText[i]; + await Task.Delay(Program.instructionAwaitTime, token); + } + instructionLabel.Enabled = false; instructionLabel.Visible = false; } - instructionLabel.Enabled = false; instructionLabel.Visible = false; + } + catch (TaskCanceledException) + { + this.DialogResult = DialogResult.OK; + Close(); } }