feat: add check to chosen answer

This commit is contained in:
Anna 2023-11-17 13:25:30 -05:00
parent 3272066a67
commit 4e8e33fe60
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 11 additions and 1 deletions

View File

@ -28,6 +28,11 @@ internal class FullQuestion : IQuestion {
/// </summary>
public required ulong[] Responses { get; init; }
/// <summary>
/// The response given by the user, if any.
/// </summary>
public required ushort? Response { get; init; }
internal void DrawResponses() {
this.DrawTable(this.Responses);
}
@ -50,7 +55,12 @@ internal class FullQuestion : IQuestion {
for (var i = 0; i < responses.Length && i < this.Answers.Length; i++) {
ImGui.TableNextRow();
ImGui.TableNextColumn();
ImGui.TextUnformatted(this.Answers[i]);
var answer = this.Answers[i];
if (this.Response == i) {
answer += " \u2713";
}
ImGui.TextUnformatted(answer);
ImGui.TableNextColumn();
// ReSharper disable once PossiblyMistakenUseOfInterpolatedStringInsert