|
|
|
@ -12,13 +12,10 @@ import { connect } from 'react-redux';
|
|
|
|
|
import SplitPane from 'react-split-pane';
|
|
|
|
|
import LeftPane from './leftpane';
|
|
|
|
|
import RightPane from './rightpane';
|
|
|
|
|
// import { Link } from 'react-router-dom';
|
|
|
|
|
// import { getImageUrl } from 'educoder'
|
|
|
|
|
// import RightPane from '../newOrEditTask/rightpane';
|
|
|
|
|
import { Icon } from 'antd';
|
|
|
|
|
import UserInfo from '../components/userInfo';
|
|
|
|
|
import actions from '../../../redux/actions';
|
|
|
|
|
import { fromStore, CNotificationHOC} from 'educoder';
|
|
|
|
|
import { CNotificationHOC } from 'educoder';
|
|
|
|
|
import { withRouter } from 'react-router';
|
|
|
|
|
|
|
|
|
|
function StudentStudy(props) {
|
|
|
|
@ -27,8 +24,6 @@ function StudentStudy (props) {
|
|
|
|
|
const {
|
|
|
|
|
hack,
|
|
|
|
|
userInfo,
|
|
|
|
|
// hack_identifier,
|
|
|
|
|
// user_program_identifier,
|
|
|
|
|
restoreInitialCode,
|
|
|
|
|
changeUserCodeTab,
|
|
|
|
|
changeShowOrHideControl,
|
|
|
|
@ -47,10 +42,6 @@ function StudentStudy (props) {
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// 保存当前的id
|
|
|
|
|
saveUserProgramIdentifier(id);
|
|
|
|
|
// startProgramQuestion(id);
|
|
|
|
|
// console.log("getUserProgramDetail(id)");
|
|
|
|
|
// console.log(id);
|
|
|
|
|
// console.log(id.charAt(id.length-1));
|
|
|
|
|
try {
|
|
|
|
|
if (id.charAt(id.length - 1) === "?") {
|
|
|
|
|
id = id.substring(0, id.length - 1);
|
|
|
|
@ -74,17 +65,14 @@ function StudentStudy (props) {
|
|
|
|
|
changeUserCodeTab(tab);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const { hack = {} } = props;
|
|
|
|
|
if (hack.modify_code && hasUpdate) { // 代码更改,提示是否需要更新代码
|
|
|
|
|
if (hack && hack.modify_code && hasUpdate) { // 代码更改,提示是否需要更新代码
|
|
|
|
|
setHasUpdate(false);
|
|
|
|
|
handleUpdateNotice();
|
|
|
|
|
}
|
|
|
|
|
}, [props, hasUpdate, setHasUpdate]);
|
|
|
|
|
}, [hack, hack.modify_code, hasUpdate]);
|
|
|
|
|
|
|
|
|
|
const handleUpdateNotice = () => {
|
|
|
|
|
console.log(props);
|
|
|
|
|
props.confirm({
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: (
|
|
|
|
@ -97,22 +85,7 @@ function StudentStudy (props) {
|
|
|
|
|
restoreInitialCode(id, '更新成功');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// Modal.confirm({
|
|
|
|
|
// title: '提示',
|
|
|
|
|
// content: (
|
|
|
|
|
// <p>
|
|
|
|
|
// 代码文件有更新啦 <br />
|
|
|
|
|
// 还未提交的代码,请自行保存
|
|
|
|
|
// </p>
|
|
|
|
|
// ),
|
|
|
|
|
// okText: '立即更新',
|
|
|
|
|
// cancelText: '稍后再说',
|
|
|
|
|
// onOk () {
|
|
|
|
|
// restoreInitialCode(id, '更新成功');
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
// const _hack_id = hack_identifier || fromStore('hack_identifier');
|
|
|
|
|
// 处理编辑
|
|
|
|
|
const handleClickEditor = (identifier) => {
|
|
|
|
|
if (!identifier) return;
|
|
|
|
|