Validate Demographic Responses - ReconoSERID/SDK-ReconoSERID-Android GitHub Wiki
Validate Demographic Responses** ### Validate Demographics Responses ###
Method to validate that the answers sent by the citizen are those expected to process a score (SCORE) and to determine if the expected to process a score (SCORE) and determine if the validation is ok. validation is OK.
#!java
public void validarRespuestaDemograficas(@NotNull ValidarRespuestaIn validarRespuestaDemografica, @NotNull CallbackValidateResponse listener)
Receives as input parameters a class ValidarRespuestaIn and a CallbackValidateResponse
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
CallbackValidateResponseIn | Object | IF | |
CallbackValidateResponse | Callback | YES | Returns a ValidateResponseDemographicResponse and ResponseTransaction |
Parameters ValidateResponseIn
Parameter | Type | Required | Description |
---|---|---|---|
guidCiudadano | String | SI | Citizen's identifier. |
idQuestionnaire | String | String | SI |
questionnaireRegistration | int | SI | SI |
ResponsesIn | List | SI | Responses to validate. |
#!java
public ValidarRespuestaIn(String guidCiudadano, //It is the citizen's identifier.
String idQuestionnaire, //It is the identifier of the questionnaire.
int registroCuestionario, //It is the registration number of the questionnaire.
List<RespuestasIn> respuestas) //Responses to validate.
Parameters ResponsesIn
Parameter | Type | Required | Description |
---|---|---|---|
idQuestionId | String | IF | Is the identifier of the question. |
idAnswer | String | String | IF |
#!java
public RespuestasIn(String idPregunta, //It is the identifier of the question.
String idAnswer) //Is the identifier of the answer.
And it receives a class ValidarRespuestaDemografica
Parameters ValidarRespuestaDemografica
Parameter | Type | Description |
---|---|---|
score | String | Is the maximum score according to validation |
Valid isValid | String | Is the acceptance or not of the validation. |
errorTransaction | List | Additional data |
| String | String | String
public ValidarRespuestaDemografica(String score, //It is the maximum score according to the validation.
boolean isValid, //It is the acceptance or not of the validation.
TransactionResponse transactionResponseTransaction) //Transaction response
e.g:
#!java
ServicesOlimpia.getInstance().validarRespuestaDemograficas(repuesta, new OlimpiaInterface.CallbackValidateResponse() {
@Override
public void onSuccess(ValidateResponseDemographicResponse validateResponse) {
//
}
@Override
public void onError(TransactionResponse transactionResponse) {
//
}
});