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

chromesetting
杨树林 5 years ago
commit 900fff4480

@ -763,7 +763,7 @@ class ShixunsController < ApplicationController
else
commit = GitService.commits(repo_path: @repo_path).try(:first)
uid_logger("First comit########{commit}")
tip_exception("开启挑战前请先在Jupyter中填写内容") if commit.blank?
tip_exception("开启挑战前请先在Jupyter中填写内容并保存") if commit.blank?
commit_id = commit["id"]
cloud_bridge = edu_setting('cloud_bridge')
myshixun_identifier = generate_identifier Myshixun, 10

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 15:02:52
* @LastEditors: tangjiang
* @LastEditTime: 2019-12-20 19:06:48
* @LastEditTime: 2019-12-20 20:07:11
*/
import './index.scss';
import React, { useState, useRef, useEffect } from 'react';
@ -160,7 +160,7 @@ function MyMonacoEditor (props, ref) {
</Tooltip>
<Tooltip
placement="bottom"
title="重置"
title="恢复"
>
<MyIcon
className="flex_normal"

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-04 08:36:21
* @LastEditors: tangjiang
* @LastEditTime: 2019-12-20 19:29:39
* @LastEditTime: 2019-12-20 20:05:57
*/
import './index.scss';
import React, { useState, useEffect } from 'react';
@ -67,7 +67,7 @@ function RecordDetail (props) {
<span>{detail.name || 'test'}</span>
</div>
<div className={'study_quit'}>
<Button>
<Button style={{ visibility: identifier ? 'visible' : 'hidden'}}>
<Link to={`/myproblems/${identifier}`}>返回该题</Link>
</Button>
</div>
@ -98,6 +98,7 @@ function RecordDetail (props) {
<div className="detail_ctx_header">
<h2 className="header_h2">提交内容</h2>
<Button
style={{ visibility: identifier ? 'visible' : 'hidden'}}
className={'header_btn'}
type="primary"
>

@ -93,14 +93,14 @@ class Addshixuns extends Component {
</style>:""}
<div className="task-popup-content">
{/*<Form {...formItemLayout}>*/}
{/* <Form.Item label="实训类型">*/}
{/* <Radio.Group value={this.state.is_jupyter} onChange={this.GrouponChange}>*/}
{/* <Radio value="1">普通实训</Radio>*/}
{/* <Radio value="2">jupyter实训</Radio>*/}
{/* </Radio.Group>*/}
{/* </Form.Item>*/}
{/*</Form>*/}
<Form {...formItemLayout}>
<Form.Item label="实训类型">
<Radio.Group value={this.state.is_jupyter} onChange={this.GrouponChange}>
<Radio value="1">普通实训</Radio>
<Radio value="2">jupyter实训</Radio>
</Radio.Group>
</Form.Item>
</Form>
<p className="task-popup-text-center font-16">
<span style={{ "line-height":"30px"}}>实训名称</span>
<span><Input style={{ width:"80%"}} className="yslzxueshisy " placeholder="请输入60字以内的实训名称" onChange={this.handleChange} addonAfter={String(this.state.shixunname===undefined?0:this.state.shixunname.length)+"/60"} maxLength={60} />

@ -298,7 +298,7 @@ export default class Shixuninformation extends Component {
return (
<div>
<div className="educontent mb200 edu-back-white padding10-20 pdb30 mb50">
<div className="clearfix ml40">
{this.props&&this.props.is_jupyter===true?"":<div className="clearfix ml40">
<span className="color-grey-6 mt5 fl font-16 ml20" style={{minWidth: '45px'}}>复制:</span>
<span className="fl mt8 ml13">
<Checkbox
@ -306,7 +306,7 @@ export default class Shixuninformation extends Component {
onChange={this.CheckboxonChange}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则允许已职业认证的教师复制该实训</label>
</span>
</div>
</div>}
<div className="edu-back-white mb10 ml30 mt20">
<div>

@ -460,7 +460,7 @@ class Newshixuns extends Component {
{getFieldDecorator('is_jupyter')(
<Radio.Group onChange={this.RadiovalueonChange} value={this.state.Radiovalue}>
<Radio value="1">普通实训</Radio>
{this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.business===true?<Radio value="2" >Jupyter实训</Radio>:""}
<Radio value="2" >Jupyter实训</Radio>
</Radio.Group>,
)}
</Form.Item>

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 16:35:46
* @LastEditors: tangjiang
* @LastEditTime: 2019-12-20 18:46:00
* @LastEditTime: 2019-12-20 19:54:09
*/
import types from './actionTypes';
import CONST from '../../constants';
@ -135,22 +135,22 @@ export const validateOjForm = (props, type) => {
} else {
// 唯一性校验
const bool = testCases.some((item, j) => {
if (i !== j) {
if (i > j && key === 'input') {
return (item[key] === value);
} else {
return false;
}
});
// if (bool) {
// hasSuccess = false;
// validateResult = {
// [key]: {
// validateStatus: 'error',
// errMsg: key === 'input' ? '输入值必须是唯一的' : '输出值必须是唯一的'
// }
// };
// }
if (bool) {
hasSuccess = false;
validateResult = {
[key]: {
validateStatus: 'error',
errMsg: `与测试用例${i}的输入值重复了,请重新填写`
}
};
}
}
Object.assign(tempObj, validateResult);
});
@ -481,48 +481,48 @@ export const testCaseInputChange = (value, index) => {
// 测试用例输出值改变时
export const testCaseOutputChange = (value, index) => {
// const validate = emptyValidate('output', value)['output'];
// return {
// type: types.TEST_CASE_OUTPUT_CHANGE,
// payload: {
// output: validate,
// value,
// index
// }
// }
return (dispatch, getState) => {
// 非空校验
let validate = emptyValidate('output', value)['output'];
if (!validate.errMsg) {
// 唯一性校验
const {testCases} = getState().ojFormReducer;
let _errMsg = '输出值不能为空';
const bool = testCases.some((item, i) => {
if (i !== index) {
// if (item['output'] === value) {
// _errMsg=`与测试用例${index}的输入值重复了,请重新填写`;
// }
return item['output'] === value;
} else {
return false;
}
});
if (bool) {
validate = {
validateStatus: 'error',
errMsg: _errMsg
};
}
const validate = emptyValidate('output', value)['output'];
return {
type: types.TEST_CASE_OUTPUT_CHANGE,
payload: {
output: validate,
value,
index
}
dispatch({
type: types.TEST_CASE_OUTPUT_CHANGE,
payload: {
output: validate,
value,
index
}
});
}
// return (dispatch, getState) => {
// // 非空校验
// let validate = emptyValidate('output', value)['output'];
// if (!validate.errMsg) {
// // 唯一性校验
// const {testCases} = getState().ojFormReducer;
// let _errMsg = '';
// const bool = testCases.some((item, i) => {
// if (i !== index) {
// // if (item['output'] === value) {
// // _errMsg=`与测试用例${index}的输入值重复了,请重新填写`;
// // }
// return item['output'] === value;
// } else {
// return false;
// }
// });
// if (bool) {
// validate = {
// validateStatus: 'error',
// errMsg: _errMsg
// };
// }
// }
// dispatch({
// type: types.TEST_CASE_OUTPUT_CHANGE,
// payload: {
// output: validate,
// value,
// index
// }
// });
// }
}
// // 调试代码时,更改对应的状态值

Loading…
Cancel
Save