-
public final class CfLogQuestionEvent.BuilderCfLogQuestionEvent is required to log user answers to the questions. To log this event you need to provide the question Id that User has attempted and also the id for the answer the user has selected.
-
-
Field Summary
Fields Modifier and Type Field Description private StringquestionIdValueprivate StringexamIdValueprivate StringactionValueprivate StringanswerIdValue
-
Method Summary
Modifier and Type Method Description final StringgetQuestionIdValue()final UnitsetQuestionIdValue(String questionIdValue)final StringgetExamIdValue()final UnitsetExamIdValue(String examIdValue)final StringgetActionValue()final UnitsetActionValue(String actionValue)final StringgetAnswerIdValue()final UnitsetAnswerIdValue(String answerIdValue)final <ERROR CLASS>setQuestionId(String questionId)setQuestionId is required to log questionId for the Question on which user has attempted. final <ERROR CLASS>setExamId(String examId)setExamId is required to log exam_id for the exam the Question belongs to. final <ERROR CLASS>setQuestionAction(QuestionAction action)setQuestionAction is required to set the Action type for the Question event. final <ERROR CLASS>setQuestionAction(String action)setQuestionAction is required to set the Action type for the Question event. final <ERROR CLASS>setAnswerId(String answerId)setAnswerId is required to log answerId for the answer provided by the user for the Question on which user has attempted. final <ERROR CLASS>setMeta(Object meta)You can pass any type of value in setMeta. final <ERROR CLASS>updateImmediately(Boolean updateImmediately)updateImmediately is responsible for updating the values ot the backend immediately. final <ERROR CLASS>build()build will validate all of the values provided and if passes will call the track function and queue the events based on it's updateImmediately value and also on the user's network resources. -
-
Method Detail
-
getQuestionIdValue
final String getQuestionIdValue()
-
setQuestionIdValue
final Unit setQuestionIdValue(String questionIdValue)
-
getExamIdValue
final String getExamIdValue()
-
setExamIdValue
final Unit setExamIdValue(String examIdValue)
-
getActionValue
final String getActionValue()
-
setActionValue
final Unit setActionValue(String actionValue)
-
getAnswerIdValue
final String getAnswerIdValue()
-
setAnswerIdValue
final Unit setAnswerIdValue(String answerIdValue)
-
setQuestionId
final <ERROR CLASS> setQuestionId(String questionId)
setQuestionId is required to log questionId for the Question on which user has attempted. Question Id should be in a string format and must be in accordance to the catalog provided.
-
setExamId
final <ERROR CLASS> setExamId(String examId)
setExamId is required to log exam_id for the exam the Question belongs to. exam_id should be in a string format and must be in accordance to the catalog provided.
-
setQuestionAction
final <ERROR CLASS> setQuestionAction(QuestionAction action)
setQuestionAction is required to set the Action type for the Question event. SDK provides enum classes to support available log types. 2 main are answer and skip. SDK provides 2 approaches to log this event, one being enum type and the other is string type. Below is the function to log type using enum.
-
setQuestionAction
final <ERROR CLASS> setQuestionAction(String action)
setQuestionAction is required to set the Action type for the Question event. SDK provides enum classes to support available log types. 2 main are answer and skip. SDK provides 2 approaches to log this event, one being enum type and the other is string type. Below is the function to log type using string. Remember to note that values provided using string should be the same as provided in enum or else the events will be discarded.
-
setAnswerId
final <ERROR CLASS> setAnswerId(String answerId)
setAnswerId is required to log answerId for the answer provided by the user for the Question on which user has attempted. Answer Id should be in a string format and must be in accordance to the catalog provided.
-
setMeta
final <ERROR CLASS> setMeta(Object meta)
You can pass any type of value in setMeta. It is for developer and partners to log additional information with the log that they find would be helpful for logging and providing more context to the log. Default value for the meta is null.
-
updateImmediately
final <ERROR CLASS> updateImmediately(Boolean updateImmediately)
updateImmediately is responsible for updating the values ot the backend immediately. By default this is set to false or whatever the developer has set in the SDK initialisation block. This differs the time for which the logs will be logged, if true, the SDK will log the content instantly and if false it will wait till the end of user session which is whenever the app goes into background.
-
build
final <ERROR CLASS> build()
build will validate all of the values provided and if passes will call the track function and queue the events based on it's updateImmediately value and also on the user's network resources.
-
-
-
-