Skip to content

Commit

Permalink
minor code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aditydcp committed Jun 11, 2023
1 parent 6be2db0 commit 3eb9237
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions TestSuiteWpf/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void ResetBlockData()
/// </summary>
public static void SaveSubjectData()
{
string path = ConfigurationManager.AppSettings.Get("RunDataPath") + "SubjectRecords.csv";
string path = ConfigurationManager.AppSettings.Get("RunDataPath") + "SubjectRecords_Trier.csv";
//var hollow = new { something = string.Empty }; // needed to make extra space in the file
List<RecordSubject> subject = new()
{
Expand Down Expand Up @@ -118,7 +118,7 @@ public static void SaveRunData(string filename = "default")
}

var path = ConfigurationManager.AppSettings.Get("RunDataPath");
using var writer = new StreamWriter(path + filename + ".csv");
using var writer = new StreamWriter(path + filename + "_Trier.csv");
using var csv = new CsvWriter(writer, CultureInfo.InvariantCulture);
csv.WriteRecords(records);
}
Expand Down
9 changes: 9 additions & 0 deletions TestSuiteWpf/Controllers/BlockViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ public void SubmitAnswer(int answer)
}
}

/// <summary>
/// Start necessary initial timers
/// </summary>
public void StartBlock()
{
StartBlockTimer();
StartQuestionTimer();
}

private void FinishBlock()
{
StopAllTimer();
Expand Down
6 changes: 4 additions & 2 deletions TestSuiteWpf/Pages/BlockView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ private void OnPageLoaded(object sender, RoutedEventArgs e)
controller = new BlockViewController(this);
ControlButtons();
controller.ControlView();
controller.StartBlockTimer();
controller.StartQuestionTimer();
controller.StartBlock();

// debug only
window = App.FindParentOfType<MainWindow>(this) as MainWindow;
Expand Down Expand Up @@ -59,6 +58,7 @@ public void FinishBlock()
NavigationService.Navigate(new BlockResult());
}

#region UI Setters
public void SetScoreText(string score) { ScoreLabel.Text = score; }
public void SetScoreText(int score) { ScoreLabel.Text = score.ToString(); }

Expand All @@ -75,6 +75,7 @@ public void ShowFeedback(bool show)
else { FeedbackContainer.Visibility = Visibility.Collapsed; }
}

// debug only
public void SetBlockTimerText(string timeString) { BlockTimerLabel.Text = timeString; }

/// <summary>
Expand Down Expand Up @@ -175,5 +176,6 @@ private void ControlButtons()
verticalScaleFactor * 2
);
}
#endregion
}
}

0 comments on commit 3eb9237

Please sign in to comment.