From 5e8cfed6cd8e19806a44267393c93b0f6d461715 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Wed, 24 Jul 2019 13:20:00 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=93=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 0a19f1c08..4382dff94 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -209,10 +209,10 @@ class MyshixunsController < ApplicationController end uid_logger("training_task_status start#4**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") sucess_status - rescue Exception => e - tip_exception(e.message) - uid_logger_error("training_task_status error: #{e}") - raise ActiveRecord::Rollback + # rescue Exception => e + # tip_exception(e.message) + # uid_logger_error("training_task_status error: #{e}") + # raise ActiveRecord::Rollback end end end From b9e88f1d1c1073a8c9f9fbf4bd2d5fd7f12a2c88 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Wed, 24 Jul 2019 13:27:11 +0800 Subject: [PATCH 02/28] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 4382dff94..41b02f8ab 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -93,6 +93,7 @@ class MyshixunsController < ApplicationController ActiveRecord::Base.transaction do begin t1 = Time.now + Rails.logger.info("@@@222222#{params[:jsonTestDetails]}") jsonTestDetails = JSON.parse(params[:jsonTestDetails]) timeCost = JSON.parse(params[:timeCost]) brige_end_time = Time.parse(timeCost['evaluateEnd']) if timeCost['evaluateEnd'].present? From 3ba0a4bc9523c210a97f18f9672de637c42f1bfc Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 24 Jul 2019 13:42:55 +0800 Subject: [PATCH 03/28] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 0a19f1c08..237f4b350 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -93,7 +93,7 @@ class MyshixunsController < ApplicationController ActiveRecord::Base.transaction do begin t1 = Time.now - jsonTestDetails = JSON.parse(params[:jsonTestDetails]) + jsonTestDetails = JSON.parse(params[:jsonTestDetails].to_json) timeCost = JSON.parse(params[:timeCost]) brige_end_time = Time.parse(timeCost['evaluateEnd']) if timeCost['evaluateEnd'].present? return_back_time = format("%.3f", ( t1.to_f - brige_end_time.to_f)).to_f @@ -131,7 +131,10 @@ class MyshixunsController < ApplicationController logger.info "actual_output:################################################# #{actual_output}" ts_time = format("%.2f", j_test_set['testSetTime'].to_f/1000000000).to_f ts_mem = format("%.2f", j_test_set['testSetMem'].to_f/1024/1024).to_f - + sql = Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'], + :actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index, + :compile_success => compile_success.to_i, :sec_key => sec_key, :ts_time => ts_time, :ts_mem => ts_mem).to_sql + logger.info("outputs_sql: #{sql}") Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'], :actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index, :compile_success => compile_success.to_i, :sec_key => sec_key, :ts_time => ts_time, :ts_mem => ts_mem) From a00edf38ec600c4cb2ecd576203d5784cef905e3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 24 Jul 2019 13:47:31 +0800 Subject: [PATCH 04/28] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 262fbd50c..41b02f8ab 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -132,10 +132,7 @@ class MyshixunsController < ApplicationController logger.info "actual_output:################################################# #{actual_output}" ts_time = format("%.2f", j_test_set['testSetTime'].to_f/1000000000).to_f ts_mem = format("%.2f", j_test_set['testSetMem'].to_f/1024/1024).to_f - sql = Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'], - :actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index, - :compile_success => compile_success.to_i, :sec_key => sec_key, :ts_time => ts_time, :ts_mem => ts_mem).to_sql - logger.info("outputs_sql: #{sql}") + Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'], :actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index, :compile_success => compile_success.to_i, :sec_key => sec_key, :ts_time => ts_time, :ts_mem => ts_mem) From 78a31d1b4b9bdeed1a3525bed88688c97cb858ed Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 24 Jul 2019 13:52:46 +0800 Subject: [PATCH 05/28] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 41b02f8ab..649516a03 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -130,8 +130,8 @@ class MyshixunsController < ApplicationController # is_public = test_sets.where(:position => j_test_set['caseId']).first.try(:is_public) logger.info "actual_output:################################################# #{actual_output}" - ts_time = format("%.2f", j_test_set['testSetTime'].to_f/1000000000).to_f - ts_mem = format("%.2f", j_test_set['testSetMem'].to_f/1024/1024).to_f + ts_time = format("%.2f", j_test_set['testSetTime'].to_f/1000000000).to_f if j_test_set['testSetTime'] + ts_mem = format("%.2f", j_test_set['testSetMem'].to_f/1024/1024).to_f if j_test_set['testSetMem'] Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'], :actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index, From baa38da183b485bcfbfe335af788aafd12b7dd02 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 24 Jul 2019 13:57:39 +0800 Subject: [PATCH 06/28] =?UTF-8?q?=E6=B2=A1=E4=BB=A3=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=AF=84=E6=B5=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cf7ac6d2e..2ab0c6649 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -319,6 +319,7 @@ class ApplicationController < ActionController::Base # 通关后,把最后一次成功的代码存到数据库 # type 0 创始内容, 1 最新内容 def game_passed_code(path, myshixun, game_id) + return if path.blank? file_content = git_fle_content myshixun.repo_path, path unless file_content.present? raise("获取文件代码异常") From b0171aef5dba65d5319e2535af0897168a51899e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 24 Jul 2019 14:01:28 +0800 Subject: [PATCH 07/28] =?UTF-8?q?=E9=9A=90=E8=97=8F=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=9A=84=E5=AE=9E=E8=AE=AD=E3=80=82=E8=AF=84?= =?UTF-8?q?=E6=B5=8B=E9=80=9A=E8=BF=87=E4=B8=8D=E4=BF=9D=E5=AD=98=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2ab0c6649..5eca6ccf9 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -319,7 +319,8 @@ class ApplicationController < ActionController::Base # 通关后,把最后一次成功的代码存到数据库 # type 0 创始内容, 1 最新内容 def game_passed_code(path, myshixun, game_id) - return if path.blank? + # 如果代码窗口是隐藏的,则不用保存代码 + return if myshixun.shixun.hide_code file_content = git_fle_content myshixun.repo_path, path unless file_content.present? raise("获取文件代码异常") From e77ad0d04db7e95201a20a219e9786a2d5e05dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 24 Jul 2019 14:04:36 +0800 Subject: [PATCH 08/28] =?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 | 7 +++---- public/react/src/modules/courses/new/CoursesNew.js | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 02d8c2be5..0666aadc3 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -18,10 +18,9 @@ function locationurl(list){ } // TODO 开发期多个身份切换 -const debugType ="" -// window.location.search.indexOf('debug=t') != -1 ? 'teacher' : -// window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' -// window._debugType = debugType; +const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : + window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' +window._debugType = debugType; export function initAxiosInterceptors(props) { // TODO 避免重复的请求 https://github.com/axios/axios#cancellation diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 1183b59e9..eb52a32f5 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -135,6 +135,8 @@ class CoursesNew extends Component { let {is_public,datatime} = this.state // console.log(is_public) + debugger + if (coursesId != undefined) { // 编辑 @@ -180,7 +182,7 @@ class CoursesNew extends Component { name: values.classroom, class_period: values.period, credit: parseFloat(values.credit), - end_date: datatime, + end_date: datatime===undefined?"":datatime, is_public: is_public === true || is_public === 1 ? 1 : 0, course_module_types: values.checkboxgroup, authentication: this.state.Realnamecertification, @@ -234,7 +236,7 @@ class CoursesNew extends Component { name: values.classroom, class_period: values.period, credit: parseFloat(values.credit), - end_date: datatime, + end_date: datatime===undefined?"":datatime, is_public: is_public === true || is_public === 1 ? 1 : 0, course_module_types: values.checkboxgroup, authentication: this.state.Realnamecertification, From d3eee68c74f7fafe9bce2c033efefa0223a64772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 24 Jul 2019 14:08:18 +0800 Subject: [PATCH 09/28] =?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/modules/user/Interestpage.js | 6 +++--- public/react/src/modules/user/InterestpageMax.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js index 4c3c39406..b3abfe1a4 100644 --- a/public/react/src/modules/user/Interestpage.js +++ b/public/react/src/modules/user/Interestpage.js @@ -258,15 +258,15 @@ class InterestpageComponent extends Component {
this.Clickteacher("teacher")}>{gouxuans ==="teacher"? :}老师
-
+
this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg"/>
this.Clickteacher("student")}>{gouxuans==="student"? :}学生
-
+
this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg"/>
this.Clickteacher("professional")}>{gouxuans==="professional"?:}专业人士
-
+
this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg"/>

选择你可能感兴趣的内容

diff --git a/public/react/src/modules/user/InterestpageMax.js b/public/react/src/modules/user/InterestpageMax.js index 82b3e7e0f..a53c1bbe0 100644 --- a/public/react/src/modules/user/InterestpageMax.js +++ b/public/react/src/modules/user/InterestpageMax.js @@ -260,15 +260,15 @@ class InterestpageMax extends Component {
this.Clickteacher("teacher")}>{gouxuans ==="teacher"? :}老师
-
+
this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg2"/>
this.Clickteacher("student")}>{gouxuans==="student"? :}学生
-
+
this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg2"/>
this.Clickteacher("professional")}>{gouxuans==="professional"?:}专业人士
-
+
this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg2"/>
选择你可能感兴趣的内容
From 620dbd461e417dee210b4177fd8442d56aacad76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 24 Jul 2019 14:13:12 +0800 Subject: [PATCH 10/28] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../paths/PathDetail/PathDetailIndex.js | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 7211fde5e..1731064c0 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -139,21 +139,20 @@ class PathDetailIndex extends Component{ let pathid=this.props.match.params.pathId; let url="/paths/"+pathid+".json"; axios.get(url).then((result)=>{ - if (result.data.status == 407 || result.data.status == 401) { + if (result.data.status === 407 || result.data.status === 401) { return; } - if(result.data.allow_visit===true){ - this.setState({ - detailInfoList:result.data, - items: getItems(result.data.members.length), - }) - }else{ - window.location.href = "/403"; - // this.setState({ - // Modalstype:true, - // Modalstopval:'你没有权限访问,请联系对应课程管理人员开通', - // }) - } + + if (result.data.status === 403) { + return; + } + + if(result.data.allow_visit===true){ + this.setState({ + detailInfoList:result.data, + items: getItems(result.data.members.length), + }) + } }).catch((error)=>{ console.log(error); @@ -168,6 +167,9 @@ class PathDetailIndex extends Component{ if (result.data.status == 407 || result.data.status == 401) { return; } + if (result.data.status === 403 ) { + return; + } if(result.data.allow_visit===true){ this.setState({ @@ -175,13 +177,8 @@ class PathDetailIndex extends Component{ items: getItems(result.data.members.length), user_id:undefined, }) - }else{ - window.location.href = "/403"; - // this.setState({ - // Modalstype:true, - // Modalstopval:'你没有权限访问,请联系对应课程管理人员开通', - // }) } + }).catch((error)=>{ console.log(error); }) From 486d025809db2d7bb798fb008488ffc1f9e72204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 24 Jul 2019 14:23:30 +0800 Subject: [PATCH 11/28] =?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 | 3 +- .../courses/coursesPublic/ShixunModal.js | 1 - .../tasks/GraduationTasksSubmitnew.js | 1 - .../topics/GraduateTopicDetailTable.js | 614 +++++++++--------- .../src/modules/courses/new/CoursesNew.js | 3 - .../react/src/modules/courses/poll/PollNew.js | 1 - .../shixunHomework/Listofworksstudentone.js | 2 +- public/react/src/modules/login/LoginDialog.js | 13 +- .../paths/PathDetail/DetailCardsEditAndAdd.js | 1 - public/react/src/modules/tpm/NewHeader.js | 3 - 10 files changed, 317 insertions(+), 325 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 0666aadc3..f79041105 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -18,7 +18,8 @@ function locationurl(list){ } // TODO 开发期多个身份切换 -const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +const debugType ="" + window.location.search.indexOf('debug=t') != -1 ? 'teacher' : window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/public/react/src/modules/courses/coursesPublic/ShixunModal.js b/public/react/src/modules/courses/coursesPublic/ShixunModal.js index 56cecc51b..de9609d0f 100644 --- a/public/react/src/modules/courses/coursesPublic/ShixunModal.js +++ b/public/react/src/modules/courses/coursesPublic/ShixunModal.js @@ -82,7 +82,6 @@ class ShixunModal extends Component{ //勾选实训 shixunhomeworkedit=(list)=>{ -debugger let newpatheditarry=[]; if (this.props.singleChoose == true) { if (list.length > 0) { diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index 355a514a4..50f2a4fde 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -117,7 +117,6 @@ class GraduationTasksSubmitnew extends Component{ } // 附件相关 START handleChange = (info) => { - debugger if (info.file.status === 'uploading') { let fileList = info.fileList; this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js index c9bd3f496..eae3fb43d 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js @@ -1,309 +1,307 @@ -import React,{ Component } from "react"; - -import '../../css/members.css' -import '../../css/busyWork.css' -import '../style.css' - -import { WordsBtn } from 'educoder' -import NoneData from '../../coursesPublic/NoneData' -import Modals from "../../../modals/Modals" -import axios from 'axios' -import { Modal,Select,Input } from "antd"; - -const Option = Select.Option -class GraduateTopicDetailTable extends Component{ - constructor(props){ - super(props); - this.state={ - modalsType:false, - modalsTopval:'', - operationId:undefined, - agreeFlag:false, - classesId:undefined, - agreeCheck:false, - visible:false, - un_addClass:undefined, - un_addClass_notice:"", - un_choose_notice:"" - } - } - // 拒绝 - aboutTopic=(id)=>{ - this.setState({ - modalsType:true, - modalsTopval:'是否确认拒绝学生选题?', - operationId:id - }) - } - cancelAboutTopic=()=>{ - this.setState({ - modalsType:false, - modalsTopval:'' - }) - } - sureAboutTopic=()=>{ - let{operationId}=this.state - let courseId=this.props.match.params.course_id; - let graduation_topic_id=this.props.match.params.graduation_topic_id; - let url =`/courses/${courseId}/graduation_topics/${graduation_topic_id}/refuse_student_topic.json?student_graduation_topic=`+operationId; - axios.post(url).then((result)=>{ - if(result.data.status==0){ - this.props.showNotification(`${result.data.message}`); - this.setState({ - modalsType:false, - modalsTopval:'' - }) - //成功后调用列表接口,刷新 - this.props.getDetailList(this.props.page); - } - }).catch((error)=>{ - console.log(error); - }) - this.setState({ - modalsType:false, - modalsTopval:'' - }) - } - - //同意 - agreeTopic=(id)=>{ - this.setState({ - agreeFlag:true, - operationId:id - }) - } - hideAgreeTopic=()=>{ - this.setState({ - agreeFlag:false, - classesId:undefined - }) - } - sureAgreeTopic=(count)=>{ - if(count > 0){ - debugger - let{tableData}=this.props; - let{operationId,classesId}=this.state - let courseId=this.props.match.params.course_id; - let name=tableData.group_list.filter(item=>item.group_id==classesId)[0].group_name; - this.agreeChoose(courseId,operationId,classesId,name); - }else{ - this.setState({ - un_choose_notice:"请先添加分班" - }) - } - } - - agreeChoose=(courseId,operationId,classesId,courseName)=>{ - let graduation_topic_id=this.props.match.params.graduation_topic_id; - let url =`/courses/${courseId}/graduation_topics/${graduation_topic_id}/accept_student_topic.json`; - axios.post(url,{ - student_graduation_topic_id:operationId, - group_id:classesId, - course_group_name:courseName - }).then((result)=>{ - if(result.data.status==0){ - this.props.showNotification(`${result.data.message}`); - this.setState({ - agreeFlag:false, - agreeCheck:true, - visible:false - }) - //成功后调用列表接口,刷新 - this.props.getDetailList(this.props.page); - } - }).catch((error)=>{ - console.log(error); - }) - } - - //切换分班 - changeClasses=(value)=>{ - debugger - this.setState({ - classesId:value - }) - } - - //新增分班 - topicAddClasses=()=>{ - this.setState({ - visible:true, - agreeFlag:false - }) - } - hideClasses=()=>{ - this.setState({ - visible:false, - classesId:undefined - }) - } - - //新建分班--输入分班 - inputClasses=(e)=>{ - this.setState({ - un_addClass:e.target.value - }) - } - - // 新建分班---确定 - sureAddClass=()=>{ - let {un_addClass}=this.state; - if(!un_addClass){ - this.setState({ - un_addClass_notice:"请输入分班名称" - }) - return; - } - console.log(this.props) - let{operationId}=this.state - let courseId=this.props.match.params.course_id; - this.agreeChoose(courseId,operationId,-1,un_addClass); - } - - render(){ - let {page,tableData}=this.props - let { modalsType,modalsTopval,agreeFlag,classesId,visible - ,un_addClass_notice - ,un_addClass, - un_choose_notice - } = this.state - const isAdmin =this.props.isAdmin(); - const isStudent =this.props.isStudent(); - const isNotMember=this.props.isNotMember(); - console.log(un_addClass_notice) - return( -
-
-
- 序号 - 姓名 - {isNotMember ?"" :学号} - 分班 - 选题时间 - 操作 - { - isAdmin && - 确认结果 - } - -
- {/* 拒绝弹框 */} - - {/* 同意弹框 */} - -
-

确认同意学生的选题,将学生加入我的分班

-
- 选择: -
- -

{un_choose_notice}

-
-
- -
-
- -
-
- 分班: -
- -

- {un_addClass_notice} -

-
-
-
- 取消 - 确定 -
-
-
-
- { - tableData.users_list && tableData.users_list.length > 0 && tableData.users_list.map((item,key)=>{ - return( -
  • - {parseInt(key+1)+(parseInt(page-1)*15)} - {item.student_name} - {isNotMember ?"" :{item.student_id}} - {item.class_group_name || "--"} - {item.selected_time} - { - isAdmin && - - { - item.result == "待确认" ? - - this.aboutTopic(`${item.id}`)}>拒绝 - this.agreeTopic(`${item.id}`)}>同意 - : - ( - item.result === "已拒绝" ? -- - : - this.aboutTopic(`${item.id}`)}>拒绝 - ) - } - - } - { - isStudent && - {item.result} - } - { - isAdmin && - {item.result=== "待确认"?"--":item.result} - } - { - isNotMember && -- - } - -
  • - ) - }) - } - { - tableData.users_list && tableData.users_list.length == 0 && - } -
    -
    -
    - ) - } -} +import React,{ Component } from "react"; + +import '../../css/members.css' +import '../../css/busyWork.css' +import '../style.css' + +import { WordsBtn } from 'educoder' +import NoneData from '../../coursesPublic/NoneData' +import Modals from "../../../modals/Modals" +import axios from 'axios' +import { Modal,Select,Input } from "antd"; + +const Option = Select.Option +class GraduateTopicDetailTable extends Component{ + constructor(props){ + super(props); + this.state={ + modalsType:false, + modalsTopval:'', + operationId:undefined, + agreeFlag:false, + classesId:undefined, + agreeCheck:false, + visible:false, + un_addClass:undefined, + un_addClass_notice:"", + un_choose_notice:"" + } + } + // 拒绝 + aboutTopic=(id)=>{ + this.setState({ + modalsType:true, + modalsTopval:'是否确认拒绝学生选题?', + operationId:id + }) + } + cancelAboutTopic=()=>{ + this.setState({ + modalsType:false, + modalsTopval:'' + }) + } + sureAboutTopic=()=>{ + let{operationId}=this.state + let courseId=this.props.match.params.course_id; + let graduation_topic_id=this.props.match.params.graduation_topic_id; + let url =`/courses/${courseId}/graduation_topics/${graduation_topic_id}/refuse_student_topic.json?student_graduation_topic=`+operationId; + axios.post(url).then((result)=>{ + if(result.data.status==0){ + this.props.showNotification(`${result.data.message}`); + this.setState({ + modalsType:false, + modalsTopval:'' + }) + //成功后调用列表接口,刷新 + this.props.getDetailList(this.props.page); + } + }).catch((error)=>{ + console.log(error); + }) + this.setState({ + modalsType:false, + modalsTopval:'' + }) + } + + //同意 + agreeTopic=(id)=>{ + this.setState({ + agreeFlag:true, + operationId:id + }) + } + hideAgreeTopic=()=>{ + this.setState({ + agreeFlag:false, + classesId:undefined + }) + } + sureAgreeTopic=(count)=>{ + if(count > 0){ + let{tableData}=this.props; + let{operationId,classesId}=this.state + let courseId=this.props.match.params.course_id; + let name=tableData.group_list.filter(item=>item.group_id==classesId)[0].group_name; + this.agreeChoose(courseId,operationId,classesId,name); + }else{ + this.setState({ + un_choose_notice:"请先添加分班" + }) + } + } + + agreeChoose=(courseId,operationId,classesId,courseName)=>{ + let graduation_topic_id=this.props.match.params.graduation_topic_id; + let url =`/courses/${courseId}/graduation_topics/${graduation_topic_id}/accept_student_topic.json`; + axios.post(url,{ + student_graduation_topic_id:operationId, + group_id:classesId, + course_group_name:courseName + }).then((result)=>{ + if(result.data.status==0){ + this.props.showNotification(`${result.data.message}`); + this.setState({ + agreeFlag:false, + agreeCheck:true, + visible:false + }) + //成功后调用列表接口,刷新 + this.props.getDetailList(this.props.page); + } + }).catch((error)=>{ + console.log(error); + }) + } + + //切换分班 + changeClasses=(value)=>{ + this.setState({ + classesId:value + }) + } + + //新增分班 + topicAddClasses=()=>{ + this.setState({ + visible:true, + agreeFlag:false + }) + } + hideClasses=()=>{ + this.setState({ + visible:false, + classesId:undefined + }) + } + + //新建分班--输入分班 + inputClasses=(e)=>{ + this.setState({ + un_addClass:e.target.value + }) + } + + // 新建分班---确定 + sureAddClass=()=>{ + let {un_addClass}=this.state; + if(!un_addClass){ + this.setState({ + un_addClass_notice:"请输入分班名称" + }) + return; + } + console.log(this.props) + let{operationId}=this.state + let courseId=this.props.match.params.course_id; + this.agreeChoose(courseId,operationId,-1,un_addClass); + } + + render(){ + let {page,tableData}=this.props + let { modalsType,modalsTopval,agreeFlag,classesId,visible + ,un_addClass_notice + ,un_addClass, + un_choose_notice + } = this.state + const isAdmin =this.props.isAdmin(); + const isStudent =this.props.isStudent(); + const isNotMember=this.props.isNotMember(); + console.log(un_addClass_notice) + return( +
    +
    +
    + 序号 + 姓名 + {isNotMember ?"" :学号} + 分班 + 选题时间 + 操作 + { + isAdmin && + 确认结果 + } + +
    + {/* 拒绝弹框 */} + + {/* 同意弹框 */} + +
    +

    确认同意学生的选题,将学生加入我的分班

    +
    + 选择: +
    + +

    {un_choose_notice}

    +
    +
    + +
    +
    + +
    +
    + 分班: +
    + +

    + {un_addClass_notice} +

    +
    +
    +
    + 取消 + 确定 +
    +
    +
    +
    + { + tableData.users_list && tableData.users_list.length > 0 && tableData.users_list.map((item,key)=>{ + return( +
  • + {parseInt(key+1)+(parseInt(page-1)*15)} + {item.student_name} + {isNotMember ?"" :{item.student_id}} + {item.class_group_name || "--"} + {item.selected_time} + { + isAdmin && + + { + item.result == "待确认" ? + + this.aboutTopic(`${item.id}`)}>拒绝 + this.agreeTopic(`${item.id}`)}>同意 + : + ( + item.result === "已拒绝" ? -- + : + this.aboutTopic(`${item.id}`)}>拒绝 + ) + } + + } + { + isStudent && + {item.result} + } + { + isAdmin && + {item.result=== "待确认"?"--":item.result} + } + { + isNotMember && -- + } + +
  • + ) + }) + } + { + tableData.users_list && tableData.users_list.length == 0 && + } +
    +
    +
    + ) + } +} export default GraduateTopicDetailTable; \ No newline at end of file diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index eb52a32f5..e819111c5 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -134,9 +134,6 @@ class CoursesNew extends Component { let coursesId = this.props.match.params.coursesId; let {is_public,datatime} = this.state // console.log(is_public) - - debugger - if (coursesId != undefined) { // 编辑 diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 675e355f3..cf415aa28 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -2074,7 +2074,6 @@ class PollNew extends Component { //最小值 HandleGradationGroupChangee = (value, index, max, length) => { - debugger var minbool = false; var maxbool = false; let arr = this.state.adddom; diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 60a8512d5..db58e95fd 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -993,7 +993,7 @@ class Listofworksstudentone extends Component { } axios.post(urll, datasysl).then((result) => { console.log("980000000____________________"); - debugger + if(result === undefined){ return } diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 7629eeef2..395f2d9ba 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -337,6 +337,7 @@ class LoginDialog extends Component { } loginEDU=()=>{ + let {loginValue,passValue,regular,isGoingValue}=this.state; if(regular===1){ return @@ -372,14 +373,16 @@ class LoginDialog extends Component { this.setState({ isRender:false }) + this.props.Modifyloginvalue(); window.location.reload(); + } } - try { - this.props.Modifyloginvalue(); - }catch (e) { - - } + // try { + // this.props.Modifyloginvalue(); + // }catch (e) { + // + // } }).catch((error) => { console.log("356"); console.log(error) diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index fc0a0fea9..5534dd415 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -298,7 +298,6 @@ class DetailCardsEditAndAdd extends Component{ //滑动到底判断 if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ // console.log("到达底部"); - debugger this.setState({ hometypepvisible:true }) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 37fac626d..d96c59381 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -487,7 +487,6 @@ submittojoinclass=(value)=>{ } showSearchOpen=(e)=>{ - debugger this.setState({ showSearchOpentype:true }) @@ -495,7 +494,6 @@ submittojoinclass=(value)=>{ } hideshowSearchOpen=(e)=>{ - debugger let {setevaluatinghides}=this.state; if(setevaluatinghides===true){ this.setState({ @@ -520,7 +518,6 @@ submittojoinclass=(value)=>{ } setevaluatinghides=()=>{ - debugger this.setState( { setevaluatinghides:true From ce81fb2a3013ec2059ae703de3c8f0d783fa0df2 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 24 Jul 2019 14:46:31 +0800 Subject: [PATCH 12/28] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index e1d6fe0cb..7403cfc4d 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -90,7 +90,7 @@ class MyshixunsController < ApplicationController # params[:pics] = "a.png,b.png,c.png" def training_task_status - logger.info("##################training_task_status_start#{jsonTestDetails['buildID']}") + logger.info("##################training_task_status_start#{params[:jsonTestDetails]['buildID']}") ActiveRecord::Base.transaction do begin t1 = Time.now From 3801ca041ace173067715b8369f8013e9ec9a2c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 24 Jul 2019 14:46:55 +0800 Subject: [PATCH 13/28] =?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 | 3 +-- .../modules/courses/coursesPublic/PathModal.js | 15 +++++++++++---- .../modules/courses/coursesPublic/ShixunModal.js | 10 +++++++--- public/react/src/modules/tpm/NewHeader.js | 1 - 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index f79041105..0666aadc3 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -18,8 +18,7 @@ function locationurl(list){ } // TODO 开发期多个身份切换 -const debugType ="" - window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/public/react/src/modules/courses/coursesPublic/PathModal.js b/public/react/src/modules/courses/coursesPublic/PathModal.js index 10a298c90..43901c87a 100644 --- a/public/react/src/modules/courses/coursesPublic/PathModal.js +++ b/public/react/src/modules/courses/coursesPublic/PathModal.js @@ -91,7 +91,7 @@ class PathModal extends Component{ this.setState({ type:types, page:1, - newshixunmodallist:[] + newshixunmodallist:undefined }) this.funshixunpathlist(Searchvalue,types,true,1) } @@ -105,7 +105,7 @@ class PathModal extends Component{ SenttotheSearch=(value)=>{ this.setState({ page:1, - newshixunmodallist:[] + newshixunmodallist:undefined }) let{type}=this.state; this.funshixunpathlist(value,type,true,1) @@ -267,12 +267,19 @@ class PathModal extends Component{ margin-top:0px !important; height: 40px; } + `} - { newshixunmodallist&&newshixunmodallist.length===0?"":
    :newshixunmodallist&&newshixunmodallist.length===0?
    +
    + +

    暂时还没有相关数据哦!

    +
    :
    + style={{height:"204px"}}> { diff --git a/public/react/src/modules/courses/coursesPublic/ShixunModal.js b/public/react/src/modules/courses/coursesPublic/ShixunModal.js index de9609d0f..1ae63da90 100644 --- a/public/react/src/modules/courses/coursesPublic/ShixunModal.js +++ b/public/react/src/modules/courses/coursesPublic/ShixunModal.js @@ -329,7 +329,7 @@ class ShixunModal extends Component{
    + > + this.applyForAddOrgForm = form} schoolName={school} + {...propsWithoutForm}> {/*提示*/} -
    - - {getFieldDecorator('school', { - rules: [{required: true, message: "不能为空"}], - })( - - )} - - {/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/} - -
    -
    -
    + {/*
    */} + + {/*
    */}
    @@ -455,7 +473,6 @@ class CoursesNew extends Component { > {options} - )} {/*(错误示例:数据结构2017本部;数据结构2017秋季;数据结构2017电子商务1班)*/} @@ -605,7 +622,7 @@ class CoursesNew extends Component {
    -
    +
    (选中后本课堂对所有用户可见,否则仅本课堂成员可见)
    + +
    + + {getFieldDecorator('school', { + rules: [{required: true, message: "不能为空"}], + })( + + )} + + {/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/} + +
    +
    + + {searchlistscholl.length===0?
    + + 未找到包含“{school}”的高校, + 申请新增 + +
    :""} + +
    + + +
    - -
    + +
    diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 395f2d9ba..d3df6090e 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -411,6 +411,7 @@ class LoginDialog extends Component { this.handleDialogClose()} > {isRender===true? @@ -477,7 +478,7 @@ class LoginDialog extends Component { 登录
    -

    +

    ", - testIcon1: "
    " - }, - //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。 - saveHTMLToTextarea: true, - // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标 - dialogMaskOpacity: 0.6, - placeholder: placeholder, - imageUpload: true, - imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], - imageUploadURL: imageUrl,//url - onload: function () { - // this.previewing(); - $("#" + id + " [type=\"latex\"]").bind("click", function () { - editorName.cm.replaceSelection("```latex"); - editorName.cm.replaceSelection("\n"); - editorName.cm.replaceSelection("\n"); - editorName.cm.replaceSelection("```"); - var __Cursor = editorName.cm.getDoc().getCursor(); - editorName.cm.setCursor(__Cursor.line - 1, 0); - }); - - $("#" + id + " [type=\"inline\"]").bind("click", function () { - editorName.cm.replaceSelection("$$$$"); - var __Cursor = editorName.cm.getDoc().getCursor(); - editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); - editorName.cm.focus(); - }); - $("[type=\"inline\"]").attr("title", "行内公式"); - $("[type=\"latex\"]").attr("title", "多行公式"); - - window.md_elocalStorage(editorName, `exercise__${id}`, "Memochallengesnew"); - - callback && callback() - } - }); - return editorName; + var editorName = window.editormd(id, { + width: width, + height: high, + path: path, // "/editormd/lib/" + + syncScrolling: "single", + tex: true, + tocm: true, + emoji: true, + taskList: true, + codeFold: true, + searchReplace: true, + htmlDecode: "style,script,iframe", + sequenceDiagram: true, + autoFocus: false, + toolbarIcons: function () { + // Or return editormd.toolbarModes[name]; // full, simple, mini + // Using "||" set icons align right. + return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"] + }, + toolbarCustomIcons: { + testIcon: "
    ", + testIcon1: "
    " + }, + //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。 + saveHTMLToTextarea: true, + // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标 + dialogMaskOpacity: 0.6, + placeholder: placeholder, + imageUpload: true, + imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], + imageUploadURL: imageUrl,//url + onload: function () { + // this.previewing(); + $("#" + id + " [type=\"latex\"]").bind("click", function () { + editorName.cm.replaceSelection("```latex"); + editorName.cm.replaceSelection("\n"); + editorName.cm.replaceSelection("\n"); + editorName.cm.replaceSelection("```"); + var __Cursor = editorName.cm.getDoc().getCursor(); + editorName.cm.setCursor(__Cursor.line - 1, 0); + }); + + $("#" + id + " [type=\"inline\"]").bind("click", function () { + editorName.cm.replaceSelection("$$$$"); + var __Cursor = editorName.cm.getDoc().getCursor(); + editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); + editorName.cm.focus(); + }); + $("[type=\"inline\"]").attr("title", "行内公式"); + $("[type=\"latex\"]").attr("title", "多行公式"); + + window.md_elocalStorage(editorName, `exercise__${id}`, "Memochallengesnew"); + + callback && callback() + } + }); + return editorName; } export default class TPMevaluation extends Component { - constructor(props) { - super(props) - this.state = { - choice_url: undefined, - practice_url: undefined, - go_back_url: undefined, - task_pass_default: undefined, - submit_url: undefined, - value: 1, - evaluationlist:[], - shixunId:undefined, - power:false, - shixunfilepath:undefined, - evaluationvisible:false, - trees:undefined, - path:"", - main:[], - saveshixunfilepath:undefined, - selectpath:undefined, - shixunfilepathplay:undefined, - shixunfileexpectpicturepath:undefined, - shixunfilestandardpicturepath:undefined, - shixunfilepicturepath:undefined, - pathoptionvalue:-1, - showrepositoryurltiptype: false, - prev_challenge: undefined, - next_challenge: undefined, - StudentTaskPapers:false, - StudentTaskDocs:false, - selectpatharr:[], - handpathopt:false, - scorevalue:false, - markvalue:true, - scoretype:undefined - } - } - - - exerciseMD(initValue, id) { - - this.contentChanged = false; - const placeholder = ""; + constructor(props) { + super(props) + this.state = { + choice_url: undefined, + practice_url: undefined, + go_back_url: undefined, + task_pass_default: undefined, + submit_url: undefined, + value: 1, + evaluationlist:[], + shixunId:undefined, + power:false, + shixunfilepath:undefined, + evaluationvisible:false, + trees:undefined, + path:"", + main:[], + saveshixunfilepath:undefined, + selectpath:undefined, + shixunfilepathplay:undefined, + shixunfileexpectpicturepath:undefined, + shixunfilestandardpicturepath:undefined, + shixunfilepicturepath:undefined, + pathoptionvalue:-1, + showrepositoryurltiptype: false, + prev_challenge: undefined, + next_challenge: undefined, + StudentTaskPapers:false, + StudentTaskDocs:false, + selectpatharr:[], + handpathopt:false, + scorevalue:false, + markvalue:true, + scoretype:undefined + } + } + + + exerciseMD(initValue, id) { + + this.contentChanged = false; + const placeholder = ""; // amp; // 编辑时要传memoId - const imageUrl = `/api/attachments.json`; + const imageUrl = `/api/attachments.json`; // 创建editorMd - const exercise_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => { - setTimeout(() => { - exercise_editormd.resize() - exercise_editormd.cm && exercise_editormd.cm.refresh() - }, 500) - - if (initValue != undefined) { - exercise_editormd.setValue(initValue) - } - exercise_editormd.cm.on("change", (_cm, changeObj) => { - console.log('....contentChanged') - this.contentChanged = true; - }) - }); - this.exercise_editormd = exercise_editormd; - window.exercise_editormd = exercise_editormd; - - } - - componentDidMount() { - let id = this.props.match.params.shixunId; - let checkpointId=this.props.match.params.checkpointId; - this.setState({ - shixunId:id, - checkpointId:checkpointId - }) - let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; - let newpractice_url= "/shixuns/"+id+"/challenges/new"; - let newgo_back_url="/shixuns/"+id+"/challenges"; - - let url = "/shixuns/" + id + "/challenges/" + checkpointId + "/edit.json?tab=1"; - axios.get(url).then((response) => { - let newprev_challenge = response.data.prev_challenge; - let next_challenge = response.data.next_challenge; - if (newprev_challenge != undefined) { - if(newprev_challenge.st===0){ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; - }else{ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; - } - } - if (next_challenge != undefined) { - - if(next_challenge.st===0){ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; - }else{ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; - } - } - let newevaluationlist=[] - if(response.data.test_sets.length===0){ - // let newlist=[ - // {hidden:0,input:"",output:"",score:50}, - // {hidden:1,input:"",output:"",score:50} - // ] - let newlist=[ - {input:"",output:"",score:50}, - {input:"",output:"",score:50} - ] - newevaluationlist=newlist - }else{ - newevaluationlist=response.data.test_sets - } - - this.setState({ - power: response.data.power, - evaluationlist:newevaluationlist, - shixunfilepath:response.data.path, - shixunfilepathplay:response.data.exec_path, - pathoptionvalue:response.data.show_type, - shixunfileexpectpicturepath:response.data.original_picture_path, - shixunfilestandardpicturepath:response.data.expect_picture_path, - shixunfilepicturepath:response.data.picture_path, - prev_challenge: newprev_challenge, - next_challenge: next_challenge, - choice_url: newchoice_url, // 导航中的新建选择题url - practice_url: newpractice_url, //string 导航中新建实践题url - go_back_url: newgo_back_url, //string 导航中的返回url - position: response.data.position, //int 关卡位置,导航栏中的第几关 - scorevalue:response.data.test_set_score, - markvalue:response.data.test_set_average, - }) - this.evaluationoninputvalueonload(); - if(response.data.power===false){ - this.props.showSnackbar("你没有权限修改"); - } - if(response.data.answer===undefined){ - this.answerMD("", "answerMD"); - }else{ - this.answerMD(response.data.answer, "answerMD"); - } - - }).catch((error) => { - console.log(error) - }); - - } - - - setevaluationlist=(newevaluationlist)=>{ - this.setState({ - evaluationlist:newevaluationlist - }) - } - - - addevaluationon=()=>{ - let {evaluationlist,markvalue}=this.state; - let newevaluationlist=evaluationlist; - // newevaluationlist.push({hidden:0,input:"",output:"",score:0}); - newevaluationlist.push({input:"",output:"",score:0}); - newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue); - this.setevaluationlist(newevaluationlist); - } - - del_test_array=(key)=>{ - let {evaluationlist,markvalue}=this.state; - let newevaluationlist=evaluationlist; - newevaluationlist.splice(key,1); - newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue); - this.setevaluationlist(newevaluationlist); - } - - getfilepath=(e,shixunfilepath)=>{ - this.setState({ - evaluationvisible: true, - selectpath:e.target.value, - selectpatharr:[], - }); - let id = this.props.match.params.shixunId; - let url ="/shixuns/"+id+"/repository.json"; - axios.post(url,{ - path: "" - }).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - this.setState({ - trees:response.data.trees, - saveshixunfilepath:shixunfilepath, - path:"", - main:[], - }) - } - - }).catch((error) => { - console.log(error) - }); - } - - sendgetfilepath=(newpath,type)=>{ - let id = this.props.match.params.shixunId; - let{path,main}=this.state; - let ary=main; - let paths=path; - - this.setState({ - selectpatharr:[], - }) - if(paths===""&&type==="tree"){ - newpath=newpath+"/"; - paths=""; - if(main.length===0){ - ary.push({val:"根目录/",path:""},{val:newpath,path:paths+newpath}) - }else{ - ary.push({val:newpath,path:paths+newpath}) - } - - }else if(paths!=""&&type==="tree"){ - newpath=newpath+"/"; - ary.push({val:newpath,path:paths+newpath}) - } - - - let url ="/shixuns/"+id+"/repository.json"; - if(type==="tree"){ - - axios.post(url,{ - path: paths+newpath - }).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - this.setState({ - trees:response.data.trees, - path:paths+newpath, - main:ary, - // selectpath:"" - }) - } - - }).catch((error) => { - console.log(error) - }); - } - - } - - goblakepath=(path,key)=>{ - let {main,selectpath} =this.state; - let newmain=[] - for(var i=0;i<=key;i++){ - newmain.push(main[i]) - } - let id = this.props.match.params.shixunId; - let url ="/shixuns/"+id+"/repository.json"; - axios.post(url,{ - path: path - }).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else { - this.setState({ - trees: response.data.trees, - path: path, - main: newmain, - // selectpath:selectpath - }) - } - }).catch((error) => { - console.log(error) - }); - } - // delesavegetfilepath=(value)=>{ - // let {selectpatharr} = this.state - // let newarr =selectpatharr; - // let newselectpath=""; - // for(var i=0; i{ - let {selectpath,saveshixunfilepath} = this.state - // let newarr =selectpatharr; - // let arrtype=false; - // let arrsum=0; - // let newselectpath=""; - // newarr.push(value) - // if(newarr.length>1&&arrtype===false){ - // for(var i=0; i { + setTimeout(() => { + exercise_editormd.resize() + exercise_editormd.cm && exercise_editormd.cm.refresh() + }, 500) + + if (initValue != undefined) { + exercise_editormd.setValue(initValue) + } + exercise_editormd.cm.on("change", (_cm, changeObj) => { + console.log('....contentChanged') + this.contentChanged = true; + }) + }); + this.exercise_editormd = exercise_editormd; + window.exercise_editormd = exercise_editormd; + + } + + componentDidMount() { + let id = this.props.match.params.shixunId; + let checkpointId=this.props.match.params.checkpointId; + this.setState({ + shixunId:id, + checkpointId:checkpointId + }) + let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; + let newpractice_url= "/shixuns/"+id+"/challenges/new"; + let newgo_back_url="/shixuns/"+id+"/challenges"; + + let url = "/shixuns/" + id + "/challenges/" + checkpointId + "/edit.json?tab=1"; + axios.get(url).then((response) => { + let newprev_challenge = response.data.prev_challenge; + let next_challenge = response.data.next_challenge; + if (newprev_challenge != undefined) { + if(newprev_challenge.st===0){ + newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; }else{ - const type = selectpath.split(';'); - let types=false; - for(var i=0; i { + console.log(error) + }); + + } + + + setevaluationlist=(newevaluationlist)=>{ + this.setState({ + evaluationlist:newevaluationlist + }) + } + + + addevaluationon=()=>{ + let {evaluationlist,markvalue}=this.state; + let newevaluationlist=evaluationlist; + newevaluationlist.push({hidden:0,input:"",output:"",score:0}); + newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue); + this.setevaluationlist(newevaluationlist); + } + + del_test_array=(key)=>{ + let {evaluationlist,markvalue}=this.state; + let newevaluationlist=evaluationlist; + newevaluationlist.splice(key,1); + newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue); + this.setevaluationlist(newevaluationlist); + } + + getfilepath=(e,shixunfilepath)=>{ + this.setState({ + evaluationvisible: true, + selectpath:e.target.value, + selectpatharr:[], + }); + let id = this.props.match.params.shixunId; + let url ="/shixuns/"+id+"/repository.json"; + axios.post(url,{ + path: "" + }).then((response) => { + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + + }else{ + this.setState({ + trees:response.data.trees, + saveshixunfilepath:shixunfilepath, + path:"", + main:[], + }) + } + + }).catch((error) => { + console.log(error) + }); + } + + sendgetfilepath=(newpath,type)=>{ + let id = this.props.match.params.shixunId; + let{path,main}=this.state; + let ary=main; + let paths=path; + + this.setState({ + selectpatharr:[], + }) + if(paths===""&&type==="tree"){ + newpath=newpath+"/"; + paths=""; + if(main.length===0){ + ary.push({val:"根目录/",path:""},{val:newpath,path:paths+newpath}) + }else{ + ary.push({val:newpath,path:paths+newpath}) + } + + }else if(paths!=""&&type==="tree"){ + newpath=newpath+"/"; + ary.push({val:newpath,path:paths+newpath}) + } + + + let url ="/shixuns/"+id+"/repository.json"; + if(type==="tree"){ + + axios.post(url,{ + path: paths+newpath + }).then((response) => { + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - if(types===false){ - newselectpath=selectpath+value+ ";" + }else{ + this.setState({ + trees:response.data.trees, + path:paths+newpath, + main:ary, + // selectpath:"" + }) + } + + }).catch((error) => { + console.log(error) + }); + } + + } + + goblakepath=(path,key)=>{ + let {main,selectpath} =this.state; + let newmain=[] + for(var i=0;i<=key;i++){ + newmain.push(main[i]) + } + let id = this.props.match.params.shixunId; + let url ="/shixuns/"+id+"/repository.json"; + axios.post(url,{ + path: path + }).then((response) => { + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + + }else { + this.setState({ + trees: response.data.trees, + path: path, + main: newmain, + // selectpath:selectpath + }) + } + }).catch((error) => { + console.log(error) + }); + } + // delesavegetfilepath=(value)=>{ + // let {selectpatharr} = this.state + // let newarr =selectpatharr; + // let newselectpath=""; + // for(var i=0; i{ + let {selectpath,saveshixunfilepath} = this.state + // let newarr =selectpatharr; + // let arrtype=false; + // let arrsum=0; + // let newselectpath=""; + // newarr.push(value) + // if(newarr.length>1&&arrtype===false){ + // for(var i=0; i{ + let {saveshixunfilepath,selectpath}=this.state; + this.setState({ + evaluationvisible: false, + [saveshixunfilepath]:selectpath + }); + } + evaluationhideModal=()=>{ + this.setState({ + evaluationvisible: false, + }); + } + handpathoptionvalue=(value)=>{ + this.setState({ + pathoptionvalue:value + }) + } + showrepositoryurltip=(type)=>{ + if(type===1){ + this.setState({ + showrepositoryurltiptype:true + }) + }else{ + this.setState({ + showrepositoryurltiptype:false + }) + } + } + + evaluationonChange=(e,key)=>{ + let {evaluationlist}=this.state; + let newevaluationlist=evaluationlist; + let newtype; + if(e===1){ + newtype=0; + }else{ + newtype=1; + } + // newevaluationlist[key].is_public=newtype; + // for(var i=0; i{ + let {evaluationlist,scoretype}=this.state; + + if(scoretype===key){ + this.setState({ + scoretype:undefined + }) + } + let newevaluationlist=evaluationlist; + let sum =parseInt(e.target.value); + if(isNaN(sum)){ + sum=0 + } + newevaluationlist[key].score=sum; + + this.setState({ + evaluationlist:newevaluationlist, + markvalue:false + }) + this.setevaluationlist(newevaluationlist); + } + + evaluationoninputvalue=(e,key,type)=>{ + $.fn.autoHeight = function(){ + function autoHeight(elem){ + elem.style.height = 'auto'; + elem.style.maxHeight = '140px'; + elem.scrollTop = 0; //防抖动 + elem.style.height = elem.scrollHeight + 'px'; + } + this.each(function(){ + autoHeight(this); + $(this).on('keyup', function(){ + autoHeight(this); + }); + }); + } + $('textarea[autoHeight]').autoHeight(); + + let {evaluationlist}=this.state; + let newevaluationlist=evaluationlist; + if(type==="sr"){ + newevaluationlist[key].input=e.target.value + }else if(type==="yq"){ + newevaluationlist[key].output=e.target.value + } + this.setevaluationlist(newevaluationlist); + } + + + evaluationoninputvalueonload=()=>{ + $.fn.autoHeight = function(){ + function autoHeight(elem){ + elem.style.height = 'auto'; + elem.style.maxHeight = '140px'; + elem.scrollTop = 0; //防抖动 + elem.style.height = elem.scrollHeight + 'px'; + } + this.each(function(){ + autoHeight(this); + $(this).on('keyup', function(){ + autoHeight(this); + }); + }); + } + $('textarea[autoHeight]').autoHeight(); + } + submitarbitrationevaluation=()=>{ + let{evaluationlist,shixunfilepath,shixunfilepathplay,shixunfileexpectpicturepath,shixunfilestandardpicturepath,shixunfilepicturepath,pathoptionvalue,scorevalue,markvalue}=this.state; + + + let newscorevalue; + if(scorevalue===false){ + newscorevalue=false + }else{ + //判断占比 + newscorevalue=true + + let sum=0; + for(var i=0; i100){ + this.props.showSnackbar("测试集的评分占比不能大于100"); + this.setState({ + scoretype:i + }) + return + } + sum=sum+evaluationlist[i].score + } + + if(sum>100||sum<100){ + this.props.showSnackbar("测试集的评分占比之和必须等于100"); + return + } + + + } + if(shixunfilepath===undefined||shixunfilepath===""||shixunfilepath===null){ + this.props.showSnackbar("学员任务文件路径为空"); + this.setState({ + StudentTaskPapers:true + }) + $('html').animate({ + scrollTop: 120 + }, 1000); + return + } + + if(shixunfilepathplay===undefined||shixunfilepathplay===""||shixunfilepathplay===null){ + this.props.showSnackbar("评测执行文件路径为空"); + this.setState({ + StudentTaskDocs:true + }) + $('html').animate({ + scrollTop: 130 + }, 1000); + return + } + + if(evaluationlist.length===0){ + this.props.showSnackbar("测试集不能为空"); + return + } + let id = this.props.match.params.shixunId; + let{checkpointId}=this.state; + let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json"; + axios.put(url,{ + tab:1, + challenge:{ + path:shixunfilepath, + exec_path:shixunfilepathplay, + show_type:pathoptionvalue, + original_picture_path:shixunfileexpectpicturepath, + expect_picture_path:shixunfilestandardpicturepath, + picture_path:shixunfilepicturepath, + test_set_score:newscorevalue, + test_set_average:markvalue + }, + test_set:evaluationlist + } + ).then((response) => { + this.props.showSnackbar(response.data.messages); + // if(response.data.status===1){ + // window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3" + // } + }).catch((error) => { + console.log(error) + }); + } + handpathoptionvalues=()=>{ + this.setState({ + handpathopt:true + }) + } + handpathoptionvaluess=()=>{ + this.setState({ + handpathopt:false + }) + } + saveselectpath=(e)=>{ + + this.setState({ + selectpath:e.target.value + }) + } + updatepath=(e,name)=>{ + this.setState({ + [name]:e.target.value + }) + } + + + oneditevaluationlist=(newevaluationlist,markvalue)=>{ + + if(markvalue===true){ + if(100%newevaluationlist.length===0){ + let sum=100/newevaluationlist.length; + for(var i=0; i{ - let {saveshixunfilepath,selectpath}=this.state; - this.setState({ - evaluationvisible: false, - [saveshixunfilepath]:selectpath - }); - } - evaluationhideModal=()=>{ - this.setState({ - evaluationvisible: false, - }); - } - handpathoptionvalue=(value)=>{ - this.setState({ - pathoptionvalue:value - }) - } - showrepositoryurltip=(type)=>{ - if(type===1){ - this.setState({ - showrepositoryurltiptype:true - }) - }else{ - this.setState({ - showrepositoryurltiptype:false - }) - } - } - - evaluationonChange=(e,key)=>{ - let {evaluationlist}=this.state; - let newevaluationlist=evaluationlist; - let newtype; - if(e===1){ - newtype=0; - }else{ - newtype=1; - } - // newevaluationlist[key].is_public=newtype; - // for(var i=0; i{ - let {evaluationlist,scoretype}=this.state; - - if(scoretype===key){ - this.setState({ - scoretype:undefined - }) - } - let newevaluationlist=evaluationlist; - let sum =parseInt(e.target.value); - if(isNaN(sum)){ - sum=0 - } - newevaluationlist[key].score=sum; - - this.setState({ - evaluationlist:newevaluationlist, - markvalue:false - }) - this.setevaluationlist(newevaluationlist); - } - - evaluationoninputvalue=(e,key,type)=>{ - $.fn.autoHeight = function(){ - function autoHeight(elem){ - elem.style.height = 'auto'; - elem.style.maxHeight = '140px'; - elem.scrollTop = 0; //防抖动 - elem.style.height = elem.scrollHeight + 'px'; - } - this.each(function(){ - autoHeight(this); - $(this).on('keyup', function(){ - autoHeight(this); - }); - }); - } - $('textarea[autoHeight]').autoHeight(); - - let {evaluationlist}=this.state; - let newevaluationlist=evaluationlist; - if(type==="sr"){ - newevaluationlist[key].input=e.target.value - }else if(type==="yq"){ - newevaluationlist[key].output=e.target.value - } - this.setevaluationlist(newevaluationlist); - } - - - evaluationoninputvalueonload=()=>{ - $.fn.autoHeight = function(){ - function autoHeight(elem){ - elem.style.height = 'auto'; - elem.style.maxHeight = '140px'; - elem.scrollTop = 0; //防抖动 - elem.style.height = elem.scrollHeight + 'px'; - } - this.each(function(){ - autoHeight(this); - $(this).on('keyup', function(){ - autoHeight(this); - }); - }); - } - $('textarea[autoHeight]').autoHeight(); - } - submitarbitrationevaluation=()=>{ - let{evaluationlist,shixunfilepath,shixunfilepathplay,shixunfileexpectpicturepath,shixunfilestandardpicturepath,shixunfilepicturepath,pathoptionvalue,scorevalue,markvalue}=this.state; - - - let newscorevalue; - if(scorevalue===false){ - newscorevalue=false - }else{ - //判断占比 - newscorevalue=true - - let sum=0; - for(var i=0; i100){ - this.props.showSnackbar("测试集的评分占比不能大于100"); - this.setState({ - scoretype:i - }) - return - } - sum=sum+evaluationlist[i].score - } - - if(sum>100||sum<100){ - this.props.showSnackbar("测试集的评分占比之和必须等于100"); - return - } - - - } - if(shixunfilepath===undefined||shixunfilepath===""||shixunfilepath===null){ - this.props.showSnackbar("学员任务文件路径为空"); - this.setState({ - StudentTaskPapers:true - }) - $('html').animate({ - scrollTop: 120 - }, 1000); - return - } - - if(shixunfilepathplay===undefined||shixunfilepathplay===""||shixunfilepathplay===null){ - this.props.showSnackbar("评测执行文件路径为空"); - this.setState({ - StudentTaskDocs:true - }) - $('html').animate({ - scrollTop: 130 - }, 1000); - return - } - - if(evaluationlist.length===0){ - this.props.showSnackbar("测试集不能为空"); - return - } - let id = this.props.match.params.shixunId; - let{checkpointId}=this.state; - let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json"; - axios.put(url,{ - tab:1, - challenge:{ - path:shixunfilepath, - exec_path:shixunfilepathplay, - show_type:pathoptionvalue, - original_picture_path:shixunfileexpectpicturepath, - expect_picture_path:shixunfilestandardpicturepath, - picture_path:shixunfilepicturepath, - test_set_score:newscorevalue, - test_set_average:markvalue - }, - test_set:evaluationlist - } - ).then((response) => { - this.props.showSnackbar(response.data.messages); - // if(response.data.status===1){ - // window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3" - // } - }).catch((error) => { - console.log(error) - }); - } - handpathoptionvalues=()=>{ - this.setState({ - handpathopt:true - }) - } - handpathoptionvaluess=()=>{ - this.setState({ - handpathopt:false - }) - } - saveselectpath=(e)=>{ - - this.setState({ - selectpath:e.target.value - }) - } - updatepath=(e,name)=>{ - this.setState({ - [name]:e.target.value - }) - } - - - oneditevaluationlist=(newevaluationlist,markvalue)=>{ - - if(markvalue===true){ - if(100%newevaluationlist.length===0){ - let sum=100/newevaluationlist.length; - for(var i=0; i{ - - let {markvalue,evaluationlist}=this.state; - let newevaluationlist=evaluationlist; - - if(e.target.value===true){ - newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue) - } - - this.setState({ - scorevalue: e.target.value, - evaluationlist:newevaluationlist - }); - - this.setevaluationlist(newevaluationlist); - } - - //均匀比例 - onChangemarkvalue=(e)=>{ - let {evaluationlist}=this.state; - - if(e.target.value===true){ - let newevaluationlist=evaluationlist; - newevaluationlist=this.oneditevaluationlist(newevaluationlist,e.target.value); - this.setevaluationlist(newevaluationlist); - } - - this.setState({ - markvalue: e.target.value, - }); - - } - render() { - - let { - choice_url, - practice_url, - go_back_url, - position, - evaluationlist, - shixunId, - checkpointId, - power, - shixunfileexpectpicturepath, - shixunfilestandardpicturepath, - shixunfilepicturepath, - shixunfilepath, - evaluationvisible, - trees, - path, - main, - selectpath, - shixunfilepathplay, - pathoptionvalue, - showrepositoryurltiptype, - prev_challenge, - next_challenge, - StudentTaskPapers, - StudentTaskDocs, - handpathopt, - scorevalue, - markvalue, - scoretype - } = this.state; - - let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint"; - let tab2url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=2"; - let tab3url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=3"; - // console.log(this.props) - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - marginLeft: '20px', - }; - return ( - -
    -
    + } + + } + + return newevaluationlist + } + //选择得分规范 + onChangeRadioGroups=(e)=>{ + + let {markvalue,evaluationlist}=this.state; + let newevaluationlist=evaluationlist; + + if(e.target.value===true){ + newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue) + } + + this.setState({ + scorevalue: e.target.value, + evaluationlist:newevaluationlist + }); + + this.setevaluationlist(newevaluationlist); + } + + //均匀比例 + onChangemarkvalue=(e)=>{ + let {evaluationlist}=this.state; + + if(e.target.value===true){ + let newevaluationlist=evaluationlist; + newevaluationlist=this.oneditevaluationlist(newevaluationlist,e.target.value); + this.setevaluationlist(newevaluationlist); + } + + this.setState({ + markvalue: e.target.value, + }); + + } + render() { + + let { + choice_url, + practice_url, + go_back_url, + position, + evaluationlist, + shixunId, + checkpointId, + power, + shixunfileexpectpicturepath, + shixunfilestandardpicturepath, + shixunfilepicturepath, + shixunfilepath, + evaluationvisible, + trees, + path, + main, + selectpath, + shixunfilepathplay, + pathoptionvalue, + showrepositoryurltiptype, + prev_challenge, + next_challenge, + StudentTaskPapers, + StudentTaskDocs, + handpathopt, + scorevalue, + markvalue, + scoretype + } = this.state; + + let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint"; + let tab2url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=2"; + let tab3url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=3"; + // console.log(this.props) + const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', + marginLeft: '20px', + }; + return ( + +
    +
    - 第{position}关 - 返回 - - {prev_challenge === undefined ? "" : - 上一关 - } - - {next_challenge === undefined ? "" : - 下一关 - } - - 4||this.props.identity===undefined||this.props.status===2||this.props.status===1? "none":'block'}} - data-tip-down="新增代码编辑类型的任务">+ 实践类型 - 4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}} - data-tip-down="新增选择题类型的任务">+ 选择题类型 - -
    - -
    - -
  • - 本关任务 -
  • - -
  • - 评测设置 -
  • - -
  • - 参考答案 -
  • -
    - -

    - 请先上传本关任务的所有代码文件、标准图片等所有必要的文件到 - 版本库 -

    - - -
    -
    -

    学员任务文件

    -
    - * -
    - this.updatepath(e,"shixunfilepath")} - onClick={(e)=>this.getfilepath(e,"shixunfilepath")} - /> -

    该文件将直接显示给学生,需要学生在其中填写代码

    -
    -
    + 第{position}关 + 返回 + + {prev_challenge === undefined ? "" : + 上一关 + } + + {next_challenge === undefined ? "" : + 下一关 + } + + 4||this.props.identity===undefined||this.props.status===2||this.props.status===1? "none":'block'}} + data-tip-down="新增代码编辑类型的任务">+ 实践类型 + 4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}} + data-tip-down="新增选择题类型的任务">+ 选择题类型 + +
    + +
    + +
  • + 本关任务 +
  • + +
  • + 评测设置 +
  • + +
  • + 参考答案 +
  • +
    + +

    + 请先上传本关任务的所有代码文件、标准图片等所有必要的文件到 + 版本库 +

    + + +
    +
    +

    学员任务文件

    +
    + * +
    + this.updatepath(e,"shixunfilepath")} + onClick={(e)=>this.getfilepath(e,"shixunfilepath")} + /> +

    该文件将直接显示给学生,需要学生在其中填写代码

    +
    +
    必填项 -
    -
    -
    -
    - -
    -
    - -
    - - this.saveselectpath(e)} - value={selectpath}/> -
    - - this.evaluationenter()}>确定 - this.evaluationhideModal()}>取消 -
    -
    -
    - -
    -
    -

    评测执行文件

    -
    - * -
    - this.updatepath(e,"shixunfilepathplay")} - onClick={(e)=>this.getfilepath(e,"shixunfilepathplay")} - /> -

    该文件由平台执行,用来测试平台学员代码是否正确

    -
    -
    + className="fa fa-exclamation-circle mr3">必填项 +
    +
    +
    +
    + +
    +
    + +
    + + this.saveselectpath(e)} + value={selectpath}/> +
    + + this.evaluationenter()}>确定 + this.evaluationhideModal()}>取消 +
    +
    +
    + +
    +
    +

    评测执行文件

    +
    + * +
    + this.updatepath(e,"shixunfilepathplay")} + onClick={(e)=>this.getfilepath(e,"shixunfilepathplay")} + /> +

    该文件由平台执行,用来测试平台学员代码是否正确

    +
    +
    必填项 -
    -
    -
    -
    - - -
    -
    -

    效果展现方式

    -
    - - this.showrepositoryurltip(1)}> -
    - -
    -

    - 图片:处理或输出图片类型的任务,请选填此项
    - 可以通过设置图片路径和学员答案文件路径,展示代码对应的图片效果

    - apk/exe:写可执行文件的任务,请选填此项
    - 可以通过设置学员答案文件路径,展示二维码以供扫码下载

    - txt:输出txt文档类型的任务,请选填此项
    - 可以通过学员答案文件路径设置,展示txt文件内容

    - html:web类型的任务,请选填此项
    - 可以通过Web路由设置,展示html效果预览页 -

    -

    this.showrepositoryurltip(2)} - >知道了 -

    -
    -
    -

    该选项用来配置学员评测本关任务时,查看效果页上需要展现的文件类型

    -
    -
    - - - {pathoptionvalue===1?
    -
    -

    待处理图片路径

    -
    -
    - this.updatepath(e,"shixunfileexpectpicturepath")} - onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath")} - /> -

    - 该路径下的文件将在学员评测本关任务时,作为原始图片显示在查看效果页,供学员参考,任务为图片处理时请指定该路径,并注意与程序文件所在文件夹分开 -

    -
    -
    -
    -
    -
    :""} - - - {pathoptionvalue===1?
    -
    -

    标准答案图片路径

    -
    -
    - this.updatepath(e,"shixunfilestandardpicturepath")} - onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath")} - /> -

    - 该路径下的文件将在学员评测本关任务时,作为参考答案显示在查看效果页,供学员参考任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开 -

    -
    -
    -
    -
    -
    :""} - - - {pathoptionvalue===-1?"":
    -
    -

    学员答案文件路径

    -
    -
    - this.updatepath(e,"shixunfilepicturepath")} - onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath")} - placeholder="请在版本库中指定用来保存学员代码实际输出结果的路径。例:src/step1/outputimages"/> -

    - 学员评测本关任务时生成的文件将保存在该路径下,并作为实际输出显示在查看效果页,供学员确认任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开 -

    -
    -
    -
    -
    -
    } - - -
    -
    - {/*

    测试集

    */} -

    测试集和系统评分规则

    -

    - 得分规范: - - - 通过全部测试集 - (学员评测,仅当所有测试集都正确时,才获得一次性奖励) - - - 通过部分测试集 - (学员评测,当至少有一组测试集正确时,即可获得其对应比例的奖励) - -

    - -

    + className="fa fa-exclamation-circle mr3">必填项 +

    +
    +
    +
    + + +
    +
    +

    效果展现方式

    +
    + + this.showrepositoryurltip(1)}> +
    + +
    +

    + 图片:处理或输出图片类型的任务,请选填此项
    + 可以通过设置图片路径和学员答案文件路径,展示代码对应的图片效果

    + apk/exe:写可执行文件的任务,请选填此项
    + 可以通过设置学员答案文件路径,展示二维码以供扫码下载

    + txt:输出txt文档类型的任务,请选填此项
    + 可以通过学员答案文件路径设置,展示txt文件内容

    + html:web类型的任务,请选填此项
    + 可以通过Web路由设置,展示html效果预览页 +

    +

    this.showrepositoryurltip(2)} + >知道了 +

    +
    +
    +

    该选项用来配置学员评测本关任务时,查看效果页上需要展现的文件类型

    +
    +
    + + + {pathoptionvalue===1?
    +
    +

    待处理图片路径

    +
    +
    + this.updatepath(e,"shixunfileexpectpicturepath")} + onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath")} + /> +

    + 该路径下的文件将在学员评测本关任务时,作为原始图片显示在查看效果页,供学员参考,任务为图片处理时请指定该路径,并注意与程序文件所在文件夹分开 +

    +
    +
    +
    +
    +
    :""} + + + {pathoptionvalue===1?
    +
    +

    标准答案图片路径

    +
    +
    + this.updatepath(e,"shixunfilestandardpicturepath")} + onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath")} + /> +

    + 该路径下的文件将在学员评测本关任务时,作为参考答案显示在查看效果页,供学员参考任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开 +

    +
    +
    +
    +
    +
    :""} + + + {pathoptionvalue===-1?"":
    +
    +

    学员答案文件路径

    +
    +
    + this.updatepath(e,"shixunfilepicturepath")} + onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath")} + placeholder="请在版本库中指定用来保存学员代码实际输出结果的路径。例:src/step1/outputimages"/> +

    + 学员评测本关任务时生成的文件将保存在该路径下,并作为实际输出显示在查看效果页,供学员确认任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开 +

    +
    +
    +
    +
    +
    } + + +
    +
    + {/*

    测试集

    */} +

    测试集和系统评分规则

    +

    + 得分规范: + + + 通过全部测试集 + (学员评测,仅当所有测试集都正确时,才获得一次性奖励) + + + 通过部分测试集 + (学员评测,当至少有一组测试集正确时,即可获得其对应比例的奖励) + +

    + +

    系统评分占比: + value={markvalue} + onChange={this.onChangemarkvalue} + > 均分比例 自定义比例 -

    +

    -
    -
    +
    +
    -
    +
    - {evaluationlist===undefined?"":evaluationlist.length===0?"":evaluationlist.map((item,key)=>{ - return( -
    -

    - * - 组{key+1} - + {evaluationlist===undefined?"":evaluationlist.length===0?"":evaluationlist.map((item,key)=>{ + return( +

    +

    + * + 组{key+1} + {/*checked={item.is_public===1?false:true}*/} - this.editpercentage(e,key)} - value={item.score} /> + this.editpercentage(e,key)} + value={item.score} /> % + style={{display:scorevalue===true?'inline-block':'none'}} + >% - {/*this.evaluationonChange(item.hidden,key)} checked={item.hidden===1?true:false}>隐藏*/} + this.evaluationonChange(item.hidden,key)} checked={item.hidden===1?true:false}>隐藏 - - this.del_test_array(key)}> - - - -

    - - -
    - ) - })} - -
    -
    - -

    - - 新增测试集 - -

    -

    温馨提示:建议公开测试集和隐藏测试集结合使用,降低作弊的几率;隐藏测试集,在“提交评测”时也将被自动检测

    -
    -
    -
    - - -
    4||this.props.identity===undefined||power===false?"none":"block"}}> - 提交 - 取消 -
    - - -
    - - ) - } + + this.del_test_array(key)}> + + + +

    + + +
    + ) + })} + +
    +
    + +

    + + 新增测试集 + +

    +

    温馨提示:建议公开测试集和隐藏测试集结合使用,降低作弊的几率;隐藏测试集,在“提交评测”时也将被自动检测

    +
    +
    +
    + + +
    4||this.props.identity===undefined||power===false?"none":"block"}}> + 提交 + 取消 +
    + + +
    +
    + ) + } } diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 50c5af396..4006fb615 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -173,7 +173,9 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px} #log_reg_content{border-radius: 5px;background: #FFFFff;width: 100%;text-align: center;position: absolute;top: 165px; left: 0px;padding: 40px 30px;box-sizing: border-box} .log_nav{border-bottom:1px solid #eaeaea;} -.log_nav li{float: left;text-align: center;font-size: 16px;padding-bottom:15px;margin: 0px 20px;cursor: pointer;} +.log_nav li{float: left;text-align: center;font-size: 16px;padding-bottom:15px; + /*margin: 0px 20px;*/ + cursor: pointer;} .log_nav li.active{border-bottom: 2px solid #459be5;} .log-botton{width: 100%;text-align: center;color: #FFFFff!important;display: block;background: #cbcbcb;height: 45px;line-height: 45px;border-radius: 4px;letter-spacing: 2px;cursor: pointer} .log-botton:hover{color: #FFFFff!important;} From 1017a23d8fc907b90b468ec4ac4120fbab712980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 24 Jul 2019 17:36:54 +0800 Subject: [PATCH 28/28] =?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/modules/login/Trialapplication.js | 2 +- public/react/src/modules/login/Trialapplicationysl.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index 313d5bce3..b64bb24b7 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -376,7 +376,7 @@ class Trialapplication extends Component { // console.log(this.props); return ( -
    +
    { isRenders === false ? "" : diff --git a/public/react/src/modules/login/Trialapplicationysl.js b/public/react/src/modules/login/Trialapplicationysl.js index dc9755fbe..ee4d6a9f9 100644 --- a/public/react/src/modules/login/Trialapplicationysl.js +++ b/public/react/src/modules/login/Trialapplicationysl.js @@ -394,7 +394,7 @@ class Trialapplicationysl extends Component { // console.log(this.props); return ( -
    +
    { isRenders === false ? "" :