Class MultiQuestionPresenter<T extends MultiQuestionView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<T>
-
- com.cheetahdigital.challenges.ui.responses.base.ChallengeResponsePresenter<T>
-
- com.cheetahdigital.challenges.ui.responses.multiquestion.MultiQuestionPresenter<T>
-
- All Implemented Interfaces:
MvpPresenter<T>
public class MultiQuestionPresenter<T extends MultiQuestionView> extends ChallengeResponsePresenter<T>
Presenter used by different Challenge response activities
-
-
Constructor Summary
Constructors Constructor Description MultiQuestionPresenter(java.lang.String id, java.lang.String responseId, MultiQuestionResponseSetting responseSetting)
Create the presenter with defaultChallengeParams
MultiQuestionPresenter(java.lang.String id, java.lang.String responseId, MultiQuestionResponseSetting responseSetting, ChallengeParams params)
Create the presenter with a givenChallengeParams
MultiQuestionPresenter(java.lang.String id, java.lang.String responseId, ViewContentResponseSetting responseSetting)
Create the presenter with defaultChallengeParams
.MultiQuestionPresenter(java.lang.String id, java.lang.String responseId, ViewContentResponseSetting responseSetting, ChallengeParams params)
Create the presenter with a givenChallengeParams
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected okhttp3.RequestBody
getRequestBody(java.lang.String json)
Get Request Bodyvoid
init()
Initialize theMultiQuestionView
protected java.lang.String
serialize(java.util.List<Answer> answers)
Serialize list ofAnswer
void
submitAnswers(java.util.List<Answer> answers)
Submit answers to MultiQuestion challenge-
Methods inherited from class com.cheetahdigital.challenges.ui.responses.base.ChallengeResponsePresenter
getChallengesAPI, getRespondListener, onRespondFailed, onRespondSuccess, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter
attachView, detachView, getView
-
-
-
-
Constructor Detail
-
MultiQuestionPresenter
public MultiQuestionPresenter(java.lang.String id, java.lang.String responseId, MultiQuestionResponseSetting responseSetting)
Create the presenter with defaultChallengeParams
- Parameters:
id
- challenge idresponseId
- response idresponseSetting
- instance ofMultiQuestionResponseSetting
-
MultiQuestionPresenter
public MultiQuestionPresenter(java.lang.String id, java.lang.String responseId, ViewContentResponseSetting responseSetting)
Create the presenter with defaultChallengeParams
. This is used for displaying a quiz from view content challenge.- Parameters:
id
- challenge idresponseId
- response idresponseSetting
- instance ofViewContentResponseSetting
-
MultiQuestionPresenter
public MultiQuestionPresenter(java.lang.String id, java.lang.String responseId, MultiQuestionResponseSetting responseSetting, ChallengeParams params)
Create the presenter with a givenChallengeParams
- Parameters:
id
- challenge idresponseId
- response idresponseSetting
- instance ofMultiQuestionResponseSetting
params
- theChallengeParams
-
MultiQuestionPresenter
public MultiQuestionPresenter(java.lang.String id, java.lang.String responseId, ViewContentResponseSetting responseSetting, ChallengeParams params)
Create the presenter with a givenChallengeParams
. This is used for displaying a quiz from view content challenge.- Parameters:
id
- challenge idresponseId
- response idresponseSetting
- instance ofViewContentResponseSetting
params
- theChallengeParams
-
-
Method Detail
-
init
public void init()
Initialize theMultiQuestionView
-
submitAnswers
public void submitAnswers(java.util.List<Answer> answers)
Submit answers to MultiQuestion challenge- Parameters:
answers
- list ofAnswer
-
getRequestBody
@NotNull protected okhttp3.RequestBody getRequestBody(java.lang.String json)
Get Request Body- Parameters:
json
- value stored in body- Returns:
- instance of
RequestBody
-
-