|
|
@@ -273,15 +273,18 @@ export function getQuestion(examId: string, studentId: string) {
|
|
|
response => {
|
|
|
hide()
|
|
|
if (response.err === 0) {
|
|
|
- store.dispatch(loadQuestion(response.res));
|
|
|
const question = response.res;
|
|
|
const current = store.getState().loadCurrentQuestion;
|
|
|
if (Object.keys(current).length === 0) {
|
|
|
+ store.dispatch(loadQuestion(question));
|
|
|
store.dispatch(loadCurrentQuestion(response.res.codeList[0]));
|
|
|
generateFileTree(response.res.codeList[0]);
|
|
|
} 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]));
|
|
|
generateFileTree(question.codeList[i]);
|
|
|
break;
|