|
|
@@ -274,7 +274,9 @@ export function getQuestion(examId: string, studentId: string) {
|
|
|
hide()
|
|
|
if (response.err === 0) {
|
|
|
const question = response.res;
|
|
|
+ question.codeList.sort(function (a:NestedCodeItemVO, b:NestedCodeItemVO){if (a && b && a.questionId && b.questionId) return a.questionId - b.questionId; return -1;})
|
|
|
const current = store.getState().loadCurrentQuestion;
|
|
|
+ const pre = store.getState().loadQuestion;
|
|
|
if (Object.keys(current).length === 0) {
|
|
|
store.dispatch(loadQuestion(question));
|
|
|
store.dispatch(loadCurrentQuestion(response.res.codeList[0]));
|
|
|
@@ -282,7 +284,6 @@ export function getQuestion(examId: string, studentId: string) {
|
|
|
} else {
|
|
|
for (let i = 0; i < question.codeList.length; i++){
|
|
|
if (question.codeList[i].questionId === current.questionId) {
|
|
|
- const pre = store.getState().loadQuestion;
|
|
|
if (pre && pre.codeList) pre.codeList[i] = question.codeList[i];
|
|
|
store.dispatch(loadQuestion(pre));
|
|
|
store.dispatch(loadCurrentQuestion(question.codeList[i]));
|