Commit 72b3fd63 by 霍志良

feat:选择题修改

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