From e884c200eb6d2c2d9a44e397d8a7cb31d445f2e9 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 7 Jan 2020 17:07:49 +0800 Subject: [PATCH 1/9] 1 --- app/views/hack_user_lastest_codes/result.json.jbuilder | 1 + app/views/hack_user_lastest_codes/show.json.jbuilder | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/hack_user_lastest_codes/result.json.jbuilder b/app/views/hack_user_lastest_codes/result.json.jbuilder index d8f010cc3..0ddd28103 100644 --- a/app/views/hack_user_lastest_codes/result.json.jbuilder +++ b/app/views/hack_user_lastest_codes/result.json.jbuilder @@ -3,6 +3,7 @@ json.message "评测完成" json.data do json.(@result, :id, :status, :error_line, :error_msg, :input, :output, :execute_time, :execute_memory) + json.passed @my_hack.passed # 提交模式多了一个预计输出 if @mode == "submit" json.expected_output @result.expected_output diff --git a/app/views/hack_user_lastest_codes/show.json.jbuilder b/app/views/hack_user_lastest_codes/show.json.jbuilder index 04b066aa0..4dd023296 100644 --- a/app/views/hack_user_lastest_codes/show.json.jbuilder +++ b/app/views/hack_user_lastest_codes/show.json.jbuilder @@ -8,6 +8,7 @@ json.hack do json.submit_count @hack.submit_num json.notes @my_hack.notes json.modify_code @modify + json.passed @my_hack.passed json.comments_count @hack.discusses.count json.user_praise @hack.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0 end From 54f6f124c659aaf51f0d41358daa920c82b67a82 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Tue, 7 Jan 2020 17:32:08 +0800 Subject: [PATCH 2/9] add commit pass score tip --- public/react/src/redux/actions/actionTypes.js | 1 + public/react/src/redux/actions/ojForUser.js | 27 ++++++++++++++----- public/react/src/redux/actions/ojForm.js | 6 +---- .../src/redux/reducers/ojForUserReducer.js | 9 ++++++- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/public/react/src/redux/actions/actionTypes.js b/public/react/src/redux/actions/actionTypes.js index 53d62003b..efe3ff35c 100644 --- a/public/react/src/redux/actions/actionTypes.js +++ b/public/react/src/redux/actions/actionTypes.js @@ -64,6 +64,7 @@ const types = { CHANGE_RECORD_PAGINATION_PAGE: 'CHANGE_RECORD_PAGINATION_PAGE', // 改变提交分页 UPDATE_OJ_FOR_USER_COMMENT_COUNT: 'UPDATE_OJ_FOR_USER_COMMENT_COUNT', // 更新 hack 中的评论数, UPDATE_NOTE_CONTENT: 'UPDATE_NOTE_CONTENT', // 更新笔记内容 + UPDATE_HACK_PASSED: 'UPDATE_HACK_PASSED', /*** jupyter */ GET_JUPYTER_DATA_SETS: 'GET_JUPYTER_DATA_SETS', // jupyter 数据集 GET_JUPYTER_TPI_URL: 'GET_JUPYTER_TPI_URL', // 获取 jupyter url diff --git a/public/react/src/redux/actions/ojForUser.js b/public/react/src/redux/actions/ojForUser.js index 6a8f49bd6..abe323808 100644 --- a/public/react/src/redux/actions/ojForUser.js +++ b/public/react/src/redux/actions/ojForUser.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 13:42:11 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-07 16:21:53 + * @LastEditTime : 2020-01-07 17:27:40 */ import types from "./actionTypes"; import { Base64 } from 'js-base64'; @@ -179,7 +179,7 @@ export const updateCode = (identifier, inputValue, type) => { } // 代码评测 -export const codeEvaluate = (dispatch, identifier, type, time_limit) => { +export const codeEvaluate = (dispatch, identifier, type, time_limit, hackStatus, score, passed) => { // 调试代码成功后,调用轮循接口, 注意: 代码执行的时间要小于设置的时间限制 const intervalTime = 500; let count = 1; @@ -219,7 +219,7 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => { type, data: returnData } - }); + }); if (!type || type === 'debug') { dispatch({ // 改变 loading 值 type: types.LOADING_STATUS, @@ -244,6 +244,18 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => { // 重新调用一下提交记录接口 dispatch(getUserCommitRecord(identifier)); dispatch(saveOpacityType(type)); + // 首次通过时,提示评测通过并获得金币 + // console.log('hack status ===>>', hackStatus); + if (hackStatus === 1 && !passed) { + dispatch({ + type: types.UPDATE_HACK_PASSED, + payload: true + }); + notification.success({ + message: '提示', + description: `恭喜您获得金币奖励: ${score}` + }); + } } } }).catch(err => { // 评测异常时 @@ -281,7 +293,7 @@ export const debuggerCode = (identifier,value, type) => { // 调用之前 先保存 code // TODO // console.log(identifier, value); - const {hack: {time_limit = 0}} = getState().ojForUserReducer; + const { hack } = getState().ojForUserReducer; if (!type || type === 'debug') { dispatch({ // 加载中... type: types.TEST_CODE_STATUS, @@ -301,7 +313,7 @@ export const debuggerCode = (identifier,value, type) => { return; }; // 测评 - codeEvaluate(dispatch, identifier, type, time_limit); + codeEvaluate(dispatch, identifier, type, hack.time_limit); } }).catch(() => { dispatch({ @@ -387,7 +399,7 @@ export const changeUserCodeTab = (key) => { */ export const submitUserCode = (identifier, inputValue, type) => { return (dispatch, getState) => { - const { userCode, isUpdateCode, hack: {time_limit = 0} } = getState().ojForUserReducer; + const { userCode, isUpdateCode, hack} = getState().ojForUserReducer; function userCodeSubmit () { fetchUserCodeSubmit(identifier).then(res => { @@ -401,7 +413,8 @@ export const submitUserCode = (identifier, inputValue, type) => { return; }; // 测评 - codeEvaluate(dispatch, identifier, type, time_limit); + console.log('hack=====', hack); + codeEvaluate(dispatch, identifier, type, hack.time_limit, hack.status, hack.score, hack.passed); } }).catch(() => { dispatch({ diff --git a/public/react/src/redux/actions/ojForm.js b/public/react/src/redux/actions/ojForm.js index 1c41da38a..aa8a7f50d 100644 --- a/public/react/src/redux/actions/ojForm.js +++ b/public/react/src/redux/actions/ojForm.js @@ -4,11 +4,7 @@ * @Github: * @Date: 2019-11-20 16:35:46 * @LastEditors : tangjiang -<<<<<<< HEAD - * @LastEditTime : 2020-01-07 15:27:22 -======= - * @LastEditTime : 2020-01-03 17:39:32 ->>>>>>> dev_aliyun + * @LastEditTime : 2020-01-07 16:45:34 */ import types from './actionTypes'; import CONST from '../../constants'; diff --git a/public/react/src/redux/reducers/ojForUserReducer.js b/public/react/src/redux/reducers/ojForUserReducer.js index 475d14d79..8a751f86b 100644 --- a/public/react/src/redux/reducers/ojForUserReducer.js +++ b/public/react/src/redux/reducers/ojForUserReducer.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 13:41:48 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-02 14:24:09 + * @LastEditTime : 2020-01-07 17:26:19 */ import types from "../actions/actionTypes"; import { Base64 } from 'js-base64'; @@ -228,6 +228,13 @@ const ojForUserReducer = (state = initialState, action) => { ...state, hack: _hack1 } + // 修改 hack passed值 + case types.UPDATE_HACK_PASSED: + const _hack2 = Object.assign({}, state.hack, {passed: action.payload }); + return { + ...state, + hack: _hack2 + } default: return state; } From c1c621edda93f4f5d90ede7dc32b5f92e7cad8d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 19:38:56 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 4 +-- public/react/src/common/UrlTool.js | 9 +++++ public/react/src/common/educoder.js | 2 +- .../graduation/tasks/GraduationTaskDetail.js | 35 +++++++++++++++++-- .../tasks/GraduationTaskssettinglist.js | 20 ++++++++--- public/react/src/modules/tpm/TPMBanner.js | 1 + 6 files changed, 60 insertions(+), 11 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index a18e395dd..2926d6c0f 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -82,8 +82,8 @@ export function initAxiosInterceptors(props) { // proxy = "https://testeduplus2.educoder.net" //proxy="http://47.96.87.25:48080" proxy="https://pre-newweb.educoder.net" - // proxy="https://test-newweb.educoder.net" - proxy="https://test-jupyterweb.educoder.net" + proxy="https://test-newweb.educoder.net" + //proxy="https://test-jupyterweb.educoder.net" //proxy="http://192.168.2.63:3001" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; diff --git a/public/react/src/common/UrlTool.js b/public/react/src/common/UrlTool.js index 33c91fb89..3f40b8d1b 100644 --- a/public/react/src/common/UrlTool.js +++ b/public/react/src/common/UrlTool.js @@ -100,22 +100,31 @@ export function getUploadActionUrl(path, goTest) { let anewopens=md5(newopens+newtimestamp); return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`; } + export function getUploadActionUrltwo(id) { Railsgettimes() let anewopens=md5(newopens+newtimestamp); return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` } + export function getUploadActionUrlthree() { Railsgettimes() let anewopens=md5(newopens+newtimestamp); return `${getUrlmys()}/api/jupyters/import_with_tpm.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` } + export function getUploadActionUrlOfAuth(id) { Railsgettimes() let anewopens=md5(newopens+newtimestamp); return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` } +export function getRandomNumber(type) { + Railsgettimes() + let anewopens=md5(newopens+newtimestamp); + return type===true?`&randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}` +} + export function test(path) { return `${path}`; } diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index 35abfc7fe..ca546ec56 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -2,7 +2,7 @@ // export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil'; -export { getImageUrl as getImageUrl, getUrl as getUrl, publicSearchs as publicSearchs,getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl +export { getImageUrl as getImageUrl, getRandomNumber as getRandomNumber,getUrl as getUrl, publicSearchs as publicSearchs,getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl , getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth , getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool'; export { default as queryString } from './UrlTool2'; diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index e07f3d249..2a3537529 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; - +import {getRandomNumber,queryString} from 'educoder'; import {Link} from 'react-router-dom'; import {Tooltip,Menu} from 'antd'; import Loadable from 'react-loadable'; @@ -62,7 +62,8 @@ class GraduationTaskDetail extends Component{ ModalCancel:undefined, ModalSave:undefined, acrossVisible:undefined, - OneSelftype:false + OneSelftype:false, + taskdatas:undefined } } componentDidMount(){ @@ -249,11 +250,13 @@ class GraduationTaskDetail extends Component{ visibles:true }) } + Cancel=()=>{ this.setState({ visibles:false }) } + // 取消关联 cannelAssociation=()=>{ this.setState({ @@ -263,6 +266,7 @@ class GraduationTaskDetail extends Component{ ModalSave:this.savetassociton }) } + savetassociton=()=>{ this.cannerassocition(); let {questionslist}=this.state; @@ -277,6 +281,7 @@ class GraduationTaskDetail extends Component{ }) } + cannerassocition=()=>{ this.setState({ Modalstype:false, @@ -287,6 +292,7 @@ class GraduationTaskDetail extends Component{ visibles:false }) } + // 补交附件 handaccessory=()=>{ // let {taskslistdata}=this.state; @@ -299,14 +305,35 @@ class GraduationTaskDetail extends Component{ avisible:true }) } + Cancelvisible=()=>{ this.setState({ avisible:false }) } + CodeReview=()=>{ + this.props.showNotification("正在导出中..."); + const task_Id = this.props.match.params.task_Id; + console.log(this.state.taskdatas) + window.open(`https://test-newweb.educoder.net/api/graduation_tasks/${task_Id}/sonar?teacher_comment=${this.state.taskdatas.teacher_comment}&task_status=${this.state.taskdatas.task_status}&course_group=${this.state.taskdatas.course_group}&cross_comment=${this.state.taskdatas.cross_comment}&search=${this.state.taskdatas.search}&${getRandomNumber(true)}`) + } + + getsonars=(teacher_comment,task_status,course_group,cross_comment,search)=>{ + let data={ + teacher_comment:teacher_comment, + task_status:task_status, + course_group:course_group, + cross_comment:cross_comment, + search:search + } + this.setState({ + taskdatas:data + }) + } bindRef = ref => { this.child = ref } ; + render(){ let courseId=this.props.match.params.coursesId; @@ -512,13 +539,15 @@ class GraduationTaskDetail extends Component{ { this.props.isAdmin() ? questionslist.status===0 ? { this.publish()} }>立即发布 : "" : "" } { this.props.isAdmin() && questionslist.cross_comment ? 交叉评阅设置 : "" } { this.props.isAdmin() ? 编辑任务 : "" } + { this.props.user&&this.props.user.admin===true || this.props.user&&this.props.user.business===true ? this.CodeReview()}>代码评测 : "" } + {/*//毕设任务列表*/} (this.setend_time(time)} tab={`list`}/>) + (props) => (this.getsonars(teacher_comment,task_status,course_group,cross_comment,search)}{...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} setend_time={(time)=>this.setend_time(time)} tab={`list`}/>) } > diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 21b378635..24c69ab85 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -62,6 +62,8 @@ class GraduationTaskssettinglist extends Component{ let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state; this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page); + this.props.getsonar(teacher_comment, task_status, course_group, cross_comment, search) + try{ this.props.triggerRef(this) }catch(e){ @@ -88,6 +90,8 @@ class GraduationTaskssettinglist extends Component{ }) let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search} = this.state; this.seacthdata(teacher_comment, task_status, course_group, cross_comment, order, b_order, search,this.state.page); + + this.props.getsonar(teacher_comment, task_status, course_group, cross_comment, search) } seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{ @@ -244,8 +248,10 @@ class GraduationTaskssettinglist extends Component{ if(list.length===key){ this.seacthdata(undefined, task_status, course_group, cross_comment, order, b_order, search,this.state.page); + this.props.getsonar(undefined, task_status, course_group, cross_comment, search) }else{ this.seacthdata(list[0], task_status, course_group, cross_comment, order, b_order, search,this.state.page); + this.props.getsonar(list[0], task_status, course_group, cross_comment, search) } @@ -262,7 +268,7 @@ class GraduationTaskssettinglist extends Component{ loadingstate:true }) this.seacthdata(teacher_comment, task_status, course_group, e.target.value===undefined||e.target.value===false?"":e.target.value, order, b_order, search,this.state.page); - + this.props.getsonar(teacher_comment, task_status, course_group, e.target.value===undefined||e.target.value===false?"":e.target.value, search) } inputSearchValue=(e)=>{ @@ -287,7 +293,7 @@ class GraduationTaskssettinglist extends Component{ loadingstate:true }) this.seacthdata(teacher_comment, task_status, course_group, cross_comment, order, b_order, search,this.state.page); - + this.props.getsonar(teacher_comment, task_status, course_group, cross_comment, search) } funorder = (value, newb_order) => { @@ -299,7 +305,7 @@ class GraduationTaskssettinglist extends Component{ loadingstate: true }) this.seacthdata(teacher_comment, task_status, course_group, cross_comment, value, newb_order, search,this.state.page); - + this.props.getsonar(teacher_comment, task_status, course_group, cross_comment, search) } @@ -320,6 +326,7 @@ class GraduationTaskssettinglist extends Component{ loadingstate:true }) this.seacthdata(teacher_comment, null, course_group, cross_comment, order, b_order, search,this.state.page); + this.props.getsonar(teacher_comment, null, course_group, cross_comment, search) } // else if(checkedValues.length ===key){ // // 全部抖选中 自然就是查找全部 就是空 @@ -336,7 +343,7 @@ class GraduationTaskssettinglist extends Component{ loadingstate:true }) this.seacthdata(teacher_comment, checkedValues===key?undefined:checkedValues, course_group, cross_comment, order, b_order, search,this.state.page); - + this.props.getsonar(teacher_comment, checkedValues===key?undefined:checkedValues, course_group, cross_comment, search) } @@ -355,6 +362,7 @@ class GraduationTaskssettinglist extends Component{ loadingstate:true }) this.seacthdata(teacher_comment, task_status, null, cross_comment, order, b_order, search,this.state.page); + this.props.getsonar(teacher_comment,task_status, null, cross_comment, search) } // else if(checkedValues.length ===key){ // // 全部抖选中 自然就是查找全部 就是空 @@ -372,6 +380,7 @@ class GraduationTaskssettinglist extends Component{ loadingstate:true }) this.seacthdata(teacher_comment, task_status, checkedValues===key?undefined:checkedValues, cross_comment, order, b_order, search,this.state.page); + this.props.getsonar(teacher_comment,task_status, checkedValues===key?undefined:checkedValues, cross_comment, search) } @@ -564,6 +573,7 @@ class GraduationTaskssettinglist extends Component{ // console.log(result) if(result.data.status===0){ this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page); + this.props.getsonar(teacher_comment,task_status, course_group, cross_comment, search) this.props.showNotification(result.data.message); this.cancelmodel(); this.setState({ @@ -681,7 +691,7 @@ class GraduationTaskssettinglist extends Component{ }) let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state; this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pageNumber); - + this.props.getsonar(teacher_comment,task_status, course_group, cross_comment, search) } /// 确认是否下载 diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index be849f2f5..137a68a66 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -465,6 +465,7 @@ class TPMBanner extends Component { modalsMidval:"• 我们将在1-2个工作日内完成审核", ModalCancel: this.eopenpublicupdatadata, ModalSave: this.eopenpublicupdatadata, + Loadtype:true, modalstyles:"848282" }) } From ac55b6d39d3d4681775989bf7213cc2486d4e009 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 20:02:46 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_tasks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index 117989247..38860d34c 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -225,7 +225,7 @@ class GraduationTasksController < ApplicationController } attachment = work.attachments.last if attachment - o[:downloadUrl] = "https://#{edu_setting('host_name')}/"+download_url(attachment) + o[:downloadUrl] = "#{edu_setting('host_name')}"+download_url(attachment) end o From 04376611ab64d4e95d11744e96e7d968c255599a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 20:10:26 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/tasks/GraduationTaskDetail.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index 2a3537529..f1295cb97 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -315,8 +315,12 @@ class GraduationTaskDetail extends Component{ CodeReview=()=>{ this.props.showNotification("正在导出中..."); const task_Id = this.props.match.params.task_Id; - console.log(this.state.taskdatas) - window.open(`https://test-newweb.educoder.net/api/graduation_tasks/${task_Id}/sonar?teacher_comment=${this.state.taskdatas.teacher_comment}&task_status=${this.state.taskdatas.task_status}&course_group=${this.state.taskdatas.course_group}&cross_comment=${this.state.taskdatas.cross_comment}&search=${this.state.taskdatas.search}&${getRandomNumber(true)}`) + window.open(`https://test-newweb.educoder.net/api/graduation_tasks/${task_Id}/sonar? + ${this.state.taskdatas.teacher_comment===undefined||this.state.taskdatas.teacher_comment===null?"":"teacher_comment="+this.state.taskdatas.teacher_comment} + ${this.state.taskdatas.task_status===undefined||this.state.taskdatas.task_status===null?"":"&task_status="+this.state.taskdatas.task_status} + ${this.state.taskdatas.course_group===undefined||this.state.taskdatas.course_group===null?"":"&course_group="+this.state.taskdatas.course_group} + ${this.state.taskdatas.cross_comment===undefined||this.state.taskdatas.cross_comment===null?"":"&cross_comment="+this.state.taskdatas.cross_comment} + ${this.state.taskdatas.search===undefined||this.state.taskdatas.search===null?"":"&search="+this.state.taskdatas.search+"&"}${getRandomNumber(true)}`) } getsonars=(teacher_comment,task_status,course_group,cross_comment,search)=>{ @@ -539,7 +543,7 @@ class GraduationTaskDetail extends Component{ { this.props.isAdmin() ? questionslist.status===0 ? { this.publish()} }>立即发布 : "" : "" } { this.props.isAdmin() && questionslist.cross_comment ? 交叉评阅设置 : "" } { this.props.isAdmin() ? 编辑任务 : "" } - { this.props.user&&this.props.user.admin===true || this.props.user&&this.props.user.business===true ? this.CodeReview()}>代码评测 : "" } + {/*{ this.props.user&&this.props.user.admin===true || this.props.user&&this.props.user.business===true ? this.CodeReview()}>代码评测 : "" }*/} From 269106eff188e1eb9e818e11ff520ee990b8b599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 20:19:46 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/tasks/GraduationTaskDetail.js | 2 +- public/react/src/modules/question/component/Contentpart.js | 2 +- .../react/src/modules/testpaper/component/Contentpart.js | 7 +------ public/react/src/modules/tpm/NewHeader.js | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index f1295cb97..eba637bd1 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -543,7 +543,7 @@ class GraduationTaskDetail extends Component{ { this.props.isAdmin() ? questionslist.status===0 ? { this.publish()} }>立即发布 : "" : "" } { this.props.isAdmin() && questionslist.cross_comment ? 交叉评阅设置 : "" } { this.props.isAdmin() ? 编辑任务 : "" } - {/*{ this.props.user&&this.props.user.admin===true || this.props.user&&this.props.user.business===true ? this.CodeReview()}>代码评测 : "" }*/} + { this.props.user&&this.props.user.admin===true || this.props.user&&this.props.user.business===true ? this.CodeReview()}>代码评测 : "" } diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 859ab9dd2..9b576af24 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -139,7 +139,7 @@ class Contentpart extends Component { } - .ant-popover-inner-content { + .xaxisreverseorder .ant-popover-inner-content { padding:0px !important; } diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js index 2ff4b92a5..9841ff8a9 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -103,17 +103,12 @@ class Contentpart extends Component { } .sortinxdirection .ant-input-lg { - height: 41px;} + height: 41px;} .sortinxdirection .ant-popover{ top: 348px !important; } - - .ant-popover-inner-content { - padding:0px !important; - } - ` } diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 6e27f9591..64787c72b 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1033,13 +1033,13 @@ submittojoinclass=(value)=>{ top: 63px !important; } - .ant-popover-inner-content { + .questionbanks .ant-popover-inner-content { padding:0px !important; } ` } - {/*
  • */} + {/*
  • */} {/* */} {/*
    */} {/*
    Date: Tue, 7 Jan 2020 20:26:52 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/common/UrlTool.js | 2 +- .../modules/courses/graduation/tasks/GraduationTaskDetail.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/common/UrlTool.js b/public/react/src/common/UrlTool.js index 3f40b8d1b..26f44a2e5 100644 --- a/public/react/src/common/UrlTool.js +++ b/public/react/src/common/UrlTool.js @@ -122,7 +122,7 @@ export function getUploadActionUrlOfAuth(id) { export function getRandomNumber(type) { Railsgettimes() let anewopens=md5(newopens+newtimestamp); - return type===true?`&randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}` + return type===true?`randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}` } export function test(path) { diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index eba637bd1..43f651527 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -315,12 +315,13 @@ class GraduationTaskDetail extends Component{ CodeReview=()=>{ this.props.showNotification("正在导出中..."); const task_Id = this.props.match.params.task_Id; - window.open(`https://test-newweb.educoder.net/api/graduation_tasks/${task_Id}/sonar? + window.open(`/api/graduation_tasks/${task_Id}/sonar? ${this.state.taskdatas.teacher_comment===undefined||this.state.taskdatas.teacher_comment===null?"":"teacher_comment="+this.state.taskdatas.teacher_comment} ${this.state.taskdatas.task_status===undefined||this.state.taskdatas.task_status===null?"":"&task_status="+this.state.taskdatas.task_status} ${this.state.taskdatas.course_group===undefined||this.state.taskdatas.course_group===null?"":"&course_group="+this.state.taskdatas.course_group} ${this.state.taskdatas.cross_comment===undefined||this.state.taskdatas.cross_comment===null?"":"&cross_comment="+this.state.taskdatas.cross_comment} ${this.state.taskdatas.search===undefined||this.state.taskdatas.search===null?"":"&search="+this.state.taskdatas.search+"&"}${getRandomNumber(true)}`) + } getsonars=(teacher_comment,task_status,course_group,cross_comment,search)=>{ @@ -543,7 +544,7 @@ class GraduationTaskDetail extends Component{ { this.props.isAdmin() ? questionslist.status===0 ? { this.publish()} }>立即发布 : "" : "" } { this.props.isAdmin() && questionslist.cross_comment ? 交叉评阅设置 : "" } { this.props.isAdmin() ? 编辑任务 : "" } - { this.props.user&&this.props.user.admin===true || this.props.user&&this.props.user.business===true ? this.CodeReview()}>代码评测 : "" } + {/*{ this.props.user&&this.props.user.admin===true || this.props.user&&this.props.user.business===true ? this.CodeReview()}>代码评测 : "" }*/}
    From 7a560bc67c2de7c8caba4e965c8a0c573a8fe6c2 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 20:58:54 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20200107125721_migrate_zip_pack_column.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20200107125721_migrate_zip_pack_column.rb diff --git a/db/migrate/20200107125721_migrate_zip_pack_column.rb b/db/migrate/20200107125721_migrate_zip_pack_column.rb new file mode 100644 index 000000000..6beeb11d2 --- /dev/null +++ b/db/migrate/20200107125721_migrate_zip_pack_column.rb @@ -0,0 +1,5 @@ +class MigrateZipPackColumn < ActiveRecord::Migration[5.2] + def change + change_column :zip_packs, :pack_size, :float + end +end From b696363d9f948b8dbd1781a02079599a994bbe09 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 21:09:05 +0800 Subject: [PATCH 9/9] =?UTF-8?q?json=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_tasks_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index 38860d34c..dcb9a3bc3 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -216,6 +216,7 @@ class GraduationTasksController < ApplicationController tip_exception(403, "无权限访问") unless current_user.admin_or_business? _tasks_list + @work_list = @work_list.where("work_status > 0") person_list = @work_list.map do |work| o = {