Merge branch 'dev_aliyun' into dev_cxt

dev_ec
cxt 5 years ago
commit dba2061ab1

@ -354,6 +354,7 @@ class ExercisesController < ApplicationController
# question_bank = QuestionBank.new ques_params # question_bank = QuestionBank.new ques_params
# question_bank.save # question_bank.save
# end # end
exercise.update_attributes!(exercise_bank_id: current_ex_bank.id)
end end
# 试卷的问题的输入 # 试卷的问题的输入
exercise.exercise_questions.each do |q| exercise.exercise_questions.each do |q|

@ -301,6 +301,7 @@ class GraduationTasksController < ApplicationController
course_list_id: @course.course_list_id) course_list_id: @course.course_list_id)
task_bank.save! task_bank.save!
task.update_attributes!(gtask_bank_id: task_bank.id)
end end
task.attachments.each do |attachment| task.attachments.each do |attachment|
att = attachment.copy att = attachment.copy

@ -1322,6 +1322,8 @@ class HomeworkCommonsController < ApplicationController
else else
new_homework_bank = add_to_homework_bank_f homework new_homework_bank = add_to_homework_bank_f homework
new_homework_bank.save! new_homework_bank.save!
homework.update_attributes!(homework_bank_id: new_homework_bank.id)
end end
rescue Exception => e rescue Exception => e

@ -562,6 +562,7 @@ class PollsController < ApplicationController
question_bank = QuestionBank.new ques_params question_bank = QuestionBank.new ques_params
question_bank.save question_bank.save
end end
poll.update_attributes!(exercise_bank_id: current_ex_bank.id)
end end
# 问卷的问题的输入 # 问卷的问题的输入
poll.poll_questions.each do |f| poll.poll_questions.each do |f|

@ -1,6 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { withRouter } from 'react-router'
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import Loading from '../../Loading'; import Loading from '../../Loading';
import axios from 'axios'; import axios from 'axios';
@ -309,6 +310,13 @@ class CoursesIndex extends Component{
componentDidMount(){ componentDidMount(){
// this.updataleftNav() // this.updataleftNav()
this.historyArray = []
this.props.history.listen( location => {
console.log(location)
this.historyArray.unshift(location.pathname)
this.historyArray.length = 2;
//Do your stuff here
});
} }
updataleftNav=()=>{ updataleftNav=()=>{
@ -443,6 +451,7 @@ class CoursesIndex extends Component{
render() { render() {
const common = { const common = {
previousPathName: this.historyArray && this.historyArray[1]
// isAdmin: this.isAdmin, // isAdmin: this.isAdmin,
// isStudent: this.isStudent, // isStudent: this.isStudent,
// isAdminOrStudent: this.isAdminOrStudent, // isAdminOrStudent: this.isAdminOrStudent,
@ -464,47 +473,47 @@ class CoursesIndex extends Component{
{/*毕设任务题库详情*/} {/*毕设任务题库详情*/}
<Route path="/banks/gtopic_topics/:workid" <Route path="/banks/gtopic_topics/:workid"
render={ render={
(props) => (<Completetaskpage {...this.props} {...props} {...this.state} />) (props) => (<Completetaskpage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*毕设内容题库详情*/} {/*毕设内容题库详情*/}
<Route path="/banks/gtask_topics/:workid" <Route path="/banks/gtask_topics/:workid"
render={ render={
(props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} />) (props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*分组作业题库详情*/} {/*分组作业题库详情*/}
<Route path="/banks/group_topics/:workid" <Route path="/banks/group_topics/:workid"
render={ render={
(props) => (<GroupjobbankPage {...this.props} {...props} {...this.state} />) (props) => (<GroupjobbankPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 普通作业题库详情*/} {/* 普通作业题库详情*/}
<Route path="/banks/normal_topics/:workid" <Route path="/banks/normal_topics/:workid"
render={ render={
(props) => (<Generaljobbankdetails {...this.props} {...props} {...this.state} />) (props) => (<Generaljobbankdetails {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 资源列表页 */} {/* 资源列表页 */}
<Route path="/courses/:coursesId/file/:Id" exact <Route path="/courses/:coursesId/file/:Id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/files/:main_id" <Route path="/courses/:coursesId/files/:main_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/boards/:boardId" <Route exact path="/courses/:coursesId/boards/:boardId"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*课堂讨论*/} {/*课堂讨论*/}
<Route path="/courses/:coursesId/boards/:boardId" <Route path="/courses/:coursesId/boards/:boardId"
render={ render={
(props) => (<BoardIndex {...this.props} {...props} {...this.state} />) (props) => (<BoardIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -512,19 +521,19 @@ class CoursesIndex extends Component{
{/* 毕设问答 */} {/* 毕设问答 */}
<Route path="/courses/:coursesId/graduation_topics/postwork/new" <Route path="/courses/:coursesId/graduation_topics/postwork/new"
render={ render={
(props) => (<GraduateTopicPostWorksNew {...this.props} {...props} {...this.state} />) (props) => (<GraduateTopicPostWorksNew {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 毕设选题新建页 */} {/* 毕设选题新建页 */}
<Route path="/courses/:coursesId/graduation_topics/new" <Route path="/courses/:coursesId/graduation_topics/new"
render={ render={
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} />) (props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common}/>)
}></Route> }></Route>
{/* 毕设选题编辑页*/} {/* 毕设选题编辑页*/}
<Route path="/courses/:coursesId/graduation_topics/:topicId/edit" <Route path="/courses/:coursesId/graduation_topics/:topicId/edit"
render={ render={
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} />) (props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common}/>)
}></Route> }></Route>
{/* 毕设选题详情页 */} {/* 毕设选题详情页 */}
@ -537,7 +546,7 @@ class CoursesIndex extends Component{
{/* 毕设选题列表 */} {/* 毕设选题列表 */}
<Route path="/courses/:coursesId/graduation_topics/:Id" exact <Route path="/courses/:coursesId/graduation_topics/:Id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}></Route> }></Route>
@ -545,21 +554,21 @@ class CoursesIndex extends Component{
{/* 作品评阅 https://www.trustie.net/issues/19981 */} {/* 作品评阅 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/appraise" <Route path="/courses/:coursesId/graduation_tasks/:category_id/appraise"
render={ render={
(props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} />) (props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 新建作品 */} {/* 新建作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/works/new" <Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/works/new"
render={ render={
(props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} />) (props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 修改作品 */} {/* 修改作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:work_Id/works/edit" <Route path="/courses/:coursesId/graduation_tasks/:category_id/:work_Id/works/edit"
render={ render={
(props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} />) (props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -567,20 +576,20 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/setting" <Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/setting"
render={ render={
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} />) (props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/questions" <Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/questions"
render={ render={
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} />) (props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...common}/>)
}></Route> }></Route>
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/list" <Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/list"
render={ render={
(props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} />) (props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -589,7 +598,7 @@ class CoursesIndex extends Component{
{/* 修改毕设任务 https://www.trustie.net/issues/19981 */} {/* 修改毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/edit" <Route path="/courses/:coursesId/graduation_tasks/:category_id/edit"
render={ render={
(props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} />) (props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -597,7 +606,7 @@ class CoursesIndex extends Component{
{/* 新建毕设任务 https://www.trustie.net/issues/19981 */} {/* 新建毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/new" <Route path="/courses/:coursesId/graduation_tasks/:category_id/new"
render={ render={
(props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} />) (props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -605,87 +614,87 @@ class CoursesIndex extends Component{
{/* 毕设任务列表 https://www.trustie.net/issues/19981 */} {/* 毕设任务列表 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:Id" exact <Route path="/courses/:coursesId/graduation_tasks/:Id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*/!* 毕业设计主 https://www.trustie.net/issues/19981 *!/*/} {/*/!* 毕业设计主 https://www.trustie.net/issues/19981 *!/*/}
{/*<Route path="/courses/:coursesId/graduation"*/} {/*<Route path="/courses/:coursesId/graduation"*/}
{/*render={*/} {/*render={*/}
{/*(props) => (<GraduationTopics {...this.props} {...props} {...this.state} />)*/} {/*(props) => (<GraduationTopics {...this.props} {...props} {...this.state} {...common}/>)*/}
{/*}*/} {/*}*/}
{/*></Route>*/} {/*></Route>*/}
{/*/!* 资源子目录 https://www.trustie.net/issues/19917 *!/*/} {/*/!* 资源子目录 https://www.trustie.net/issues/19917 *!/*/}
{/*<Route path="/courses/:coursesId/attachment/attachment/:attachmentId"*/} {/*<Route path="/courses/:coursesId/attachment/attachment/:attachmentId"*/}
{/*render={*/} {/*render={*/}
{/*(props) => (<Files {...this.props} {...props} {...this.state} />)*/} {/*(props) => (<Files {...this.props} {...props} {...this.state} {...common}/>)*/}
{/*}*/} {/*}*/}
{/*></Route>*/} {/*></Route>*/}
{/* 教师列表*/} {/* 教师列表*/}
<Route path="/courses/:coursesId/teachers" <Route path="/courses/:coursesId/teachers"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 学生列表*/} {/* 学生列表*/}
<Route path="/courses/:coursesId/students" <Route path="/courses/:coursesId/students"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 分班列表 */} {/* 分班列表 */}
<Route path="/courses/:coursesId/course_groups/:course_group_id" <Route path="/courses/:coursesId/course_groups/:course_group_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 普通作业 */} {/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/:category_id" exact <Route path="/courses/:coursesId/common_homeworks/:category_id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 分组作业 */} {/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/:category_id" exact <Route path="/courses/:coursesId/group_homeworks/:category_id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 普通作业 */} {/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/" strict <Route path="/courses/:coursesId/common_homeworks/" strict
render={ render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} />) (props) => (<CommonWork {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 分组作业 */} {/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/" strict <Route path="/courses/:coursesId/group_homeworks/" strict
render={ render={
(props) => (<GroupWork {...this.props} {...props} {...this.state} />) (props) => (<GroupWork {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 问卷答题 */} {/* 问卷答题 */}
<Route path="/courses/:coursesId/polls/:pollId/users/:login" <Route path="/courses/:coursesId/polls/:pollId/users/:login"
render={ render={
(props) => (<PollInfo {...this.props} {...props} {...this.state} />) (props) => (<PollInfo {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 问卷详情 */} {/* 问卷详情 */}
<Route path="/courses/:coursesId/polls/:pollId/detail" <Route path="/courses/:coursesId/polls/:pollId/detail"
render={ render={
(props) => (<PollDetail {...this.props} {...props} {...this.state} />) (props) => (<PollDetail {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 问卷新建 */} {/* 问卷新建 */}
<Route path="/courses/:coursesId/polls/:pollid/:news" <Route path="/courses/:coursesId/polls/:pollid/:news"
render={ render={
(props) => (<PollNew {...this.props} {...props} {...this.state} />) (props) => (<PollNew {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*/!* 问卷编辑 *!/*/} {/*/!* 问卷编辑 *!/*/}
@ -697,7 +706,7 @@ class CoursesIndex extends Component{
{/* 问卷 */} {/* 问卷 */}
<Route path="/courses/:coursesId/polls/:Id" <Route path="/courses/:coursesId/polls/:Id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -705,20 +714,20 @@ class CoursesIndex extends Component{
{/* 试卷查看/评阅 */} {/* 试卷查看/评阅 */}
<Route exact path="/courses/:coursesId/exercises/:Id/users/:userId" <Route exact path="/courses/:coursesId/exercises/:Id/users/:userId"
render={ render={
(props)=>(<ExerciseReviewAndAnswer {...this.props} {...props} {...this.state} />) (props)=>(<ExerciseReviewAndAnswer {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*试卷新建 */} {/*试卷新建 */}
<Route exact path="/courses/:coursesId/exercises/new" <Route exact path="/courses/:coursesId/exercises/new"
render={ render={
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} />) (props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*试卷新建 */} {/*试卷新建 */}
<Route exact path="/courses/:coursesId/exercises/:Id/edit" <Route exact path="/courses/:coursesId/exercises/:Id/edit"
render={ render={
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} />) (props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -726,7 +735,7 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/exercises/:Id/student_exercise_list" <Route path="/courses/:coursesId/exercises/:Id/student_exercise_list"
render={ render={
(props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} />) (props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -735,14 +744,14 @@ class CoursesIndex extends Component{
<Route <Route
path="/courses/:coursesId/exercises/:Id/Studentshavecompletedthelist" path="/courses/:coursesId/exercises/:Id/Studentshavecompletedthelist"
render={ render={
(props) => (<Studentshavecompletedthelist {...this.props} {...props} {...this.state} />) (props) => (<Studentshavecompletedthelist {...this.props} {...props} {...this.state} {...common}/>)
} }
> >
</Route> </Route>
{/* 试卷 */} {/* 试卷 */}
<Route path="/courses/:coursesId/exercises/:Id" <Route path="/courses/:coursesId/exercises/:Id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -750,65 +759,65 @@ class CoursesIndex extends Component{
{/*实训查重详情*/} {/*实训查重详情*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/review_detail/:userid" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/review_detail/:userid"
render={ render={
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} />) (props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/review_detail/:userid" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/review_detail/:userid"
render={ render={
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} />) (props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*实训查重列表*/} {/*实训查重列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/student_work" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/student_work"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/student_work" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/student_work"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*实训报告*/} {/*实训报告*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/shixun_work_report" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/shixun_work_report"
render={ render={
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} />) (props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/shixun_work_report" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/shixun_work_report"
render={ render={
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} />) (props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*教师列表*/} {/*教师列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/list" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/list"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/list" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/list"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*实训作业page*/} {/*实训作业page*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/Page" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/Page"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*实训作业设置*/} {/*实训作业设置*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/settings" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/settings"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/settings" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/settings"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*/!*实训作品列表教师*!/*/} {/*/!*实训作品列表教师*!/*/}
@ -847,21 +856,21 @@ class CoursesIndex extends Component{
{/*实训作业问答主目录*/} {/*实训作业问答主目录*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/questions" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/questions"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*实训作业问答子目录*/} {/*实训作业问答子目录*/}
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/questions" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/questions"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*新建课堂*/} {/*新建课堂*/}
<Route path="/courses/new" <Route path="/courses/new"
render={ render={
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} />) (props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*新建精品课堂*/} {/*新建精品课堂*/}
@ -869,47 +878,47 @@ class CoursesIndex extends Component{
{/*id 是否是私有或者公有*/} {/*id 是否是私有或者公有*/}
<Route path="/courses/news/:subjectid/newgold/:id" <Route path="/courses/news/:subjectid/newgold/:id"
render={ render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />) (props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*修改精品课堂*/} {/*修改精品课堂*/}
<Route path="/courses/:coursesId/newgolds/settings" <Route path="/courses/:coursesId/newgolds/settings"
render={ render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />) (props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*修改课堂*/} {/*修改课堂*/}
<Route path="/courses/:coursesId/settings" <Route path="/courses/:coursesId/settings"
render={ render={
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} />) (props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 实训作业子页面*/} {/* 实训作业子页面*/}
<Route path="/courses/:coursesId/shixun_homework/:category_id" <Route path="/courses/:coursesId/shixun_homework/:category_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 实训作业页面*/} {/* 实训作业页面*/}
<Route path="/courses/:coursesId/shixun_homeworks/:main_id" <Route path="/courses/:coursesId/shixun_homeworks/:main_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*/!*实训作业and课堂详情页*!/*/} {/*/!*实训作业and课堂详情页*!/*/}
<Route path="/courses/:coursesId" <Route path="/courses/:coursesId"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*课堂首页*/} {/*课堂首页*/}
<Route path="/courses" <Route path="/courses"
render={ render={
(props) => (<CoursesHome {...this.props} {...props} {...this.state} />) (props) => (<CoursesHome {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*<Route exact path="/courses" component={CoursesHome} {...this.props} {...props} {...this.state} ></Route>*/} {/*<Route exact path="/courses" component={CoursesHome} {...this.props} {...props} {...this.state} ></Route>*/}
@ -919,4 +928,4 @@ class CoursesIndex extends Component{
} }
} }
export default ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) ))); export default withRouter(ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) ))));

@ -129,20 +129,21 @@ class CommonWorkDetailIndex extends Component{
}) })
} }
}else { }else {
this.props.showNotification(`正在下载中`); this.props.slowDownload(url)
this.setState({ donwloading: true }) // this.props.showNotification(`正在下载中`);
downloadFile({ // this.setState({ donwloading: true })
url: url, // downloadFile({
successCallback: (url) => { // url: url,
this.setState({ donwloading: false }) // successCallback: (url) => {
console.log('successCallback') // this.setState({ donwloading: false })
}, // console.log('successCallback')
failCallback: (responseHtml, url) => { // },
this.setState({ donwloading: false }) // failCallback: (responseHtml, url) => {
console.log('failCallback') // this.setState({ donwloading: false })
} // console.log('failCallback')
}) // }
// })
// window.open("/api"+url, '_blank'); // window.open("/api"+url, '_blank');
} }
}).catch((error) => { }).catch((error) => {

@ -81,11 +81,7 @@ class CommonWorkQuestion extends Component{
let category_id=this.props.match.params.category_id; let category_id=this.props.match.params.category_id;
let task_Id=this.props.match.params.task_Id; let task_Id=this.props.match.params.task_Id;
const isGroup = this.props.isGroup() const isGroup = this.props.isGroup()
/**
<React.Fragment>
<a className={"fr color-blue font-16"} href={exportResultUrl}>导出成绩</a>
</React.Fragment>
*/
return( return(
<React.Fragment> <React.Fragment>

@ -63,8 +63,9 @@ class TabRightComponents extends Component{
}) })
} }
}else { }else {
this.props.showNotification(`正在下载中`); this.props.slowDownload(url)
window.open("/api"+url, '_blank'); // this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)

@ -600,7 +600,7 @@ class studentsList extends Component{
font-size: 14px; font-size: 14px;
} }
.drop_down_menu { .drop_down_menu {
width: 93px; /*width: 93px;*/
} }
.drop_down_menu li { .drop_down_menu li {
width:100%; width:100%;

@ -1834,8 +1834,8 @@ class PollNew extends Component {
question_title: object.question.question_title, question_title: object.question.question_title,
question_type: number, question_type: number,
is_necessary: object.question.is_necessary, is_necessary: object.question.is_necessary,
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, max_choices: max_choicess===undefined||max_choicess===null||max_choicess===0||max_choicess==="0"?null:max_choicess,
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, min_choices: min_choicess===undefined||min_choicess===null||min_choicess===0||min_choicess==="0"?null:min_choicess,
question_answers: option, question_answers: option,
question_other_answer: null, question_other_answer: null,
insert_id: insert_id insert_id: insert_id
@ -1911,8 +1911,8 @@ class PollNew extends Component {
question_title: object.question.question_title, question_title: object.question.question_title,
question_type: number, question_type: number,
is_necessary: object.question.is_necessary, is_necessary: object.question.is_necessary,
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, max_choices: max_choicess===undefined||max_choicess===null||max_choicess===0||max_choicess==="0"?null:max_choicess,
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, min_choices: min_choicess===undefined||min_choicess===null||min_choicess===0||min_choicess==="0"?null:min_choicess,
question_answers: option, question_answers: option,
question_other_answer: null, question_other_answer: null,
}; };
@ -2775,7 +2775,7 @@ class PollNew extends Component {
<span <span
className="selectAnswer ml10">{item.question.is_necessary === 1 ? "必答" : item.question.question_type === 2 ? "选答" : "选答"}</span> className="selectAnswer ml10">{item.question.is_necessary === 1 ? "必答" : item.question.question_type === 2 ? "选答" : "选答"}</span>
<span style={{color: "#4B4B4B"}} <span style={{color: "#4B4B4B"}}
className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "" : item.question.min_choices === null && item.question.max_choices === null ? "" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "" : "可选" + item.question.min_choices + "-" + item.question.max_choices + "项")}</span> className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")}</span>
{ {
polls_status === undefined || polls_status === 1 ? polls_status === undefined || polls_status === 1 ?
<span className="fr"> <span className="fr">
@ -2963,7 +2963,7 @@ class PollNew extends Component {
<span <span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span> className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
<div className="mr40 flex1 "> <div className="mr40 flex1 ">
{/*可选最小*/} {/*可选最小1*/}
<style> <style>
{ {
` `
@ -2981,8 +2981,7 @@ class PollNew extends Component {
</style> </style>
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)}
value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices}
> >
<Option value={"0"}>--</Option> <Option value={"0"}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -2993,10 +2992,10 @@ class PollNew extends Component {
</Select> </Select>
<span <span
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span> className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/} {/*可选最大2*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
> >
<Option value={"0"}>--</Option> <Option value={"0"}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -3224,8 +3223,7 @@ class PollNew extends Component {
</style> </style>
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)}
value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -3239,7 +3237,7 @@ class PollNew extends Component {
{/*可选最大*/} {/*可选最大*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -3476,8 +3474,7 @@ class PollNew extends Component {
</style> </style>
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)}
value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -3491,7 +3488,7 @@ class PollNew extends Component {
{/*可选最大*/} {/*可选最大*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {

@ -584,7 +584,7 @@ class MessagSub extends Component{
` `
} }
</style> </style>
<p className="color-grey-6 break_word_firefox yslspansk markdown-body mt10" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}} ></p> <p className="color-grey-6 yslspansk markdown-body mt10" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}} ></p>
</div> </div>
<span className={item.new_tiding===true?"new-point fr mr40 mt22":""}></span> <span className={item.new_tiding===true?"new-point fr mr40 mt22":""}></span>

Loading…
Cancel
Save