Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback enhancements - more feedback options added #46

Merged
merged 3 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Gameboard.Api/Features/Feedback/Feedback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public class QuestionTemplate : FeedbackQuestion
public int Max { get; set; }
public string MinLabel { get; set; }
public string MaxLabel { get; set; }

// For 'selectOne' and 'selectMany' type questions only
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
Expand Down Expand Up @@ -111,6 +118,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 SelectManyCount { get; set;}
public int RequiredCount { get; set; }
public int ResponsesCount { get; set; }
public int MaxResponseCount { get; set; }
Expand All @@ -134,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; }
}

}
2 changes: 2 additions & 0 deletions src/Gameboard.Api/Features/Report/ReportController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ public async Task<ActionResult<FeedbackStats>> 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(),
SelectManyCount = questionTemplate.Where(q => q.Type == "selectMany").Count(),
RequiredCount = questionTemplate.Where(q => q.Required).Count(),
ResponsesCount = feedback.Length,
MaxResponseCount = maxResponses,
Expand Down