diff --git a/app/controllers/ecs/reach_criteria_controller.rb b/app/controllers/ecs/reach_criteria_controller.rb index bbfa123cd..0850f3aff 100644 --- a/app/controllers/ecs/reach_criteria_controller.rb +++ b/app/controllers/ecs/reach_criteria_controller.rb @@ -1,4 +1,4 @@ -class ReachCriteriaController < Ecs::BaseController +class Ecs::ReachCriteriaController < Ecs::BaseController before_action :check_major_manager_permission!, only: [:create] def create diff --git a/app/controllers/ecs/reach_evaluations_controller.rb b/app/controllers/ecs/reach_evaluations_controller.rb index 25ac24656..41ea0d52c 100644 --- a/app/controllers/ecs/reach_evaluations_controller.rb +++ b/app/controllers/ecs/reach_evaluations_controller.rb @@ -1,7 +1,7 @@ class Ecs::ReachEvaluationsController < Ecs::BaseController def show - preload = { ec_graduation_subitems: { ec_course_support: [:ec_course, :ec_graduation_requirement_calculation] } } + preload = { ec_graduation_subitems: { ec_course_supports: [:ec_course, :ec_graduation_requirement_calculation] } } @graduation_requirements = current_year.ec_graduation_requirements.includes(preload) respond_to do |format| diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index be8173b2f..709b4edfd 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -431,6 +431,7 @@ class GamesController < ApplicationController # params[:status] 1: 目录树点击的请求 0:正常自动加载 # 返回参数status : -1 系统统一报错提示;-3 需要轮训重试,带retry参数;-4 立即重试 def rep_content + raise("666") challenge_path = @game.challenge.try(:path) if challenge_path.blank? tip_exception("代码获取异常,请检查实训模板的评测设置是否正确") diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index 4e8e89567..f6df24011 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -28,6 +28,16 @@ class Fileslistitem extends Component{ } showfiles=(list)=>{ + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() + return + } + if(list.is_history_file===false){ // this.props.DownloadFileA(list.title,list.url) //window.location.href=list.url; @@ -217,7 +227,9 @@ class Fileslistitem extends Component{ { this.props.isNotMember===true? discussMessage.is_lock === true ? - {discussMessage.title} + + {discussMessage.title} + :this.showfiles(discussMessage)} title={discussMessage.title} diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index c52f3753a..02b1d5be1 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -113,31 +113,36 @@ class Fileslists extends Component{ updadatalist=(id)=>{ // this.seactall(id) - let coursesId=this.props.match.params.coursesId; - let url="/courses/"+coursesId+"/attahcment_category_list.json"; - axios.get(url, { - }).then((response) => { - if(response!=undefined){ - - if(response.data&&response.data) { - if (response.data.status != 401) { - let list = response.data.course_modules; - let course_second_categoriess; - list.map((item, key) => { - course_second_categoriess = item.course_second_categories - }) - - this.setState({ - course_modules: response.data, - has_course_groups: response.data.has_course_groups, - course_second_categories: course_second_categoriess - }) + if(this.props.user&&this.props.user.login=== ""||this.props.user&&this.props.user.login=== null||this.props.user&&this.props.user.login=== undefined){ + + }else{ + let coursesId=this.props.match.params.coursesId; + let url="/courses/"+coursesId+"/attahcment_category_list.json"; + axios.get(url, { + }).then((response) => { + if(response!=undefined){ + + if(response.data&&response.data) { + if (response.data.status != 401) { + let list = response.data.course_modules; + let course_second_categoriess; + list.map((item, key) => { + course_second_categoriess = item.course_second_categories + }) + + this.setState({ + course_modules: response.data, + has_course_groups: response.data.has_course_groups, + course_second_categories: course_second_categoriess + }) + } } + } - } + }) + } - }) } updatafiled=()=>{ if(this.props.match.params.main_id){ diff --git a/public/react/src/modules/courses/boards/BoardsListItem.js b/public/react/src/modules/courses/boards/BoardsListItem.js index 5abb25adb..14966f43a 100644 --- a/public/react/src/modules/courses/boards/BoardsListItem.js +++ b/public/react/src/modules/courses/boards/BoardsListItem.js @@ -1,115 +1,126 @@ -import React,{ Component } from "react"; -import {Tooltip} from 'antd' -import moment from 'moment' -import { getUrl, WordsBtn } from 'educoder' -class BoardsListItem extends Component{ - constructor(props){ - super(props); - this.state = { - - } - } - onTitleClick = (discussMessage) => { - const isAdminOrStudent = this.props.isAdminOrStudent(); - if (!isAdminOrStudent && discussMessage.is_public == false) { - // 没有权限访问 - return; - } - const cid = this.props.match.params.coursesId - const board_id = this.props.match.params.boardId - this.props.toDetailPage(cid, board_id, discussMessage.id) - } - render(){ - let { addGroup } = this.state; - const isAdmin = this.props.isAdmin() - const isAdminOrStudent = this.props.isAdminOrStudent() - const { checkBox, discussMessage, onSticky, onItemClick, current_user } = this.props; - if (!discussMessage || !discussMessage.author) { - return ''; - } - let canNotLink = !isAdminOrStudent && discussMessage.is_public == false - - return( -
- - { checkBox } - - {/* /images/avatars/User/1?1529221779 */} - 1?1529221779 - -
onItemClick(discussMessage)}> -
- {} : () => this.onTitleClick(discussMessage)} - title={`${discussMessage.subject.length > 40 ? discussMessage.subject : ''}`} - >{discussMessage.subject} - { !!discussMessage.sticky && 置顶 } - { - - discussMessage.is_public == false ? ( - - ) : "" - } -
- -
-

- - {discussMessage.author.name} - - { discussMessage.total_replies_count != 0 && {discussMessage.total_replies_count} 回复 } - { discussMessage.praises_count != 0 && {discussMessage.praises_count} 点赞 } - { discussMessage.visits != 0 && {discussMessage.visits} 浏览 } - - {moment(discussMessage.created_on).fromNow()} - -

-
- {(isAdmin || discussMessage.author.login == current_user.login) && - { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑 } - - { isAdmin && { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}> - { discussMessage.sticky ? '取消置顶' : '置顶' } } -
- - - - - - {/* { (isAdmin || discussMessage.author.login == current_user.login) && -
- -
- } */} - - -
-
- ) - } -} +import React,{ Component } from "react"; +import {Tooltip} from 'antd' +import moment from 'moment' +import { getUrl, WordsBtn } from 'educoder' +class BoardsListItem extends Component{ + constructor(props){ + super(props); + this.state = { + + } + } + onTitleClick = (discussMessage) => { + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() + return + } + + const isAdminOrStudent = this.props.isAdminOrStudent(); + if (!isAdminOrStudent && discussMessage.is_public == false) { + // 没有权限访问 + return; + } + const cid = this.props.match.params.coursesId + const board_id = this.props.match.params.boardId + this.props.toDetailPage(cid, board_id, discussMessage.id) + } + render(){ + let { addGroup } = this.state; + const isAdmin = this.props.isAdmin() + const isAdminOrStudent = this.props.isAdminOrStudent() + const { checkBox, discussMessage, onSticky, onItemClick, current_user } = this.props; + if (!discussMessage || !discussMessage.author) { + return ''; + } + let canNotLink = !isAdminOrStudent && discussMessage.is_public == false + + return( +
+ + { checkBox } + + {/* /images/avatars/User/1?1529221779 */} + 1?1529221779 + +
onItemClick(discussMessage)}> +
+ 40 ? discussMessage.subject : ''}`} placement="bottom"> + {} : () => this.onTitleClick(discussMessage)} + >{discussMessage.subject} + + { !!discussMessage.sticky && 置顶 } + { + + discussMessage.is_public == false ? ( + + ) : "" + } +
+ +
+

+ + {discussMessage.author.name} + + { discussMessage.total_replies_count != 0 && {discussMessage.total_replies_count} 回复 } + { discussMessage.praises_count != 0 && {discussMessage.praises_count} 点赞 } + { discussMessage.visits != 0 && {discussMessage.visits} 浏览 } + + {moment(discussMessage.created_on).fromNow()} + +

+
+ {(isAdmin || discussMessage.author.login == current_user.login) && + { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑 } + + { isAdmin && { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}> + { discussMessage.sticky ? '取消置顶' : '置顶' } } +
+ + + + + + {/* { (isAdmin || discussMessage.author.login == current_user.login) && +
+ +
+ } */} + + +
+
+ ) + } +} export default BoardsListItem; \ No newline at end of file diff --git a/public/react/src/modules/courses/busyWork/CommonWorkItem.js b/public/react/src/modules/courses/busyWork/CommonWorkItem.js index 122ed12d2..183682619 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkItem.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkItem.js @@ -16,7 +16,18 @@ class CommonWorkItem extends Component{ } } onItemClick = (item) => { - const isStudent = this.props.isStudent() + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() + return + } + + const isStudent = this.props.isStudent() if (isStudent) { this.props.toWorkQuestionPage(this.props.match.params, item.homework_id) } else { @@ -144,15 +155,15 @@ class CommonWorkItem extends Component{ }
this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>

- {} : () => this.onItemClick(item)} - >{item.name} - + + {} : () => this.onItemClick(item)} + >{item.name} + {/* 只有非课堂成员且作业是私有的情况下才会为true */} { item.private_icon===true ? - ( + ( ) : "" } @@ -182,7 +193,7 @@ class CommonWorkItem extends Component{ {item.uncommit_count===undefined?"":{item.uncommit_count} 未交} { item.status_time!="" && - { - if(key===this.props.indexs){ - console.log(key) - console.log(this.props.indexs) - } + return(

{/**/} diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index 750b9eb19..e025456e2 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -51,6 +51,21 @@ class ExerciseListItem extends Component{ Loadtype:false }) } + + toDetailPage=(url)=>{ + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() + return + } + + this.props.history.push(url); + } render(){ let{item,checkBox,index}=this.props; let {coursesId,Id}=this.props.match.params @@ -96,20 +111,22 @@ class ExerciseListItem extends Component{ {/*{item.exercise_name}*/} { - this.props.isAdmin()? {item.exercise_name}:"" + onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}:"" } { this.props.isStudent()? - {item.exercise_name}:"" + this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}:"" } { this.props.isNotMember()? item.lock_status === 0 ? - {item.exercise_name} - : {item.exercise_name}:"" + + {item.exercise_name} + + : this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}:"" } { diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index 1a0952a95..fb43b412a 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -133,6 +133,21 @@ class GraduateTaskItem extends Component{ setupdate=()=>{ this.props.funlist } + + toDetailPage=(url)=>{ + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() + return + } + + this.props.history.push(url); + } render(){ let { Modalstype, @@ -215,20 +230,22 @@ class GraduateTaskItem extends Component{
{ - this.props.isAdmin?this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")} title={discussMessage.name} - className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" + className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { - this.props.isStudent? this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")} title={discussMessage.name} - className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" + className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { this.props.isNotMember===true?this.props.discussMessage.private_icon===true? - {discussMessage.name} - : + {discussMessage.name} + + :this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list")} title={discussMessage.name} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index a7f886d78..830525af2 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -1169,9 +1169,11 @@ class GraduationTaskssettingapp extends Component{
评分设置
最终成绩组成 (取各教师最终评分的平均分)
- 启用交叉评阅 (给老师分配其他指导老师的学生作品) - + + 启用交叉评阅 (给老师分配其他指导老师的学生作品) + + {crosscomment===true?
开始时间: diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 0469d5d9c..184895428 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -40,7 +40,7 @@ class GraduationTaskssettinglist extends Component{ task_status:undefined, cross_comment:null, search:null, - order:"updated_at", + order:"update_time", b_order:"desc", course_group:undefined, loadingstate:true, @@ -92,6 +92,7 @@ class GraduationTaskssettinglist extends Component{ seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{ let{page,limit}=this.state; + // console.log(teacher_comment,task_status,course_group,cross_comment,order,b_order,search) let task_Id=this.props.match.params.task_Id; let url="/graduation_tasks/"+task_Id+"/tasks_list.json"; @@ -106,7 +107,7 @@ class GraduationTaskssettinglist extends Component{ order:order===null?undefined:order, b_order:b_order===null?undefined:b_order, search:search===null?undefined:search, - page:pages===null?undefined:page, + page:pages, limit:20, }, paramsSerializer: function(params) { @@ -281,8 +282,6 @@ class GraduationTaskssettinglist extends Component{ funtaskstatus=(checkedValues,key)=>{ // console.log(checkedValues) - console.log(checkedValues); - let {teacher_comment, course_group, cross_comment, order, b_order, search} = this.state; @@ -599,7 +598,7 @@ class GraduationTaskssettinglist extends Component{ this.cannerassocition(); let {taskslistdata}=this.state; let url = "/graduation_tasks/"+taskslistdata.task_id+"/graduation_works/cancel_relate_project.json"; - console.log(url) + axios.get(url).then((result)=>{ if(result.data.status===0){ @@ -655,8 +654,7 @@ class GraduationTaskssettinglist extends Component{ /// 确认是否下载 confirmysl(url){ - debugger; - console.log(1); + let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state; let params ={ @@ -958,7 +956,7 @@ class GraduationTaskssettinglist extends Component{ } - console.log(this.props.questionslist.status) + return( @@ -1221,10 +1219,10 @@ class GraduationTaskssettinglist extends Component{ {this.props.isAdmin()===true?

- {order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序 + {order==="update_time"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序

    -
  • this.funorder("updated_at")}>更新时间 +
  • this.funorder("update_time")}>更新时间
  • this.funorder("work_score" )}>最终成绩
  • @@ -1415,10 +1413,10 @@ class GraduationTaskssettinglist extends Component{

    - {order==="updated_at"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序

      -
    • this.funorder("updated_at")} className={order==="updated_at"?"none":""}>时间 +
    • this.funorder("update_time")} className={order==="update_time"?"none":""}>时间
    • this.funorder("work_score" )} className={order==="work_score"?"none":""}>成绩
    • diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js index bac04c699..cfb753501 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js @@ -15,6 +15,17 @@ class GraduateTopicItem extends Component{ this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/edit`); } toDetailPage=(topicId)=>{ + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() + return + } + let courseId=this.props.match.params.coursesId; this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/detail`); } @@ -71,7 +82,9 @@ class GraduateTopicItem extends Component{
      { isNotMember? - {discussMessage.name}:"" + + {discussMessage.name} + :"" } { diff --git a/public/react/src/modules/courses/poll/PollListItem.js b/public/react/src/modules/courses/poll/PollListItem.js index 359ef872c..356b758c8 100644 --- a/public/react/src/modules/courses/poll/PollListItem.js +++ b/public/react/src/modules/courses/poll/PollListItem.js @@ -1,5 +1,5 @@ import React,{ Component } from "react"; -import Tooltip from 'material-ui/Tooltip'; +import {Tooltip} from 'antd'; import {Link} from 'react-router-dom'; import moment from 'moment'; import CoursesListType from '../coursesPublic/CoursesListType'; @@ -15,6 +15,20 @@ class PollListItem extends Component{ constructor(props){ super(props); } + toDetailPage=(url)=>{ + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() + return + } + + this.props.history.push(url); + } render(){ let{item,checkBox,courseType,index}=this.props; let {coursesId}=this.props.match.params; @@ -37,12 +51,16 @@ class PollListItem extends Component{ }

      - { canNotLink ? {item.polls_name} : - {item.polls_name} + { canNotLink ? + + {item.polls_name} + + : + this.toDetailPage(`/courses/${coursesId}/polls/${item.id}/detail`)} className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name} } { item.lock_status === 0 ? - + :"" diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js index b56993b08..b29ee6121 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js @@ -143,6 +143,22 @@ class ShixunhomeWorkItem extends Component{ ModalsRenametype:false, }) } + + hrefjumpskip=(url)=>{ + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() + return + } + + this.props.history.push(url); + + } render(){ let { Modalstype, @@ -294,23 +310,25 @@ class ShixunhomeWorkItem extends Component{ {/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/} { - this.props.isAdmin?this.hrefjumpskip("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")} title={discussMessage.name} - className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" + className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { - this.props.isStudent? this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)} title={discussMessage.name} - className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" + className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { this.props.isNotMember===true? this.props.discussMessage.private_icon===true? - {discussMessage.name} - : + {discussMessage.name} + + : this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)} title={discussMessage.name} - className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" + className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 90fb3939b..3189f5c63 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -137,7 +137,7 @@ class Trainingjobsetting extends Component { componentDidMount() { console.log("Trainingjobsetting"); console.log("componentDidMount"); - this.getTrainingjobsetting(); + this.getTrainingjobsetting(true); let query = this.props.location.pathname; const type = query.split('/'); this.setState({ @@ -165,7 +165,7 @@ class Trainingjobsetting extends Component { // } // 获取数据地方 - getTrainingjobsetting = () => { + getTrainingjobsetting = (bool) => { // console.log("getTrainingjobsetting") var homeworkid = this.props.match.params.homeworkid; // console.log(homeworkid) @@ -293,6 +293,14 @@ class Trainingjobsetting extends Component { code_review:result.data.code_review }) this.props.Getdataback(result,result.data); + + if(bool===true){ + if(this.props.isAdmin() !== undefined){ + if(this.props.isAdmin() === true){ + this.editSettings(result); + } + } + } } }) @@ -1592,7 +1600,7 @@ class Trainingjobsetting extends Component { description:result.data.message }); this.homeworkhide(); - this.getTrainingjobsetting(); + this.getTrainingjobsetting(false); } } @@ -1623,7 +1631,7 @@ class Trainingjobsetting extends Component { // message:"提示", // description:response.data.message // }); - this.getTrainingjobsetting(); + this.getTrainingjobsetting(false); this.homeworkhide() } }) @@ -1814,7 +1822,7 @@ class Trainingjobsetting extends Component { if(moment(datas.data.late_time,"YYYY-MM-DD HH:mm")<=moment()){ endtime=false; } - if(datas.data.allowreplenishment === false){ + if(datas.data.allow_late === false){ whethertopays=false; } @@ -1829,15 +1837,16 @@ class Trainingjobsetting extends Component { flagPageEditsfor:endtime, completionefficiencyscore:true, work_efficiencys:true, - unifiedsetting:datas.data.unifiedsetting, + unifiedsetting:datas.data.unified_setting, latedeductiontwo:20, }); //均分比例 + // result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ? try { - if(datas.data.proportion==="均分比例"){ + if(datas.data.shixun_evaluation === 0){ this.Equalproportion(20); - }else if(datas.data.proportion==="经验值比例"){ + }else if(datas.data.shixun_evaluation === 1){ this.Empiricalvalueratio(20); } @@ -1853,9 +1862,9 @@ class Trainingjobsetting extends Component { flagPageEditstwo:releasetime, flagPageEditsthrees:deadline, flagPageEditsfor:endtime, - unifiedsetting:datas.data.unifiedsetting, + unifiedsetting:datas.data.unified_setting, }); - if(datas.data.work_efficiencys===true){ + if(datas.data.work_efficiency===true){ this.setState({ completionefficiencyscore:true, }) @@ -1873,9 +1882,9 @@ class Trainingjobsetting extends Component { flagPageEditstwo:releasetime, flagPageEditsthrees:deadline, flagPageEditsfor:endtime, - unifiedsetting:datas.data.unifiedsetting, + unifiedsetting:datas.data.unified_setting, }); - if(datas.data.work_efficiencys===true){ + if(datas.data.work_efficiency===true){ this.setState({ completionefficiencyscore:true, }) @@ -1886,7 +1895,7 @@ class Trainingjobsetting extends Component { } } - if(datas.data.proportion === "自定义分值"){ + if(datas.data.shixun_evaluation === 2){ this.setState({ boolUnitetwoname:"自定义分值", boolUnitetwo: false, @@ -1920,7 +1929,7 @@ class Trainingjobsetting extends Component { unit_e_tip: "", }) this.refs.targetElementTrainingjobsetting.scrollIntoView(); - this.getTrainingjobsetting(); + this.getTrainingjobsetting(false); } rulesCheckInfo=(rules)=>{ diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index f4f8a3f1c..f46d549ed 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -400,7 +400,11 @@ class LoginDialog extends Component { handleDialogClose = () => { if(this.props.match===undefined){ - window.location.href="/"; + // window.location.href="/"; + this.setState({ + isRender: false + }) + this.props.Modifyloginvalue(); }else{ this.setState({ isRender: false diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index bd42af623..be2a9908d 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -3,7 +3,6 @@ import {getImageUrl} from 'educoder'; import {Tooltip,Modal,Icon,Spin,message} from 'antd'; import DetailCardsEditAndAdd from './DetailCardsEditAndAdd'; import DetailCardsEditAndEdit from './DetailCardsEditAndEdit'; -import AccountProfile from"../../user/AccountProfile"; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import axios from 'axios'; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; @@ -201,10 +200,8 @@ class DetailCards extends Component{ return } - if(this.props.current_user&&this.props.current_user.profile_completed===false){ - this.setState({ - AccountProfiletype:true - }) + if(this.props.checkIfProfileCompleted()===false){ + this.props.showProfileCompleteDialog() return } @@ -308,16 +305,11 @@ class DetailCards extends Component{ startshixunCombattype:false }) } - hideAccountProfile=()=>{ - this.setState({ - AccountProfiletype:false - }) - } + render(){ let { pathCardsList, dropid, - AccountProfiletype, idsum, pathCardsedittype, pathlistedit, @@ -339,11 +331,7 @@ class DetailCards extends Component{ // console.log("zzz"+this.props.MenuItemsindextype) return(

      - {AccountProfiletype===true?this.hideAccountProfile()} - {...this.props} - {...this.state} - />:""} + { - this.setState({ - AccountProfiletype:false - }) - } + render(){ let{detailInfoList}=this.props; - let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,AccountProfiletype}=this.state; + let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state; const radioStyle = { display: 'block', height: '30px', @@ -373,11 +366,7 @@ class DetailTop extends Component{ return(
      40?"subhead mb100":"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb120":detailInfoList.name.length>40?"subhead mb100":"subhead mb80"}> - {AccountProfiletype===true?this.hideAccountProfile()} - {...this.props} - {...this.state} - />:""} +