Merge branch 'dev_item_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_item_bank

dev_jupyter
杨树林 5 years ago
commit 3aa23e8774

@ -67,9 +67,8 @@ const NewOrEditTask = (props) => {
props.getOJFormById(id);
} else {
// 清空store中的测试用例集合
props.clearOJFormStore();
// props.clearOJFormStore();
}
return () => {}
}, []);

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 10:35:40
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-03 11:28:26
* @LastEditTime : 2020-01-03 17:35:45
*/
import './index.scss';
// import 'katex/dist/katex.css';
@ -179,9 +179,10 @@ class EditTab extends React.Component {
tag_discipline_id,
knowledges
} = this.props;
console.log('knowledge======>>>>>>', knowledges);
// console.log('knowledge======>>>>>>', knowledges);
// const {knowledges} = this.state;
// 表单label
// console.log('props=====>>>>', this.props);
const myLabel = (name, subTitle, nostar) => {
if (subTitle) {
return (
@ -313,7 +314,7 @@ class EditTab extends React.Component {
// debugger;
if (sub_id && t.children) {
t.children.forEach(c => {
if (c.value === sub_id) {
if (c.value === +sub_id) {
choid_ids = [t.value, c.value];
// tempKnowledges = c.children || [];
}

@ -20,7 +20,8 @@ import SingleEditor from "./component/SingleEditor";
import ChoquesEditor from "./component/ChoquesEditor"
import JudquestionEditor from "./component/JudquestionEditor";
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import { connect } from 'react-redux';
import actions from "../../redux/actions";
class Questionitem_banks extends Component {
constructor(props) {
super(props);
@ -93,7 +94,11 @@ class Questionitem_banks extends Component {
}
// this.props.setOjInitialValue({
// difficult: 1,
// sub_discipline_id: '3',
// tag_discipline_id: [3, 4]
// });
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
@ -573,7 +578,14 @@ class Questionitem_banks extends Component {
}
const mapStateToProps = (state) => ({});
const mapDispatchToProps = (dispatch) => ({
setOjInitialValue: (params) => dispatch(actions.setOjInitialValue(params))
});
export default SnackbarHOC()(TPMIndexHOC(Questionitem_banks));
export default connect(
mapStateToProps,
mapDispatchToProps
)(SnackbarHOC()(TPMIndexHOC(Questionitem_banks)));

@ -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
});
})
}
}

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 16:40:32
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-03 16:39:09
* @LastEditTime : 2020-01-03 17:38:50
*/
import { Base64 } from 'js-base64';
import types from '../actions/actionTypes';
@ -231,7 +231,7 @@ const ojFormReducer = (state = initialState, action) => {
courseQuestions.forEach(c => {
if (sub_discipline_id && c.sub_disciplines) {
c.sub_disciplines.forEach(sub => {
if (+sub.id === sub_discipline_id) {
if (+sub.id === +sub_discipline_id) {
temp_knowledges = sub.tag_disciplines || [];
}
});

Loading…
Cancel
Save