Class QuizService
java.lang.Object
sk.iway.iwcm.components.quiz.rest.QuizService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<QuizEntity>
getAll()
static QuizEntity
getById
(int id) GET data methodsstatic List<QuizQuestionEntity>
getQuizQuestions
(int quizId) static Map<Integer,
QuizQuestionEntity> getQuizQuestionsMap
(int quizId) static List<QuizAnswerEntity>
saveAnswersAndGetResult
(int quizId, String formId, List<NameValueBean> answers) SAVE data methodstatic Map<String,
List<QuizStatDTO>> statLineData
(Integer quizId, String dateRange, String quizType, QuizAnswerRespository quizAnswerRespository, Prop prop) static List<QuizStatDTO>
statTableData
(Integer quizId, String stringRange, ChartType chartType, QuizAnswerRespository quizAnswerRespository) Prepare list of QuizStatDTO entities (for chart), where every entity represents one question and has compute number of right/wrong answers for selected date range via "stringRange".
-
Constructor Details
-
QuizService
public QuizService()
-
-
Method Details
-
getById
GET data methods -
getAll
-
getQuizQuestions
-
getQuizQuestionsMap
-
saveAnswersAndGetResult
public static List<QuizAnswerEntity> saveAnswersAndGetResult(int quizId, String formId, List<NameValueBean> answers) SAVE data method -
statTableData
public static List<QuizStatDTO> statTableData(Integer quizId, String stringRange, ChartType chartType, QuizAnswerRespository quizAnswerRespository) Prepare list of QuizStatDTO entities (for chart), where every entity represents one question and has compute number of right/wrong answers for selected date range via "stringRange".- Parameters:
quizId
- - QuizEntity idstringRange
- - clasic string rangechartType
-quizAnswerRespository
-- Returns:
- if any error occur, return empty list
-
statLineData
public static Map<String,List<QuizStatDTO>> statLineData(Integer quizId, String dateRange, String quizType, QuizAnswerRespository quizAnswerRespository, Prop prop)
-