diff --git a/app/libs/aliyun_vod/service/video_upload.rb b/app/libs/aliyun_vod/service/video_upload.rb
index 97ecd970b..d99dbfdd3 100644
--- a/app/libs/aliyun_vod/service/video_upload.rb
+++ b/app/libs/aliyun_vod/service/video_upload.rb
@@ -8,6 +8,8 @@ module AliyunVod::Service::VideoUpload
FileName: filename
}.merge(base_params)
+ # TODO: 获取视频的同时,可以指定转码组,在这里指定
+ # 参数TemplateGroupId: 转码组的id.
# 分类
cate_id = AliyunVod.cate_id
params[:CateId] = cate_id if cate_id.present?
diff --git a/lib/tasks/sync_evaluate.rake b/lib/tasks/sync_evaluate.rake
index 831792a90..67117f613 100644
--- a/lib/tasks/sync_evaluate.rake
+++ b/lib/tasks/sync_evaluate.rake
@@ -2,12 +2,13 @@ desc "同步学院或者单位评测数"
namespace :sync_evaluate do
task outpus_count: :environment do
- School.find_each do |school|
+ School.find_in_batches(batch_size: 50) do |school|
Parallel.each_with_index(school, in_processes: 5) do |s|
puts "school_id:#{s.id}"
evaluate_count = Game.find_by_sql("select sum(g.evaluate_count) as e_count from games g, user_extensions ue where
g.user_id = ue.user_id and ue.school_id = '#{s.id}'").first.try(:e_count)
+ puts "evaluate_count: #{evaluate_count}"
report = SchoolReport.find_or_initialize_by(school_id: s.id)
report.school_name = s.name
report.shixun_evaluate_count = evaluate_count
diff --git a/public/react/src/modules/developer/components/myMonacoEditor/index.js b/public/react/src/modules/developer/components/myMonacoEditor/index.js
index 87f9da0bd..790c1481d 100644
--- a/public/react/src/modules/developer/components/myMonacoEditor/index.js
+++ b/public/react/src/modules/developer/components/myMonacoEditor/index.js
@@ -11,7 +11,8 @@ import React, { useState, useRef, useEffect } from 'react';
import { Drawer, Tooltip, Badge } from 'antd';
import { fromStore, CNotificationHOC } from 'educoder';
import { connect } from 'react-redux';
-import MonacoEditor from '@monaco-editor/react';
+import { ControlledEditor } from '@monaco-editor/react';
+
import SettingDrawer from '../../components/monacoSetting';
import CONST from '../../../../constants';
import MyIcon from '../../../../common/components/MyIcon';
@@ -47,8 +48,6 @@ function MyMonacoEditor(props, ref) {
return fromStore('oj_theme') || 'dark';
});
const [height, setHeight] = useState('calc(100% - 56px)');
- const editorRef = useRef(null);
- console.log(language, code, '-------========----------')
useEffect(() => {
setHeight(showOrHideControl ? 'calc(100% - 378px)' : 'calc(100% - 56px)');
@@ -71,21 +70,10 @@ function MyMonacoEditor(props, ref) {
setTheme(value);
}
- // 文本框内容变化时,记录文本框内容
- const handleEditorChange = (_, monaco) => {
- editorRef.current = monaco; // 获取当前monaco实例
- }
- useEffect(() => {
- if (editorRef.current) {
- editorRef.current.onDidChangeModelContent(e => { // 监听编辑器内容的变化
- const val = editorRef.current.getValue();
- onCodeChange(val);
- });
- }
- }, [
- editorRef.current
- ])
+ function onChangeHandler(ev, value) {
+ onCodeChange(value);
+ }
// 配置编辑器属性
const editorOptions = {
@@ -152,14 +140,14 @@ function MyMonacoEditor(props, ref) {
-
diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js
index 13ecd0b07..acbdfc393 100644
--- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js
+++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js
@@ -26,7 +26,7 @@ const { Option } = Select;
const maps = {
language: [
{ title: 'C', key: 'C' },
- { title: 'C++', key: 'C++' },
+ { title: 'C++', key: 'cpp' },
{ title: 'Python', key: 'Python' },
{ title: 'Java', key: 'Java' }
],
diff --git a/public/react/src/modules/developer/studentStudy/rightpane/index.js b/public/react/src/modules/developer/studentStudy/rightpane/index.js
index 0b0b96556..c5a71e290 100644
--- a/public/react/src/modules/developer/studentStudy/rightpane/index.js
+++ b/public/react/src/modules/developer/studentStudy/rightpane/index.js
@@ -57,7 +57,7 @@ const RightPane = (props) => {
timer = setInterval(function () {
clearInterval(timer);
timer = null;
- saveUserCodeForInterval(identifier);
+ saveUserCodeForInterval(identifier, value);
}, 5000);
}
}
@@ -99,13 +99,17 @@ const RightPane = (props) => {
});
}
const { getFieldDecorator } = props.form;
+ let language = hack.language
+ if (language === 'C++') {
+ language = 'cpp'
+ }
return (
{
export const saveUserCodeForInterval = (identifier, code) => {
return (dispatch, getState) => {
- const { userCode } = getState().ojForUserReducer;
dispatch({
type: types.AUTO_UPDATE_CODE,
payload: true
});
fetchUpdateCode(identifier, {
- code: Base64.encode(userCode)
+ code: Base64.encode(code)
}).then(res => {
if (res.data.status === 401) {
return;
@@ -135,7 +134,6 @@ export const saveUserCodeForInterval = (identifier, code) => {
* @param {*} type 测评类型 debug | submit
*/
export const updateCode = (identifier, inputValue, type) => {
- console.log(1111);
return (dispatch, getState) => {
const { userCode, isUpdateCode } = getState().ojForUserReducer;
if (isUpdateCode) {
diff --git a/public/react/src/redux/actions/ojForm.js b/public/react/src/redux/actions/ojForm.js
index 05c28b07d..62de0fed8 100644
--- a/public/react/src/redux/actions/ojForm.js
+++ b/public/react/src/redux/actions/ojForm.js
@@ -132,6 +132,7 @@ export const validateOjForm = (props, type, cb) => {
}
});
// 验证测试用例中的数组是否都有对应的值
+ let tcbool=false;
const tcValidResult = [];
// 验证测试用例: 1.必须要有输出值 2. 输入值与输出值必须唯一
testCases.forEach((obj, i) => {
@@ -141,8 +142,25 @@ export const validateOjForm = (props, type, cb) => {
// 非空校验
let validateResult = emptyValidate(key, value);
const errMsg = validateResult[key].errMsg;
- if (errMsg) {
- // hasSuccess = false;
+ // console.log("-------");
+ // console.log(errMsg);
+ // console.log(key);
+ // console.log(value);
+
+ if (errMsg) {
+ if(key==="output"){
+ hasSuccess = false;
+ if(tcbool===false){
+ tcbool=true
+ notification['error']({
+ message: '提示',
+ description: '测试用例必须填写输出!'
+ });
+
+ }
+ }
+
+
} else {
// 唯一性校验
const bool = testCases.some((item, j) => {
@@ -167,39 +185,7 @@ export const validateOjForm = (props, type, cb) => {
});
tcValidResult.push(tempObj);
});
-
- try {
- if(ojForm.sub_discipline_id.length===0){
- hasSuccess = false;
- notification['error']({
- message: '提示',
- description: '课程必须选择!'
- });
-
- }else if(ojForm.timeLimit===null){
- hasSuccess = false;
- notification['error']({
- message: '提示',
- description: '时间限制必须输入!'
- });
- } else if(ojForm.name.length===0){
- hasSuccess = false;
- notification['error']({
- message: '提示',
- description: '任务名称必须输入!'
- });
-
- }else if(ojForm.description.length===0){
- hasSuccess = false;
- notification['error']({
- message: '提示',
- description: '描述必须输入!'
- });
- }
-
- }catch (e) {
-
- }
+
// if (testCases.length === 0) {
// hasSuccess = false;
@@ -234,6 +220,43 @@ export const validateOjForm = (props, type, cb) => {
payload: false
});
}
+
+
+ try {
+ if(ojForm.sub_discipline_id.length===0){
+ hasSuccess = false;
+ notification['error']({
+ message: '提示',
+ description: '课程必须选择!'
+ });
+
+ }else if(ojForm.timeLimit===null){
+ hasSuccess = false;
+ notification['error']({
+ message: '提示',
+ description: '时间限制必须输入!'
+ });
+ } else if(ojForm.name.length===0){
+ hasSuccess = false;
+ notification['error']({
+ message: '提示',
+ description: '任务名称必须输入!'
+ });
+
+ }else if(ojForm.description.length===0){
+ hasSuccess = false;
+ notification['error']({
+ message: '提示',
+ description: '描述必须输入!'
+ });
+ }
+
+ }catch (e) {
+
+ }
+
+
+
/** 表单验证结束 */
/** 表单验证通过后,调用保存 or 更新 or 发布 */
if (hasSuccess) {