diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 324e5bde3..d1357d43f 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -125,8 +125,8 @@ class AccountsController < ApplicationController set_autologin_cookie(user) UserAction.create(:action_id => user.try(:id), :action_type => "Login", :user_id => user.try(:id), :ip => request.remote_ip) - # 注册完成后有一天的试用申请 - UserDayCertification.create(user_id: user.id, status: 1) + # 注册完成后有一天的试用申请(先去掉) + # UserDayCertification.create(user_id: user.id, status: 1) end def set_autologin_cookie(user) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bf8a0651e..af0158cfd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -185,21 +185,29 @@ class ApplicationController < ActionController::Base render :json => { status: status, message: message } end - # 系统全局认证 - def check_auth - day_cer = UserDayCertification.find_by(user_id: current_user.id) - # 如果注册超过24小时则需要完善资料及授权 - if (Time.now.to_i - day_cer.try(:created_at).to_i) > 86400 - if !current_user.profile_completed? - info_url = '/account/profile' - tip_exception(402, info_url) - elsif current_user.certification != 1 - if current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) - tip_exception(408, "您的试用申请正在审核中,请耐心等待") - end - tip_exception(407, "系统未授权") - end + # 资料是否完善 + def check_account + if !current_user.profile_completed? + info_url = '/account/profile' + tip_exception(402, info_url) end + end + + # 系统全局认证(暂时隐藏试用申请的判断) + def check_auth + # day_cer = UserDayCertification.find_by(user_id: current_user.id) + # # 如果注册超过24小时则需要完善资料及授权 + # if (Time.now.to_i - day_cer.try(:created_at).to_i) > 86400 + # if !current_user.profile_completed? + # info_url = '/account/profile' + # tip_exception(402, info_url) + # elsif current_user.certification != 1 + # if current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) + # tip_exception(408, "您的试用申请正在审核中,请耐心等待") + # end + # tip_exception(407, "系统未授权") + # end + # end # if current_user.certification != 1 && current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index faad02173..99f942146 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -13,6 +13,7 @@ class CoursesController < ApplicationController before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups, :left_banner, :top_banner] + before_action :check_account, only: [:new, :apply_to_join_course] before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups, :left_banner, :top_banner, :apply_to_join_course, :exit_course] before_action :set_course, :user_course_identity, only: [:show, :update, :destroy, :settings, :set_invite_code_halt, diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 1187ebafa..b2de6dcad 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -37,7 +37,8 @@ class GamesController < ApplicationController # 上一关、下一关 prev_game = @game.prev_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) - next_game = @game.next_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) + #next_game = @game.next_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) + next_game = user_next_game(@shixun, game_challenge, @game, @identity) # 关卡点赞数, praise_or_tread = 1则表示赞过 praise_count = game_challenge.praises_count @@ -454,7 +455,7 @@ class GamesController < ApplicationController tip_exception("初始代码为空,代码重置失败") if @content.nil? # 将tpm的代码内容同步更新到tpi - update_file_content(@content, @myshixun.repo_path, path, current_user.mail, current_user.full_name, "reset_original_code") + update_file_content(@content, @myshixun.repo_path, path, current_user.git_mail, current_user.real_name, "reset_original_code") rescue Exception => e uid_logger_error("#{e.message}") tip_exception("初始化代码失败") @@ -471,7 +472,7 @@ class GamesController < ApplicationController # else # content # end - update_file_content(content, @myshixun.repo_path, path, current_user.mail, current_user.full_name, "game passed reset") + update_file_content(content, @myshixun.repo_path, path, current_user.git_mail, current_user.real_name, "game passed reset") else tip_exception("代码重置失败,代码为空") end @@ -962,4 +963,14 @@ class GamesController < ApplicationController @identity = current_user.game_identity(@game) raise Educoder::TipException.new(403, "..") if @identity > User::EDU_GAME_MANAGER end + # identity用户身份 + def user_next_game(shixun, challenge, game, identity) + next_game = game.next_of_current_game(shixun.id, game.myshixun_id, challenge.position) + # 实训允许跳关 、 当前关卡已经通关、 用户是已认证的老师以上权限的人,允许跳关 + if shixun.task_pass || game.status == 2 || identity <= User::EDU_CERTIFICATION_TEACHER + next_game + else + nil + end + end end diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index f92ed8e2e..2f40f3fc2 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -113,6 +113,15 @@ class HomeworkCommonsController < ApplicationController else if @user_course_identity == Course::STUDENT @work = @homework.user_work(current_user.id) + work = @homework.student_works.find_by(user_id: current_user.id) + + # 学生访问列表时计算个人成绩 + myshixun = Myshixun.find_by(shixun_id: @shixun.id, user_id: current_user.id) + if work && myshixun + challenge_settings = @homework.homework_challenge_settings + games = myshixun.games.where(challenge_id: challenge_settings.pluck(:challenge_id)) + HomeworksService.new.update_myshixun_work_score work, myshixun, games, @homework, challenge_settings + end # 学生已提交作品且补交(提交)已截止、作品公开、非匿评阶段 if @work&.work_status.to_i > 0 && (@homework.work_public || @homework.score_open) && diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index cdeca4871..fa47fd7f6 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -7,9 +7,9 @@ class MyshixunsController < ApplicationController ## TPI关卡列表 def challenges # @challenges = Challenge.where(shixun_id: params[:shixun_id]) - - @shixun_status = @myshixun.shixun.status + @shixun = @myshixun.shixun @games = @myshixun.games.includes(:challenge).reorder("challenges.position") + @identity = current_user.game_identity(@games.first) end @@ -42,7 +42,7 @@ class MyshixunsController < ApplicationController if e.message != "ActiveRecord::RecordInvalid" logger.error("######delete_repository_error:#{e.message}") end - raise ActiveRecord::Rollback + raise "delete_repository_error:#{e.message}" end end diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 7a2db0666..11016cfbb 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -3,6 +3,8 @@ class ShixunsController < ApplicationController include ApplicationHelper before_action :require_login, :check_auth, except: [:download_file, :index, :menus] + before_action :check_account, only: [:new, :shixun_exec] + before_action :check_auth, except: [:download_file, :index, :menus] before_action :find_shixun, :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns, @@ -716,7 +718,7 @@ class ShixunsController < ApplicationController logger.error("##########project_fork error #{e.message}") @current_task.destroy! end - raise ActiveRecord::Rollback + raise "实训云平台繁忙(繁忙等级:81)" end end end @@ -769,7 +771,7 @@ class ShixunsController < ApplicationController def update_file content = params[:content] - author_name = current_user.full_name + author_name = current_user.real_name author_email = current_user.git_mail @content = update_file_content content, @repo_path, @path, author_email, author_name, "Edit by browser" end diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 5cbb2a462..586b7352f 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -1,6 +1,7 @@ class SubjectsController < ApplicationController before_action :require_login, :check_auth, except: [:index] # before_action :check_auth, except: [:index] + before_action :check_account, only: [:new] before_action :find_subject, except: [:index, :create, :new, :append_to_stage] before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish, :search_members, :add_subject_members, :statistics, :shixun_report, :school_report, diff --git a/app/helpers/myshixuns_helper.rb b/app/helpers/myshixuns_helper.rb index 650f32f40..2a487e361 100644 --- a/app/helpers/myshixuns_helper.rb +++ b/app/helpers/myshixuns_helper.rb @@ -1,2 +1,14 @@ module MyshixunsHelper + + # 获取tpi的identifier, + # identity表示用户关卡的身份 + # task_pass: 实训是否允许跳关 + def get_game_identifier task_pass, game, game_identity + # 允许跳关、 关卡已经开启、 用户是已认证老师以上的身份 + if task_pass || game.status != 3 || game_identity <= User::EDU_CERTIFICATION_TEACHER + game.identifier + else + nil + end + end end diff --git a/app/helpers/shixuns_helper.rb b/app/helpers/shixuns_helper.rb index 71bc833d4..d849053ca 100644 --- a/app/helpers/shixuns_helper.rb +++ b/app/helpers/shixuns_helper.rb @@ -126,12 +126,13 @@ module ShixunsHelper challenge_program_name = [] shixun.challenges.map(&:exec_path).each do |exec_path| challenge_program_name << "\"#{exec_path}\"" - if shixun.main_mirror_name.try(:first) == "Java" + if shixun.main_mirror_name == "Java" if exec_path.nil? || exec_path.split("src/")[1].nil? source = "\"\"" else source = "\"#{exec_path.split("src/")[1].split(".java")[0]}\"" end + logger.info("----source: #{source}") source_class_name << source.gsub("/", ".") if source.present? elsif shixun.main_mirror_name.try(:first) == "C#" if exec_path.nil? || exec_path.split(".")[1].nil? diff --git a/app/models/shixun.rb b/app/models/shixun.rb index e35f9f1a6..82f689e3f 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -4,6 +4,7 @@ class Shixun < ApplicationRecord # status: 0:编辑 1:申请发布 2:正式发布 3:关闭 -1:软删除 # hide_code: 隐藏代码窗口 # code_hidden: 隐藏代码目录 + # task_pass: 跳关 has_many :challenges, dependent: :destroy has_many :challenge_tags, through: :challenges has_many :myshixuns, :dependent => :destroy diff --git a/app/views/courses/search_users.json.jbuilder b/app/views/courses/search_users.json.jbuilder index d735de970..ac826fdf2 100644 --- a/app/views/courses/search_users.json.jbuilder +++ b/app/views/courses/search_users.json.jbuilder @@ -2,8 +2,8 @@ json.users do json.array! @users do |user| json.id user.id json.name user.real_name - json.student_id user.user_extension.try(:student_id) - json.school_name user.user_extension.school.name + json.student_id user&.student_id + json.school_name user&.school_name json.added @course.course_member?(user.id, 4) end end diff --git a/app/views/myshixuns/challenges.json.jbuilder b/app/views/myshixuns/challenges.json.jbuilder index 802c2b561..0be94d9fd 100644 --- a/app/views/myshixuns/challenges.json.jbuilder +++ b/app/views/myshixuns/challenges.json.jbuilder @@ -3,7 +3,7 @@ json.array! @games do |game| json.partial! 'challenges/challenge', locals: { challenge: challenge } json.status game.status json.star game.star - json.identifier game.identifier - json.get_gold game.user_get_gold_and_experience(@shixun_status, challenge)[0] - json.get_experience game.user_get_gold_and_experience(@shixun_status, challenge)[1] + json.identifier get_game_identifier(@shixun.task_pass, game, @identity) + json.get_gold game.user_get_gold_and_experience(@shixun.status, challenge)[0] + json.get_experience game.user_get_gold_and_experience(@shixun.status, challenge)[1] end \ No newline at end of file diff --git a/app/views/users/get_user_info.json.jbuilder b/app/views/users/get_user_info.json.jbuilder index 164c943d0..d9eb736ad 100644 --- a/app/views/users/get_user_info.json.jbuilder +++ b/app/views/users/get_user_info.json.jbuilder @@ -7,6 +7,7 @@ json.is_teacher @user.user_extension&.teacher? json.user_identity @user.identity json.tidding_count 0 json.user_phone_binded @user.phone.present? +json.profile_completed @user.profile_completed? if @course json.course_identity @course_identity json.course_name @course.name diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index ad7172be5..849621259 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -502,7 +502,7 @@ class Coursesleftnav extends Component{ NavmodalValues:"名称不能为空" }) return - }else if(NavmodalValue.length>20){ + }else if(NavmodalValue.length>60){ this.setState({ NavmodalValuetype:true, NavmodalValues:"名称不能超过60个字" diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index c69b147fa..e214bd81d 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -990,8 +990,15 @@ samp { .newcourses .ant-input{ width:280px; margin-left: 11px; - height: 40px; + height: 40px !important; } + +.newcourses .ant-input{ + width:280px; + margin-left: 11px; + height: 40px !important; +} + .newcourses .ant-select-selection--single{ width: 280px; /*margin-left: 11px;*/ diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 73c1dded9..5f63952cb 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -1,5 +1,5 @@ import React, {Component} from "React"; -import {Form, Select, Input, Button, Checkbox, DatePicker,Spin,Icon} from "antd"; +import {Form, Select, Input, Button, Checkbox, DatePicker,Spin,Icon,AutoComplete} from "antd"; import ApplyForAddOrgModal from '../../user/modal/ApplyForAddOrgModal'; import axios from 'axios'; import "../css/Courses.css"; @@ -47,8 +47,8 @@ class CoursesNew extends Component { let coursesId = this.props.match.params.coursesId; let user_school=this.props.current_user&&this.props.current_user.user_school; - this.getschool("") - this.Searchvalue("") + // this.getschool("") + // this.Searchvalue("") if (coursesId != undefined) { let url = "/courses/" + coursesId + "/settings.json" axios.get(url).then((result) => { @@ -285,8 +285,8 @@ class CoursesNew extends Component { this.setState({ searchlist: result.data.course_lists, - // course:value, - fetching: false + // course:value, + }) } // this.props.form.setFieldsValue({ @@ -298,10 +298,11 @@ class CoursesNew extends Component { } handleSearch=(value)=>{ + if(value!=""){ this.props.form.setFieldsValue({ classroom:value, - // course:value + // course:value }); this.Searchvalue(value) } @@ -311,7 +312,7 @@ class CoursesNew extends Component { handleChange=(value)=>{ this.props.form.setFieldsValue({ - // course:value, + // course:value, classroom:value }) }; @@ -319,21 +320,27 @@ class CoursesNew extends Component { handleSearchschool=(value)=>{ if(value!="") { - this.props.form.setFieldsValue({ - // school: value, + // this.props.form.setFieldsValue({ + // // school: value, + // fetching: true, + // }); + this.setState({ fetching: true, - }); - + school: value + }) this.getschool(value) } }; handleChangeschools=(value)=>{ - this.props.form.setFieldsValue({ - // school: value, - fetching: true, - }); + // this.props.form.setFieldsValue({ + // // school: value, + // fetching: true, + // }); + // this.setState({ + // fetching: true + // }) } handleChangeschool=(value)=>{ @@ -359,9 +366,13 @@ class CoursesNew extends Component { if (result.data.status===0) { this.setState({ searchlistscholl: result.data.school_names, - // school: value - }) + }) + if(result.data.school_names.length!=0){ + this.setState({ + fetching: false + }) + } } }).catch((error)=>{ console.log(error) @@ -420,8 +431,7 @@ class CoursesNew extends Component { `} -
+ {/*内容*/} - {/*
*/} - - {/*
*/}
@@ -451,18 +462,15 @@ class CoursesNew extends Component { {getFieldDecorator('course', { rules: [{required: true, message: "不能为空"}], })( - + + + {options} + )} {/*(错误示例:数据结构2017本部;数据结构2017秋季;数据结构2017电子商务1班)*/} @@ -632,18 +640,14 @@ class CoursesNew extends Component { {getFieldDecorator('school', { rules: [{required: true, message: "不能为空"}], })( - + {optionschool} + )} {/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/} @@ -651,7 +655,7 @@ class CoursesNew extends Component {
- {searchlistscholl.length===0?
+ {searchlistscholl.length===0&&this.state.fetching===true?
未找到包含“{school}”的高校, 申请新增 diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js index 9c166f43f..003724ede 100644 --- a/public/react/src/modules/home/shixunsHome.js +++ b/public/react/src/modules/home/shixunsHome.js @@ -217,7 +217,7 @@ class ShixunsHome extends Component {
- {item.name} + {item.tag_name}
diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 791110b0b..94319a819 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -95,7 +95,8 @@ class NewHeader extends Component { }); - + //获取游览器地址 + window.sessionStorage.setItem("yslgeturls",JSON.stringify(window.location.href)) } diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index f6af871dd..b89990420 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -1869,6 +1869,7 @@ export default class TPMsettings extends Component { placeholder="请选择开启时间" value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)} onChange={this.onChangeTimePicker} + dropdownClassName="hideDisable" /> diff --git a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js index 396358708..5d66829c3 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js +++ b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js @@ -256,11 +256,12 @@ export default class TPMevaluation extends Component { this.setevaluationlist(newevaluationlist); } - getfilepath=(e,shixunfilepath)=>{ + getfilepath=(e,shixunfilepath,type)=>{ this.setState({ evaluationvisible: true, selectpath:e.target.value, selectpatharr:[], + pathtype:type }); let id = this.props.match.params.shixunId; let url ="/shixuns/"+id+"/repository.json"; @@ -283,9 +284,9 @@ export default class TPMevaluation extends Component { }); } - sendgetfilepath=(newpath,type)=>{ + sendgetfilepath=(newpath,type,newpathtype)=>{ let id = this.props.match.params.shixunId; - let{path,main}=this.state; + let{path,main,pathtype}=this.state; let ary=main; let paths=path; @@ -329,10 +330,18 @@ export default class TPMevaluation extends Component { }); } + if(pathtype===2){ + this.setState({ + selectpath: newpathtype, + }) + } } goblakepath=(path,key)=>{ - let {main,selectpath} =this.state; + let {main,selectpath,pathtype} =this.state; + + + let newmain=[] for(var i=0;i<=key;i++){ newmain.push(main[i]) @@ -355,6 +364,17 @@ export default class TPMevaluation extends Component { }).catch((error) => { console.log(error) }); + + if(pathtype===2){ + // var str=path; + // str.slice(0,str.length-1) + // debugger + // console.log(str) + this.setState({ + selectpath: path, + }) + } + } // delesavegetfilepath=(value)=>{ // let {selectpatharr} = this.state @@ -381,7 +401,36 @@ export default class TPMevaluation extends Component { // }) // } savegetfilepath=(value)=>{ - let {selectpath,saveshixunfilepath} = this.state + let {selectpath,saveshixunfilepath,pathtype} = this.state + + if(pathtype===1){ + let newselectpath; + + if(saveshixunfilepath==="shixunfilepathplay"){ + newselectpath=value + }else{ + const type = selectpath.split(';'); + let types=false; + for(var i=0; i{ @@ -650,9 +675,10 @@ export default class TPMevaluation extends Component { selectpath:e.target.value }) } - updatepath=(e,name)=>{ + updatepath=(e,name,type)=>{ this.setState({ - [name]:e.target.value + [name]:e.target.value, + pathtype:type }) } @@ -818,8 +844,8 @@ export default class TPMevaluation extends Component { placeholder="请选择版本库中的代码文件。例: src/step1/HelloWorld.java" value={shixunfilepath} style={{ width:StudentTaskPapers===true?'100%':""}} - onInput={(e)=>this.updatepath(e,"shixunfilepath")} - onClick={(e)=>this.getfilepath(e,"shixunfilepath")} + onInput={(e)=>this.updatepath(e,"shixunfilepath",1)} + onClick={(e)=>this.getfilepath(e,"shixunfilepath",1)} />

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

@@ -844,7 +870,7 @@ export default class TPMevaluation extends Component { { main.length===0?"":main.map((item,key)=>{ return( - this.goblakepath(item.path,key)}>{item.val} + this.goblakepath(item.path,key,item)}>{item.val} ) }) } @@ -853,7 +879,7 @@ export default class TPMevaluation extends Component { return(
  • { - item.type==="tree"?this.sendgetfilepath(item.name,item.type)} data-remote="true"> + item.type==="tree"?this.sendgetfilepath(item.name,item.type,path+item.name)} data-remote="true"> {path+item.name}: @@ -873,7 +899,7 @@ export default class TPMevaluation extends Component {
    this.saveselectpath(e)} value={selectpath}/>
    @@ -897,8 +923,8 @@ export default class TPMevaluation extends Component { placeholder="请选择版本库中的代码文件。例:src/step1/HelloWorldTest.java" value={shixunfilepathplay} style={{width:StudentTaskDocs===true?'100%':""}} - onInput={(e)=>this.updatepath(e,"shixunfilepathplay")} - onClick={(e)=>this.getfilepath(e,"shixunfilepathplay")} + onInput={(e)=>this.updatepath(e,"shixunfilepathplay",1)} + onClick={(e)=>this.getfilepath(e,"shixunfilepathplay",1)} />

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

    @@ -958,8 +984,8 @@ export default class TPMevaluation extends Component { id="shixun_file_expect_picture_path" name="challenge[original_picture_path]" placeholder="请选择版本库中存储了待处理图片的路径。例:src/step1/expectedimages" value={shixunfileexpectpicturepath} - onInput={(e)=>this.updatepath(e,"shixunfileexpectpicturepath")} - onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath")} + onInput={(e)=>this.updatepath(e,"shixunfileexpectpicturepath",2)} + onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath",2)} />

    该路径下的文件将在学员评测本关任务时,作为原始图片显示在查看效果页,供学员参考,任务为图片处理时请指定该路径,并注意与程序文件所在文件夹分开 @@ -980,8 +1006,8 @@ export default class TPMevaluation extends Component { id="shixun_file_standard_picture_path" name="challenge[expect_picture_path]" placeholder="请选择版本库中存储了标准答案代码输出文件的路径。例:src/step1/expectedimages" value={shixunfilestandardpicturepath} - onInput={(e)=>this.updatepath(e,"shixunfilestandardpicturepath")} - onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath")} + onInput={(e)=>this.updatepath(e,"shixunfilestandardpicturepath",2)} + onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath",2)} />

    该路径下的文件将在学员评测本关任务时,作为参考答案显示在查看效果页,供学员参考任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开 @@ -1001,8 +1027,8 @@ export default class TPMevaluation extends Component { this.updatepath(e,"shixunfilepicturepath")} - onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath")} + onInput={(e)=>this.updatepath(e,"shixunfilepicturepath",2)} + onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath",2)} placeholder="请在版本库中指定用来保存学员代码实际输出结果的路径。例:src/step1/outputimages"/>

    学员评测本关任务时生成的文件将保存在该路径下,并作为实际输出显示在查看效果页,供学员确认任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开 diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index c15269c5a..f9c8f5b10 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -743,10 +743,12 @@ class Newshixuns extends Component { onChangeTimePicker = (value, dateString) => { this.setState({ - TimePickervalue: handleDateStrings(dateString) + TimePickervalue: moment(handleDateStrings(dateString)) }) } - // 附件相关 START + + + // 附件相关 START handleChange = (info) => { console.log("handleChange1"); let fileList = info.fileList; @@ -1279,14 +1281,16 @@ class Newshixuns extends Component {