问卷调查优化
parent
2aa64192a4
commit
84104a5971
|
@ -40,7 +40,7 @@ public class GetQuestionRequestHandler extends BaseHandler<PlayerInfoProto.GetQu
|
|||
}
|
||||
List<CommonProto.QuestionOptions> list = new ArrayList<>();
|
||||
question.getcQuestionOptionBeans().forEach(cQuestionOptionBean -> {
|
||||
list.add(CommonProto.QuestionOptions.newBuilder().setContent(cQuestionOptionBean.getContent()).setType(cQuestionOptionBean.getType()).addAllOptions(Arrays.asList(cQuestionOptionBean.getOptions())).build());
|
||||
list.add(CommonProto.QuestionOptions.newBuilder().setContent(cQuestionOptionBean.getContent()).setAnswerType(cQuestionOptionBean.getAnswerType()).setType(cQuestionOptionBean.getType()).addAllOptions(Arrays.asList(cQuestionOptionBean.getOptions())).build());
|
||||
});
|
||||
|
||||
GlobalSystemControl.save(globalSystemControl);
|
||||
|
|
|
@ -39,11 +39,11 @@ public class UpdateQuestionRequestHandler extends BaseHandler<PlayerInfoProto.up
|
|||
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.UPDATE_QUESTION_RESPONSE_VALUE, "");
|
||||
return;
|
||||
}
|
||||
if (proto.getOptionsCount() != question.getcQuestionOptionBeans().size()) {
|
||||
PlayerInfoProto.upDataQuestionResponse.Builder builder = PlayerInfoProto.upDataQuestionResponse.newBuilder();
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.UPDATE_QUESTION_RESPONSE_VALUE, builder.setResult(-1).build(), true);
|
||||
return;
|
||||
}
|
||||
// if (proto.getOptionsCount() != question.getcQuestionOptionBeans().size()) {
|
||||
// PlayerInfoProto.upDataQuestionResponse.Builder builder = PlayerInfoProto.upDataQuestionResponse.newBuilder();
|
||||
// MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.UPDATE_QUESTION_RESPONSE_VALUE, builder.setResult(-1).build(), true);
|
||||
// return;
|
||||
// }
|
||||
user.getQuestionManager().addQuestion(question.getId(),proto.getOptionsList());
|
||||
|
||||
//移除过剩问卷答案
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.question;
|
|||
|
||||
public class CQuestionOptionBean {
|
||||
private String content = "";
|
||||
private int answerType;
|
||||
private int type;
|
||||
private String[] options ;
|
||||
|
||||
|
@ -35,5 +36,13 @@ public class CQuestionOptionBean {
|
|||
public void setOptions(String[] options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
public int getAnswerType() {
|
||||
return answerType;
|
||||
}
|
||||
|
||||
public void setAnswerType(int answerType) {
|
||||
this.answerType = answerType;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue