From ab5ede0007f4b7b13a5505786b831f69efbd4410 Mon Sep 17 00:00:00 2001 From: Joseph Perrino <107595901+sei-jperrino@users.noreply.github.com> Date: Thu, 4 Aug 2022 10:23:45 -0400 Subject: [PATCH 1/3] Feedback form options expanded - Select one and multiple choice now supported - Options field created to allow for multiple-choice answer options - Counts added for select one and select all that apply --- src/Gameboard.Api/Features/Feedback/Feedback.cs | 7 +++++++ src/Gameboard.Api/Features/Report/ReportController.cs | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/Gameboard.Api/Features/Feedback/Feedback.cs b/src/Gameboard.Api/Features/Feedback/Feedback.cs index eb399510..2f562e9f 100644 --- a/src/Gameboard.Api/Features/Feedback/Feedback.cs +++ b/src/Gameboard.Api/Features/Feedback/Feedback.cs @@ -38,6 +38,11 @@ public class QuestionTemplate : FeedbackQuestion public int Max { get; set; } public string MinLabel { get; set; } public string MaxLabel { get; set; } + + // For 'selectOne' and 'selectAllThatApply' type questions only + public string[] Options { get; set; } + // Display type + public string Display { get; set; } } public class GameFeedbackTemplate @@ -111,6 +116,8 @@ public class FeedbackStats public int ConfiguredCount { get; set; } public int LikertCount { get; set; } public int TextCount { get; set; } + public int SelectOneCount { get; set; } + public int SelectAllThatApplyCount { get; set;} public int RequiredCount { get; set; } public int ResponsesCount { get; set; } public int MaxResponseCount { get; set; } diff --git a/src/Gameboard.Api/Features/Report/ReportController.cs b/src/Gameboard.Api/Features/Report/ReportController.cs index 89929aec..2dcb12f0 100644 --- a/src/Gameboard.Api/Features/Report/ReportController.cs +++ b/src/Gameboard.Api/Features/Report/ReportController.cs @@ -471,6 +471,8 @@ public async Task> GetFeedbackStats([FromQuery] Feed ConfiguredCount = questionTemplate.Length, LikertCount = questionTemplate.Where(q => q.Type == "likert").Count(), TextCount = questionTemplate.Where(q => q.Type == "text").Count(), + SelectOneCount = questionTemplate.Where(q => q.Type == "selectOne").Count(), + SelectAllThatApplyCount = questionTemplate.Where(q => q.Type == "selectAllThatApply").Count(), RequiredCount = questionTemplate.Where(q => q.Required).Count(), ResponsesCount = feedback.Length, MaxResponseCount = maxResponses, From dc4c405285b7db6720ba1b27798fc6d19e08ed32 Mon Sep 17 00:00:00 2001 From: Joseph Perrino <107595901+sei-jperrino@users.noreply.github.com> Date: Thu, 4 Aug 2022 20:47:44 -0400 Subject: [PATCH 2/3] Specifications for a question created - Questions can now have a value called specify, which allows one field in a question to have a text box to pop up when selected - key specified in yaml says which option in the question allows this - prompt specified in yaml determines what "flavor text" to show in addition to the option (i.e. if no, "What could we have done differently?") --- src/Gameboard.Api/Features/Feedback/Feedback.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Gameboard.Api/Features/Feedback/Feedback.cs b/src/Gameboard.Api/Features/Feedback/Feedback.cs index 2f562e9f..40080786 100644 --- a/src/Gameboard.Api/Features/Feedback/Feedback.cs +++ b/src/Gameboard.Api/Features/Feedback/Feedback.cs @@ -43,6 +43,8 @@ public class QuestionTemplate : FeedbackQuestion public string[] Options { get; set; } // Display type public string Display { get; set; } + // Specification for a certain answer + public QuestionSpecify Specify { get; set; } } public class GameFeedbackTemplate @@ -141,4 +143,10 @@ public class QuestionStats public int Highest { get; set; } // highest rating given } + public class QuestionSpecify + { + public string Key { get; set; } + public string Prompt { get; set; } + } + } From e64f9bbe42fe4ddfbc498e5c1488653bded7df7b Mon Sep 17 00:00:00 2001 From: Joseph Perrino <107595901+sei-jperrino@users.noreply.github.com> Date: Fri, 5 Aug 2022 09:45:10 -0400 Subject: [PATCH 3/3] selectAllThatApply changed to selectMany --- src/Gameboard.Api/Features/Feedback/Feedback.cs | 4 ++-- src/Gameboard.Api/Features/Report/ReportController.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Gameboard.Api/Features/Feedback/Feedback.cs b/src/Gameboard.Api/Features/Feedback/Feedback.cs index 40080786..a5a289cb 100644 --- a/src/Gameboard.Api/Features/Feedback/Feedback.cs +++ b/src/Gameboard.Api/Features/Feedback/Feedback.cs @@ -39,7 +39,7 @@ public class QuestionTemplate : FeedbackQuestion public string MinLabel { get; set; } public string MaxLabel { get; set; } - // For 'selectOne' and 'selectAllThatApply' type questions only + // For 'selectOne' and 'selectMany' type questions only public string[] Options { get; set; } // Display type public string Display { get; set; } @@ -119,7 +119,7 @@ public class FeedbackStats public int LikertCount { get; set; } public int TextCount { get; set; } public int SelectOneCount { get; set; } - public int SelectAllThatApplyCount { get; set;} + public int SelectManyCount { get; set;} public int RequiredCount { get; set; } public int ResponsesCount { get; set; } public int MaxResponseCount { get; set; } diff --git a/src/Gameboard.Api/Features/Report/ReportController.cs b/src/Gameboard.Api/Features/Report/ReportController.cs index 2dcb12f0..f1abe306 100644 --- a/src/Gameboard.Api/Features/Report/ReportController.cs +++ b/src/Gameboard.Api/Features/Report/ReportController.cs @@ -472,7 +472,7 @@ public async Task> GetFeedbackStats([FromQuery] Feed LikertCount = questionTemplate.Where(q => q.Type == "likert").Count(), TextCount = questionTemplate.Where(q => q.Type == "text").Count(), SelectOneCount = questionTemplate.Where(q => q.Type == "selectOne").Count(), - SelectAllThatApplyCount = questionTemplate.Where(q => q.Type == "selectAllThatApply").Count(), + SelectManyCount = questionTemplate.Where(q => q.Type == "selectMany").Count(), RequiredCount = questionTemplate.Where(q => q.Required).Count(), ResponsesCount = feedback.Length, MaxResponseCount = maxResponses,