diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bda4bcc6c..9630caaec 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -465,9 +465,9 @@ class ApplicationController < ActionController::Base # 实训主类别列表,自带描述 def shixun_main_type list = [] - mirrors = MirrorRepository.select([:id, :type_name, :description]).published_main_mirror + mirrors = MirrorRepository.select([:id, :type_name, :description, :name]).published_main_mirror mirrors.try(:each) do |mirror| - list << {id: mirror.id, type_name: mirror.type_name, description: mirror.try(:description)} + list << {id: mirror.id, type_name: mirror.type_name, description: mirror.try(:description), mirror_name: mirror.name} end list end @@ -475,9 +475,9 @@ class ApplicationController < ActionController::Base # 小类别列表 def shixun_small_type list = [] - mirrors = MirrorRepository.select([:id, :type_name, :description]).published_small_mirror + mirrors = MirrorRepository.select([:id, :type_name, :description, :name]).published_small_mirror mirrors.try(:each) do |mirror| - list << {id: mirror.id, type_name: mirror.type_name, description: mirror.description} + list << {id: mirror.id, type_name: mirror.type_name, description: mirror.description, mirror_name: mirror.name} end list end diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index f75dd7147..84ceacd26 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -400,13 +400,14 @@ class ShixunsController < ApplicationController @shixun.shixun_info.update_attributes(shixun_info_params) # 镜像变动 @shixun.shixun_mirror_repositories.where.not(mirror_repository_id: old_mirror_ids).destroy_all - @shixun.shixun_mirror_repositories.create!(new_mirror_id) + @shixun.shixun_mirror_repositories.create!(new_mirror_id) if new_mirror_id.present? # 镜像变动要更换服务配置 @shixun.shixun_service_configs.where.not(mirror_repository_id: old_mirror_ids).destroy_all - @shixun.shixun_service_configs.create!(service_create_params) + @shixun.shixun_service_configs.create!(service_create_params) if service_create_params.present? service_update_params&.map do |service| smr = @shixun.shixun_service_configs.find_by(mirror_repository_id: service[:mirror_repository_id]) - smr.update_attributes(service) + logger.info("########smr: #{smr}") + smr.update_attributes(service) if smr.present? end # 添加第二仓库(管理员权限) if params[:is_secret_repository] diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb index 1bbad9390..0f5af6cb8 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -48,7 +48,7 @@ module JupyterService tpiID = myshixun.id mount = myshixun.shixun.data_sets.present? - params = {tpiID: tpiID, identifier: shixun.identifier, needMount: mount, + params = {tpiID: tpiID, identifier: shixun.identifier, myshixunIdentifier: myshixun.identifier, needMount: mount, :containers => "#{Base64.urlsafe_encode64(shixun_container_limit(shixun))}"} res = uri_post uri, params diff --git a/db/migrate/20191216071931_modify_task_pass_for_shixuns.rb b/db/migrate/20191216071931_modify_task_pass_for_shixuns.rb new file mode 100644 index 000000000..b1e4372ff --- /dev/null +++ b/db/migrate/20191216071931_modify_task_pass_for_shixuns.rb @@ -0,0 +1,5 @@ +class ModifyTaskPassForShixuns < ActiveRecord::Migration[5.2] + def change + change_column :shixuns, :task_pass, :boolean, :default => true + end +end diff --git a/public/react/src/App.js b/public/react/src/App.js index 7d83757aa..4694d57da 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -608,10 +608,10 @@ class App extends Component { } } /> - + {/*/>*/} diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 7384c7f6e..8740a9bbf 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -893,7 +893,6 @@ class PollNew extends Component { //保存并继续 //保存并继续,即提交本题的新建并继续创建一个相同的题(该新题处于编辑模式,题目和选项不要清空) Deleteadddomtwo = (indexo, object,bool) => { - debugger var thiss = this; @@ -1038,7 +1037,7 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.props.showNotification(`可选的最大限制不能小于最小限制`); return; } } @@ -1258,7 +1257,7 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.props.showNotification(`可选的最大限制不能小于最小限制`); return; } } @@ -1449,9 +1448,7 @@ class PollNew extends Component { // indexo 第几个数组 //object 单个数组数据 Deleteadddomthree = (indexo, object,bool) => { - this.setState({ - newoption: false, - }) + // console.log("deleteadddom 349") var thiss = this; let arr = this.state.adddom; @@ -1477,9 +1474,14 @@ class PollNew extends Component { } if (newarr[indexo].question.question_title === "") { this.props.showNotification('题目不能为空!'); + return + } + if (newarr[indexo].question.question_title.match(/^[ ]*$/)) { + this.props.showNotification('题目不能为空!'); return } + if (max > 0) { if (object.question.question_type === 1) { this.props.showNotification('选项内容不能为空!'); @@ -1579,7 +1581,7 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.props.showNotification(`可选的最大限制不能小于最小限制`); return; } } @@ -1790,7 +1792,7 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.props.showNotification(`可选的最大限制不能小于最小限制`); return; } } @@ -1867,7 +1869,6 @@ class PollNew extends Component { }; question = {"question": questiontwo}; //插入多选题 - if (uuk !== -1) { // console.log("修改") this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length); @@ -2016,10 +2017,11 @@ class PollNew extends Component { if (result !== undefined) { if (result.data.status === 0) { this.props.showNotification(`已完成`); - thiss.thisinitializationdatanew(); this.setState({ Newdisplay:false, + newoption: false, + }) // console.log("确认创建问题") // console.log(result) @@ -2032,11 +2034,24 @@ class PollNew extends Component { // // } } + }else{ + this.setState({ + Newdisplay:true, + newoption: false, + + }) } // } catch (e) { // // } + }).catch((error) => { + console.log(error) + this.setState({ + Newdisplay:true, + newoption: false, + + }) }) @@ -2096,11 +2111,24 @@ class PollNew extends Component { if (result.data.status === 0) { this.props.showNotification(`编辑题目成功`); thiss.thisinitializationdatanew(); + this.setState({ + Newdisplay:false, + newoption: false, + }) } } catch (e) { // console.log("调用了edittotheserver") - console.log(e) + this.setState({ + Newdisplay:true, + newoption: false, + }) } + }).catch((error) => { + console.log(error) + this.setState({ + Newdisplay:true, + newoption: false, + }) }) } @@ -2685,7 +2713,8 @@ class PollNew extends Component { // console.log("2301"); // console.log(newr); // window.history.pushState('','',newUrl+'?tab='+e); - window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`; + + // window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`; }) } else { @@ -2773,6 +2802,7 @@ class PollNew extends Component { height: '30px', lineHeight: '30px', }; + const hejiine=this.state.mysingles + this.state.mydoubles + this.state.mymainsint; // console.log(this.state.projects===undefined?"":this.state.projects.poll_questions) var displaymysave = (mysave === true) ? "" : "display:none;"; @@ -2942,7 +2972,7 @@ class PollNew extends Component { { - this.state.mysingles + this.state.mydoubles + this.state.mymainsint === 0 ? "" : + hejiine=== 0 ? "" :
{this.state.mysingles === 0 ? "" : 合计 {this.state.mysingles === undefined ? "" : this.state.mydoubles === undefined ? "" : this.state.mymainsint === undefined ? "" : this.state.mysingles + this.state.mydoubles + this.state.mymainsint} + className="color-blue">{this.state.mysingles === undefined ? "" : this.state.mydoubles === undefined ? "" : this.state.mymainsint === undefined ? "" : hejiine}
} diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index ab75b6c89..435a9ca6e 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -46,6 +46,7 @@ const {Option} = Select; //作品列表(学生) let allow_lates=false; let answer_open_evaluation=false; +// Curcomlevel class Listofworksstudentone extends Component { //unifiedsetting 统一设置 //allowreplenishment 允许补交 @@ -269,7 +270,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '提交状态', + title: '作品状态', dataIndex: 'submitstate', key: 'submitstate', align: "center", @@ -277,15 +278,17 @@ class Listofworksstudentone extends Component { width: '98px', render: (text, record) => ( - {record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate} + } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center", width: '98px',} + : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px',} + : { + color: '#747A7F', + textAlign: "center", + width: '98px', + }}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate} ), @@ -310,14 +313,14 @@ class Listofworksstudentone extends Component { } }> {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time === "--" ? "--" : - {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} + } + >{record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} } @@ -340,7 +343,26 @@ class Listofworksstudentone extends Component { // ), // }, { - title: '完成情况', + title: '当前完成关卡', + dataIndex: 'curcomlevel', + key: 'curcomlevel', + align: "center", + className: 'font-14', + width: '99px', + render: (text, record) => ( + + {record.Curcomlevel + "/" + this.state.challenges_count} + + ), + }, + { + title: '截止前完成关卡', dataIndex: 'completion', key: 'completion', align: "center", @@ -359,7 +381,9 @@ class Listofworksstudentone extends Component { ), }, { - title: '关卡得分', + title:关卡得分 + 截止前学员完成的关卡才有成绩
+ }>
, dataIndex: 'levelscore', key: 'levelscore', align: 'center', @@ -638,7 +662,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '提交状态', + title: '作品状态', dataIndex: 'submitstate', key: 'submitstate', align: "center", @@ -646,15 +670,17 @@ class Listofworksstudentone extends Component { width: '98px', render: (text, record) => ( - {record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate} + } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center", width: '98px',} + : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px',} + : { + color: '#747A7F', + textAlign: "center", + width: '98px', + }}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate} ), @@ -709,7 +735,26 @@ class Listofworksstudentone extends Component { // ), // }, { - title: '完成情况', + title: '当前完成关卡', + dataIndex: 'curcomlevel', + key: 'curcomlevel', + align: "center", + className: 'font-14', + width: '99px', + render: (text, record) => ( + + {record.Curcomlevel + "/" + this.state.challenges_count} + + ), + }, + { + title: '截止前完成关卡', dataIndex: 'completion', key: 'completion', align: "center", @@ -728,7 +773,9 @@ class Listofworksstudentone extends Component { ), }, { - title: '关卡得分', + title:关卡得分 + 截止前学员完成的关卡才有成绩
+ }>
, dataIndex: 'levelscore', key: 'levelscore', align: 'center', @@ -967,19 +1014,21 @@ class Listofworksstudentone extends Component { ) }, { - title: '提交状态', + title: '作品状态', dataIndex: 'submitstate', key: 'submitstate', align: 'center', className: 'font-14', render: (text, record) => ( - {record.submitstate} + } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center"} + : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px'} + : { + color: '#747A7F', + textAlign: "center" + }}>{record.submitstate} ) @@ -1036,7 +1085,26 @@ class Listofworksstudentone extends Component { // ), // }, { - title: '完成情况', + title: '当前完成关卡', + dataIndex: 'curcomlevel', + key: 'curcomlevel', + align: "center", + className: 'font-14', + width: '99px', + render: (text, record) => ( + + {record.Curcomlevel + "/" + this.state.challenges_count} + + ), + }, + { + title: '截止前完成关卡', dataIndex: 'completion', key: 'completion', align: 'center', @@ -1051,7 +1119,9 @@ class Listofworksstudentone extends Component { ) }, { - title: '关卡得分', + title:关卡得分 + 截止前学员完成的关卡才有成绩
+ }>
, dataIndex: 'levelscore', key: 'levelscore', align: 'center', @@ -1094,12 +1164,12 @@ class Listofworksstudentone extends Component { { record.efficiencyscore && record.efficiencyscore === "--" ? ( this.state.allow_late && this.state.allow_late === false ? - + -- : this.state.allow_late && this.state.allow_late === true ? - + -- : @@ -1315,19 +1385,21 @@ class Listofworksstudentone extends Component { ) }, { - title: '提交状态', + title: '作品状态', dataIndex: 'submitstate', key: 'submitstate', align: 'center', className: 'font-14', render: (text, record) => ( - {record.submitstate} + } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center"} + : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px'} + : { + color: '#747A7F', + textAlign: "center" + }}>{record.submitstate} ) @@ -1360,20 +1432,39 @@ class Listofworksstudentone extends Component { } }> {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time === "--" ? "--" : - {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} - + } + >{record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} + } ) }, { - title: '完成情况', + title: '当前完成关卡', + dataIndex: 'curcomlevel', + key: 'curcomlevel', + align: "center", + className: 'font-14', + width: '99px', + render: (text, record) => ( + + {record.Curcomlevel + "/" + this.state.challenges_count} + + ), + }, + { + title: '截止前完成关卡', dataIndex: 'completion', key: 'completion', align: 'center', @@ -1388,7 +1479,9 @@ class Listofworksstudentone extends Component { ) }, { - title: '关卡得分', + title:关卡得分 + 截止前学员完成的关卡才有成绩
+ }>
, dataIndex: 'levelscore', key: 'levelscore', align: 'center', @@ -1431,12 +1524,12 @@ class Listofworksstudentone extends Component { { record.efficiencyscore && record.efficiencyscore === "--" ? ( this.state.allow_late && this.state.allow_late === false ? - + -- : this.state.allow_late && this.state.allow_late === true ? - + -- : @@ -1977,7 +2070,7 @@ class Listofworksstudentone extends Component { stduynumber: teacherdata.student_id, classroom: teacherdata.group_name, cost_time: teacherdata.cost_time, - submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时完成" : teacherdata.work_status === 2 ? "延时完成" : "未提交", + submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -1991,6 +2084,7 @@ class Listofworksstudentone extends Component { ultimate_score: teacherdata.ultimate_score, user_name: teacherdata.user_name, user_login: teacherdata.user_login, + Curcomlevel: teacherdata.current_complete_count===undefined||teacherdata.current_complete_count===null||teacherdata.current_complete_count===""?0:teacherdata.current_complete_count, }) // } @@ -2019,7 +2113,7 @@ class Listofworksstudentone extends Component { stduynumber: student_works[i].student_id, classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, - submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时完成" : student_works[i].work_status === 2 ? "延时完成" : "未提交", + submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2033,6 +2127,7 @@ class Listofworksstudentone extends Component { ultimate_score: student_works[i].ultimate_score, user_name: student_works[i].user_name, user_login: student_works[i].user_login, + Curcomlevel:student_works[i].current_complete_count===null||student_works[i].current_complete_count===null||student_works[i].current_complete_count===""?0:student_works[i].current_complete_count, }) } @@ -2178,7 +2273,7 @@ class Listofworksstudentone extends Component { stduynumber: teacherdata.student_id, classroom: teacherdata.group_name, cost_time: teacherdata.cost_time, - submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时完成" : teacherdata.work_status === 2 ? "延时完成" : "未提交", + submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2192,6 +2287,8 @@ class Listofworksstudentone extends Component { ultimate_score: teacherdata.ultimate_score, user_name: teacherdata.user_name, user_login: teacherdata.user_login, + Curcomlevel: teacherdata.current_complete_count===null|| teacherdata.current_complete_count===undefined|| teacherdata.current_complete_count===""?0: teacherdata.current_complete_count, + }) // } @@ -2537,7 +2634,7 @@ class Listofworksstudentone extends Component { stduynumber: student_works[i].student_id, classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, - submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时完成" : student_works[i].work_status === 2 ? "延时完成" : "未提交", + submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2551,6 +2648,7 @@ class Listofworksstudentone extends Component { ultimate_score: student_works[i].ultimate_score, user_name: student_works[i].user_name, user_login: student_works[i].user_login, + Curcomlevel: student_works[i].current_complete_count===undefined||student_works[i].current_complete_count===null||student_works[i].current_complete_count===""?0:student_works[i].current_complete_count, }) } @@ -3356,13 +3454,42 @@ class Listofworksstudentone extends Component { } render() { - let {columns, course_groupysls, datajs, isAdmin, homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, game_list, columnsstu, columnsstu2, limit, experience, boolgalist, viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate, computeTimetype} = this.state; + let {columns,columnss, course_groupysls, datajs, isAdmin, homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, game_list, columnsstu, columnsstu2, limit, experience, boolgalist, viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate, computeTimetype} = this.state; const antIcon = ; let course_is_end = this.props.current_user && this.props.current_user.course_is_end; // console.log("Listofworksstudentone.js"); // console.log(orders); - + let homewrok=false; + if(homework_status && homework_status.length > 0){ + for(var i=0;i tr > th, .ant-table-tbody > tr > td { - padding: 9px; + padding: 0px; } `}
@@ -3846,10 +3973,10 @@ class Listofworksstudentone extends Component { {teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" : {teacherdata.left_time.status} } - {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : - {teacherdata.left_time.time} - } + {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : + {teacherdata.left_time.time} + } @@ -3901,7 +4028,7 @@ class Listofworksstudentone extends Component { height: 58px; } .ysltableow .ant-table-thead > tr > th, .ant-table-tbody > tr > td { - padding: 9px; + padding: 0px; } `}
@@ -4005,7 +4132,7 @@ class Listofworksstudentone extends Component { height: 58px; } .ysltableows .ant-table-thead > tr > th, .ant-table-tbody > tr > td { - padding: 9px; + padding: 0px; } ` } @@ -4043,9 +4170,9 @@ class Listofworksstudentone extends Component { {teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" : {teacherdata.left_time.status}} - {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : - {teacherdata.left_time.time}} + {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : + {teacherdata.left_time.time}}
diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index ff2f067e4..783972f75 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1294,8 +1294,9 @@ submittojoinclass=(value)=>{
  • this.getUser("/courses/new")}>{this.props.user&&this.props.user.main_site===false?"新建课堂":"新建翻转课堂"}
  • :"" } {shixuntype===true?"":
  • this.getUser("/shixuns/new")}>新建实训项目
  • } - {this.props.Headertop===undefined?"": - pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?
  • this.getUser("/paths/new")} >新建实践课程
  • :"" + {this.props.user&&this.props.user.main_site===false?"":this.props.Headertop===undefined?"":
  • this.getUser("/paths/new")} >新建实践课程
  • } + {this.props.user&&this.props.user.main_site===true?"":this.props.Headertop===undefined?"": + pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?
  • this.getUser("/paths/new")} >新建实践课程
  • :"" } {this.props.user&&this.props.user.main_site===true?
  • this.getUser("/projects/new","projects")} target="_blank">新建开发项目
  • :""} diff --git a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js index f3ec8e300..71754fc87 100644 --- a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js +++ b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js @@ -704,9 +704,6 @@ class Shixuninformation extends Component { }) } }); - this.setState({ - loading: false - }) } Selectthestudent = (value) => { diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index bf744abde..cc537496a 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -97,6 +97,7 @@ class Newshixuns extends Component { }) const mdContnet = this.contentMdRef.current.getValue().trim(); this.props.form.validateFieldsAndScroll((err, values) => { + debugger if (!err) { console.log('Received values of form: ', values); @@ -117,21 +118,20 @@ class Newshixuns extends Component { // window.open("/shixuns/"+response.data.shixun_identifier+"/challenges"); } else { this.setState({ - loading: true + loading: false }) } }).catch((error) => { this.setState({ - loading: true + loading: false }) }) - - + }else{ + this.setState({ + loading: false + }) } }); - this.setState({ - loading: false - }) }; Selectthestudent = (value) => { this.props.form.setFieldsValue({ diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 840891ff7..3bbc4bf8f 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -263,7 +263,7 @@ class Challengesjupyter extends Component { "" : ( - is_teacher===true||admin===true||business===true||mysidentity===true? + admin===true||business===true||mysidentity===true?

    任务详情

    @@ -306,7 +306,7 @@ class Challengesjupyter extends Component { } { - is_teacher===true||admin===true||business===true||mysidentity===true? + admin===true||business===true||mysidentity===true?
    { diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js index d9db6108d..7bb96e30c 100644 --- a/public/react/src/modules/user/usersInfo/InfosPath.js +++ b/public/react/src/modules/user/usersInfo/InfosPath.js @@ -168,6 +168,8 @@ class InfosPath extends Component{ ); + + // console.log(this.props.user&&this.props.user.main_site) return(
    @@ -327,7 +329,10 @@ class InfosPath extends Component{
    {/* 295 */} { - page == 1 && is_current && !category ? :"" + this.props.user&&this.props.user.main_site===true?page == 1 && is_current && !category ? :"":"" + } + { + this.props.user&&this.props.user.main_site===false?this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?page == 1 && is_current && !category ? :"":"":"" } { (!data || (data && data.subjects.length==0)) && category &&