...
|
...
|
@@ -74,7 +74,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
LinearLayout linTab;
|
|
|
@BindView(R.id.rl_card)
|
|
|
RelativeLayout rlCard;
|
|
|
// @BindView(R.id.right_select)
|
|
|
// @BindView(R.id.right_select)
|
|
|
// TextView rightSelect;
|
|
|
// @BindView(R.id.right_answer)
|
|
|
// TextView rightAnswerText;
|
...
|
...
|
@@ -82,7 +82,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
// RelativeLayout rlAnswer;
|
|
|
@BindView(R.id.commit)
|
|
|
LinearLayout commit;
|
|
|
// @BindView(R.id.tv2)
|
|
|
// @BindView(R.id.tv2)
|
|
|
// TextView tv2;
|
|
|
@BindView(R.id.tv_show_card)
|
|
|
TextView tvShowCard;
|
...
|
...
|
@@ -108,7 +108,6 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
private List<String> historyAnswer = new ArrayList<>();//存放历史选择的答案
|
|
|
private List<String> listRightAnswer = new ArrayList<>();
|
|
|
private boolean isRight;
|
|
|
private int unDone;//未完成的题
|
|
|
private int danxuanCount;
|
|
|
private int duoxuanCount;
|
|
|
private int panduanCount;
|
...
|
...
|
@@ -121,6 +120,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
private double panduan;
|
|
|
private int longTime;
|
|
|
private int thisTime;
|
|
|
private int unDone;
|
|
|
private CountDownTimer timer;
|
|
|
|
|
|
|
...
|
...
|
@@ -185,23 +185,29 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
|
|
|
} else if (!rightAnswer.contains(selectAnswer)) {
|
|
|
|
|
|
if (type.equals("单选")) {
|
|
|
danxuanWrong++;
|
|
|
} else if (type.equals("判断")) {
|
|
|
panduanWrong++;
|
|
|
}
|
|
|
|
|
|
wrongCount++;
|
|
|
tvWrongNum.setText(String.valueOf(wrongCount));
|
|
|
|
|
|
statusList.set(listIndex, 2);
|
|
|
sheetGridAdapter.notifyDataSetChanged();
|
|
|
|
|
|
String questionOid = questionLst.get(listIndex).getQuestionOid();
|
|
|
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
|
|
|
try {
|
|
|
String questionOid = questionLst.get(listIndex).getQuestionOid();
|
|
|
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
text.setTextColor(getResources().getColor(R.color.color_ff5400));
|
|
|
option.setTextColor(getResources().getColor(R.color.color_ff5400));
|
|
|
|
|
|
if (type.contains("单选")) {
|
|
|
danxuanWrong++;
|
|
|
} else if (type.contains("判断")) {
|
|
|
panduanWrong++;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
@@ -262,8 +268,11 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
statusList.set(listIndex, 2);
|
|
|
sheetGridAdapter.notifyDataSetChanged();
|
|
|
|
|
|
String questionOid = questionLst.get(listIndex).getQuestionOid();
|
|
|
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
|
|
|
try {
|
|
|
String questionOid = questionLst.get(listIndex).getQuestionOid();
|
|
|
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
|
|
|
} catch (Exception e) {
|
|
|
}
|
|
|
|
|
|
/* optionsAdapter.setRight(rightAnswer);
|
|
|
optionsAdapter.notifyDataSetChanged();*/
|
...
|
...
|
@@ -289,6 +298,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
|
|
|
}
|
|
|
}
|
|
|
historyAnswer.set(listIndex, selectAnswer);
|
|
|
}
|
|
|
|
|
|
});
|
...
|
...
|
@@ -360,6 +370,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
|
|
|
for (AnswerBean.QuestionLstBean a : questionLst) {
|
|
|
statusList.add(0);
|
|
|
historyAnswer.add("0");
|
|
|
}
|
|
|
sheetGridAdapter = new AnswerSheetGridAdapter(statusList, this);
|
|
|
|
...
|
...
|
@@ -388,6 +399,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
intent.putExtra("panduanWrong", panduanCount);
|
|
|
intent.putExtra("duoxuanWrong", duoxuanCount);
|
|
|
intent.putExtra("totalScore", totalScore);
|
|
|
intent.putExtra("time", thisTime);
|
|
|
startActivity(intent);
|
|
|
b.this.finish();
|
|
|
} else {
|
...
|
...
|
@@ -411,6 +423,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
intent.putExtra("panduanWrong", panduanWrong);
|
|
|
intent.putExtra("duoxuanWrong", duoxuanWrong);
|
|
|
intent.putExtra("totalScore", totalScore);
|
|
|
intent.putExtra("time", thisTime);
|
|
|
startActivity(intent);
|
|
|
b.this.finish();
|
|
|
}
|
...
|
...
|
@@ -422,7 +435,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
|
|
|
private void doRefresh(boolean isNext) {
|
|
|
|
|
|
historyAnswer.add(selectAnswer);
|
|
|
// historyAnswer.add(selectAnswer);
|
|
|
listRightAnswer.add(rightAnswer);
|
|
|
|
|
|
integerList.clear();
|
...
|
...
|
@@ -441,12 +454,19 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
// rightAnswerText.setText(questionLst.get(listIndex).getWrongAnaly());
|
|
|
// rlAnswer.setVisibility(View.GONE);
|
|
|
|
|
|
optionsAdapter = new ListAnswerAdapter(questionLst.get(listIndex).getOptionsLst(), this);
|
|
|
optionsAdapter = new ListAnswerAdapter(questionLst.get(listIndex).getOptionsLst(), this);
|
|
|
listAnswer.setAdapter(optionsAdapter);
|
|
|
optionsAdapter.notifyDataSetChanged();
|
|
|
|
|
|
|
|
|
if (historyAnswer.size() > listIndex) {
|
|
|
if (listIndex == questionLst.size() - 1) {
|
|
|
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
|
|
|
tvShowCard.setVisibility(View.GONE);
|
|
|
commit.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
|
|
|
|
|
|
if (!historyAnswer.get(listIndex).equals("0")) {
|
|
|
optionsAdapter.setSelect(historyAnswer.get(listIndex));
|
|
|
optionsAdapter.notifyDataSetInvalidated();
|
|
|
|
...
|
...
|
@@ -502,7 +522,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
circular.setBackWidth(20);
|
|
|
circular.setProgWidth(20);
|
|
|
circular.setMaxProgress(questionLst.size());
|
|
|
circular.setProgress(questionLst.size()-laveCount);
|
|
|
circular.setProgress(questionLst.size() - laveCount);
|
|
|
|
|
|
count.setText(String.valueOf(laveCount));
|
|
|
|
...
|
...
|
@@ -531,9 +551,21 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
intent.putExtra("panduanWrong", panduanWrong);
|
|
|
intent.putExtra("duoxuanWrong", duoxuanWrong);
|
|
|
intent.putExtra("totalScore", totalScore);
|
|
|
intent.putExtra("time", thisTime);
|
|
|
|
|
|
Log.e("zhangtao", totalScore + "分");
|
|
|
Log.e("zhangtao:catalogOid", catalogOid + "");
|
|
|
Log.e("zhangtao:danxuanCount", danxuanCount + "分");
|
|
|
Log.e("zhangtao:duoxuanCount", duoxuanCount + "分");
|
|
|
Log.e("zhangtao:panduanCount", panduanCount + "分");
|
|
|
Log.e("zhangtao;danxuanWrong", danxuanWrong + "分");
|
|
|
Log.e("zhangtao;danxuanWrong", duoxuanWrong + "分");
|
|
|
startActivity(intent);
|
|
|
startActivity(intent);
|
|
|
startActivity(intent);
|
|
|
b.this.finish();
|
|
|
|
|
|
mPresenter.getPresenter(10, 1, accountOid, catalogOid, String.valueOf(totalScore), String.valueOf(unDone), String.valueOf(thisTime));
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -582,7 +614,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
case R.id.rl_next:
|
|
|
if (listIndex < questionLst.size() - 1) {
|
|
|
|
|
|
if (type.contains("多选")) {
|
|
|
if (!TextUtils.isEmpty(selectAnswer) && type.contains("多选")) {
|
|
|
if (selectAnswer.length() != rightAnswer.length()) {
|
|
|
statusList.set(listIndex, 2);
|
|
|
}
|
...
|
...
|
@@ -593,10 +625,20 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
unDone++;
|
|
|
wrongCount++;
|
|
|
statusList.set(listIndex, 0);
|
|
|
} else if (listIndex <= questionLst.size() - 1) {
|
|
|
if (type.contains("单选")) {
|
|
|
danxuanWrong++;
|
|
|
} else if (type.contains("判断")) {
|
|
|
panduanWrong++;
|
|
|
} else if (type.contains("多选")) {
|
|
|
duoxuanWrong++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
listIndex++;
|
|
|
|
|
|
doRefresh(true);
|
|
|
|
|
|
} else if (listIndex == questionLst.size() - 1) {
|
...
|
...
|
@@ -625,7 +667,6 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
}
|
|
|
} else if (listIndex == questionLst.size() - 1) {
|
|
|
if (TextUtils.isEmpty(selectAnswer)) {
|
|
|
unDone++;
|
|
|
if (type.contains("单选")) {
|
|
|
danxuanWrong++;
|
|
|
} else if (type.contains("判断")) {
|
...
|
...
|
@@ -635,7 +676,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
showCommitCard(this, unDone);
|
|
|
showCommitCard(this, questionLst.size() - rightCount - wrongCount);
|
|
|
chageAlpha(0.5f);
|
|
|
break;
|
|
|
case R.id.tv_show_card:
|
...
|
...
|
|