Commit 72b3fd63 by 霍志良

feat:选择题修改

parent 4b9462e5
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03",
"m-user" : "0.0.61.37",
"m-home" : "0.0.22.67",
"m-im" : "0.0.19.36",
"m-im" : "0.0.19.37",
"m-dynamic" : "0.0.7.24",
"m-article" : "0.0.0.10",
......@@ -93,7 +93,7 @@ ext {
"m-fm" : "0.0.30.01",
"m-user" : "0.0.61.37",
"m-home" : "0.0.22.67",
"m-im" : "0.0.19.36",
"m-im" : "0.0.19.37",
"m-dynamic" : "0.0.7.24",
"m-article" : "0.0.0.8",
......
......@@ -9,10 +9,12 @@ import java.util.ArrayList;
public class CustomAttachLingxiAnswerQuestion extends CustomAttachment{
private final String ANSWERS = "answers";
private final String QUESTIONID = "questionId";
private final String EXAMID = "examId";
public ArrayList<QuestionItemBean> answers;
public String questionId;
public String examId;
public CustomAttachLingxiAnswerQuestion() {
super(CustomAttachmentType.TYPE_LINGXI_ANSWER_QUESTION);
......@@ -21,6 +23,7 @@ public class CustomAttachLingxiAnswerQuestion extends CustomAttachment{
protected void parseData(JSONObject data) {
this.answers=(ArrayList<QuestionItemBean>) JSON.parseArray(data.getString(ANSWERS), QuestionItemBean.class);
this.questionId = data.getString(QUESTIONID);
this.examId = data.getString(EXAMID);
}
@Override
......@@ -28,6 +31,7 @@ public class CustomAttachLingxiAnswerQuestion extends CustomAttachment{
JSONObject data = new JSONObject();
data.put(ANSWERS, answers);
data.put(QUESTIONID, questionId);
data.put(EXAMID, examId);
return data;
}
}
......@@ -25,7 +25,6 @@ import com.yidianling.im.router.ImIn;
import com.yidianling.im.session.extension.CustomAttachLingxiAnswerQuestion;
import com.yidianling.im.session.extension.CustomAttachLingxiWhichQuestion;
import com.yidianling.im.session.viewholder.adapter.AdapterLingxiMultipleChoice;
import com.yidianling.im.session.viewholder.adapter.AdapterLingxiWhichQuestion;
import com.yidianling.im.session.viewholder.bean.AnswerBean;
import com.yidianling.im.session.viewholder.bean.AnswersItem;
import com.yidianling.im.session.viewholder.bean.LingxiAnswerBean;
......@@ -69,7 +68,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
private ArrayList<AnswersItem> answersItems = new ArrayList<>();
Map<String, Object> mapMessageFromCustom;
Map map1 = new HashMap();
private ArrayList<String> answeredExamid=new ArrayList<>();
public MsgViewHolderLingxiWhichQuestion(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
}
......@@ -127,13 +126,10 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
MsgAttachment attachment = msg.getAttachment();
if (attachment instanceof CustomAttachLingxiAnswerQuestion) {
CustomAttachLingxiAnswerQuestion customattachlingxianswerquestion = (CustomAttachLingxiAnswerQuestion) attachment;
map1.put(customattachlingxianswerquestion.questionId, true);
map1.put(customattachlingxianswerquestion.questionId+customattachlingxianswerquestion.examId, true);
mapMessageFromCustom=map1;
UpdateFromLocalExtention();
LogUtil.e("aaaaaquestionID:"+customattachlingxianswerquestion.questionId);
}else{
//用户没有回答问题;
}
}
}
......@@ -154,17 +150,12 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
private void UpdateFromLocalExtention() {
try {
Map<String, Object> mapMessage;
Map<String, Object> mapMessage = new HashMap<>();
if (mapMessageFromCustom!=null){
mapMessage=mapMessageFromCustom;
}else{
mapMessage= message.getLocalExtension();
}
if (mapMessage != null) {
Object questionPaperId=mapMessage.get(customAttachLingxiWhichQuestion.id);
LogUtil.e("aaaaaIDIDI:"+customAttachLingxiWhichQuestion.id);
Object questionPaperId=mapMessage.get(customAttachLingxiWhichQuestion.id+customAttachLingxiWhichQuestion.examId);
if (questionPaperId != null) {
boolean b = (boolean) questionPaperId;
if (b) {
......@@ -176,7 +167,6 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
confirm_multiple_choice.setVisibility(View.VISIBLE);
}
}else{
//隐藏回答的信息
if (singleOrMultipletype.contains("radio")){
recycleviewMultipleChoice.setVisibility(View.VISIBLE);
}else{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment