|
|
|
@ -87,7 +87,7 @@ export const getUserProgramDetail = (identifier, type) => {
|
|
|
|
|
type: types.SAVE_USE_TEST_CASE_VALUE,
|
|
|
|
|
payload: data.test_case || {}
|
|
|
|
|
});
|
|
|
|
|
// 代码是否更新
|
|
|
|
|
// 代码是否更新
|
|
|
|
|
let _modify_code = false;
|
|
|
|
|
if (data.hack) {
|
|
|
|
|
_modify_code = data.hack.modify_code;
|
|
|
|
@ -178,7 +178,7 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => {
|
|
|
|
|
let count = 1;
|
|
|
|
|
/**
|
|
|
|
|
* @param {*} excuteTime 执行时间
|
|
|
|
|
* @param {*} finalTime 总时间
|
|
|
|
|
* @param {*} finalTime 总时间
|
|
|
|
|
* @param {*} count 执行次数
|
|
|
|
|
* @param {*} timer 定时器
|
|
|
|
|
*/
|
|
|
|
@ -190,7 +190,7 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => {
|
|
|
|
|
if (+status === 0 || (excuteTime / 1000) > (finalTime + 1)) {
|
|
|
|
|
clearInterval(timer); // 清除定时器
|
|
|
|
|
timer = null;
|
|
|
|
|
let returnData = null;
|
|
|
|
|
let returnData = null;
|
|
|
|
|
if (status === 1) { // 结果没有返回
|
|
|
|
|
returnData = {
|
|
|
|
|
error_line: -1,
|
|
|
|
@ -208,8 +208,8 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => {
|
|
|
|
|
// 返回评测结果
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.COMMIT_RECORD_DETAIL,
|
|
|
|
|
payload: returnData
|
|
|
|
|
});
|
|
|
|
|
payload: returnData
|
|
|
|
|
});
|
|
|
|
|
if (!type || type === 'debug') {
|
|
|
|
|
dispatch({ // 改变 loading 值
|
|
|
|
|
type: types.LOADING_STATUS,
|
|
|
|
@ -261,13 +261,13 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description 调试代码
|
|
|
|
|
* @param {*} identifier
|
|
|
|
|
* @param {*} identifier
|
|
|
|
|
* @param {*} inputValue 输入值: 自定义 | 系统返回的
|
|
|
|
|
* @param {*} type 测评类型 debug | submit
|
|
|
|
|
*/
|
|
|
|
|
export const debuggerCode = (identifier,value, type) => {
|
|
|
|
|
return (dispatch, getState) => {
|
|
|
|
|
// 调用之前 先保存 code
|
|
|
|
|
// 调用之前 先保存 code
|
|
|
|
|
// TODO
|
|
|
|
|
// console.log(identifier, value);
|
|
|
|
|
const {hack: {time_limit = 0}} = getState().ojForUserReducer;
|
|
|
|
|