|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2019-11-20 16:35:46
|
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
|
* @LastEditTime : 2020-01-03 16:40:54
|
|
|
|
|
* @LastEditTime : 2020-01-03 17:39:32
|
|
|
|
|
*/
|
|
|
|
|
import types from './actionTypes';
|
|
|
|
|
import CONST from '../../constants';
|
|
|
|
@ -675,14 +675,31 @@ export const updateOpenTestCaseIndex = (value) => {
|
|
|
|
|
|
|
|
|
|
// 获取课程题库
|
|
|
|
|
export const getQuestion = (params) => {
|
|
|
|
|
return (dispatch) => {
|
|
|
|
|
fetchQuestion(params).then(res => {
|
|
|
|
|
return (dispatch, getState) => {
|
|
|
|
|
const {ojForm: {sub_discipline_id}} = getState().ojFormReducer;
|
|
|
|
|
fetchQuestion(params, ).then(res => {
|
|
|
|
|
const { data = {} } = res;
|
|
|
|
|
const { disciplines = [] } = data;
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.GET_COURSE_QUESTION,
|
|
|
|
|
payload: disciplines
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let temp_knowledges = [];
|
|
|
|
|
// console.log('选择的课程: =====>>>>>>', sub_discipline_id);
|
|
|
|
|
disciplines.forEach(c => {
|
|
|
|
|
if (sub_discipline_id && c.sub_disciplines) {
|
|
|
|
|
c.sub_disciplines.forEach(sub => {
|
|
|
|
|
if (+sub.id === +sub_discipline_id) {
|
|
|
|
|
temp_knowledges = sub.tag_disciplines || [];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.CHANGE_KNOWLEDGES,
|
|
|
|
|
payload: temp_knowledges
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|