-
{item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}题
-
Q{item.ques_position}:
-
-
+
{item.ques_position+"."}{item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}题
+
+ {/*Q{item.ques_position}:*/}
+
+
+ {/*
*/}
+
正确率 {item.right_percent}%
diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js
index b9122abdc..2a04e1978 100644
--- a/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js
+++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js
@@ -1,181 +1,186 @@
-import React, {Component} from "react";
-import {WordsBtn} from 'educoder';
-import {Table} from "antd";
-import {Link,Switch,Route,Redirect} from 'react-router-dom';
-
-class OfficialAcademicTranscript extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
- loadingstate:true,
- datas:undefined
- }
- }
-
- componentDidMount() {
-
- }
-
- render() {
-
- let {data}=this.props;
- let datas=[];
- // data&&data.exercise_counts.forEach((item,key)=>{ })
-
- datas.push({
- commit_percent:data&&data.exercise_counts.commit_percent,
- min_score:data&&data.exercise_counts.min_score,
- max_score:data&&data.exercise_counts.max_score,
- average_score:data&&data.exercise_counts.average_score,
- fail_counts:data&&data.exercise_counts.fail_counts,
- pass_counts:data&&data.exercise_counts.pass_counts,
- good_counts:data&&data.exercise_counts.good_counts,
- best_counts:data&&data.exercise_counts.best_counts,
- })
-
-
-
- let columns=[{
- title: '提交率',
- dataIndex: 'commit_percent',
- key: 'commit_percent',
- render: (text, record) => (
-
- {record.commit_percent===0?0:(record.commit_percent*100).toFixed(2)}%
-
- ),
- }, {
- title: '最低分',
- dataIndex: 'min_score',
- key: 'min_score',
- render: (text, record) => (
-
- {record.min_score}分
-
- ),
- }, {
- title: '最高分',
- dataIndex: 'max_score',
- key: 'max_score',
- render: (text, record) => (
-
- {record.max_score}分
-
- ),
- }, {
- title: '平均分',
- key: 'average_score',
- dataIndex: 'average_score',
-
- render: (text, record) => (
-
- {record.average_score}分
-
- ),
- }, {
- title: '不及格(0-60)',
- key: 'fail_counts',
- dataIndex: 'fail_counts',
- render: (text, record) => (
-
- {record.fail_counts}人
-
- ),
- }, {
- title: '及格(60-70)',
- key: 'pass_counts',
- dataIndex: 'pass_counts',
-
- render: (text, record) => (
-
- {record.pass_counts}人
-
- ),
- }, {
- title: '良好(70-90)',
- key: 'good_counts',
- dataIndex: 'good_counts',
-
- render: (text, record) => (
-
- {record.good_counts}人
-
- ),
- }, {
- title: '优秀(90-100)',
- key: 'best_counts',
- dataIndex: 'best_counts',
-
- render: (text, record) => (
-
- {record.best_counts}人
-
- ),
- }];
- // {
- // title: '调分',
- // key: 'adjustmentminute',
- // dataIndex: 'adjustmentminute',
- //
- // render: (text, record) => (
- //
- // 6小时 50分钟 6秒
- //
- // ),
- // },
-
-
-
- return (
-
- {/*{data===undefined?"":""}*/}
-
- {datas===undefined?"":
}
-
-
- )
- }
-}
-
+import React, {Component} from "react";
+import {WordsBtn} from 'educoder';
+import {Table} from "antd";
+import {Link,Switch,Route,Redirect} from 'react-router-dom';
+
+class OfficialAcademicTranscript extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ loadingstate:true,
+ datas:undefined
+ }
+ }
+
+ componentDidMount() {
+
+ }
+
+ render() {
+
+ let {data}=this.props;
+ let datas=[];
+ // data&&data.exercise_counts.forEach((item,key)=>{ })
+
+ datas.push({
+ commit_percent:data&&data.exercise_counts.commit_percent,
+ min_score:data&&data.exercise_counts.min_score,
+ max_score:data&&data.exercise_counts.max_score,
+ average_score:data&&data.exercise_counts.average_score,
+ fail_counts:data&&data.exercise_counts.fail_counts,
+ pass_counts:data&&data.exercise_counts.pass_counts,
+ good_counts:data&&data.exercise_counts.good_counts,
+ best_counts:data&&data.exercise_counts.best_counts,
+ })
+
+
+
+ let columns=[{
+ title: '提交率',
+ dataIndex: 'commit_percent',
+ key: 'commit_percent',
+ render: (text, record) => (
+
+ {record.commit_percent===0?0:(record.commit_percent*100).toFixed(2)}%
+
+ ),
+ }, {
+ title: '最低分',
+ dataIndex: 'min_score',
+ key: 'min_score',
+ render: (text, record) => (
+
+ {record.min_score}分
+
+ ),
+ }, {
+ title: '最高分',
+ dataIndex: 'max_score',
+ key: 'max_score',
+ render: (text, record) => (
+
+ {record.max_score}分
+
+ ),
+ }, {
+ title: '平均分',
+ key: 'average_score',
+ dataIndex: 'average_score',
+
+ render: (text, record) => (
+
+ {record.average_score}分
+
+ ),
+ }, {
+ title: '不及格(0-60)',
+ key: 'fail_counts',
+ dataIndex: 'fail_counts',
+ render: (text, record) => (
+
+ {record.fail_counts}人
+
+ ),
+ }, {
+ title: '及格(60-70)',
+ key: 'pass_counts',
+ dataIndex: 'pass_counts',
+
+ render: (text, record) => (
+
+ {record.pass_counts}人
+
+ ),
+ }, {
+ title: '良好(70-90)',
+ key: 'good_counts',
+ dataIndex: 'good_counts',
+
+ render: (text, record) => (
+
+ {record.good_counts}人
+
+ ),
+ }, {
+ title: '优秀(90-100)',
+ key: 'best_counts',
+ dataIndex: 'best_counts',
+
+ render: (text, record) => (
+
+ {record.best_counts}人
+
+ ),
+ }];
+ // {
+ // title: '调分',
+ // key: 'adjustmentminute',
+ // dataIndex: 'adjustmentminute',
+ //
+ // render: (text, record) => (
+ //
+ // 6小时 50分钟 6秒
+ //
+ // ),
+ // },
+
+
+
+ return (
+
+ {/*{data===undefined?"":""}*/}
+
+ {datas===undefined?"":
}
+
+
+ )
+ }
+}
+
export default OfficialAcademicTranscript;
\ No newline at end of file
diff --git a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js
index d3c73baba..b2cd1a1a3 100644
--- a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js
+++ b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js
@@ -66,12 +66,16 @@ class Exercisetablesmubus extends Component {
width:'300px',
render: (text, record) => (
- {record.max_score===undefined?"":}
+ {record.max_score===undefined?"":
+ {record.max_score*100}%
}
),
}];
@@ -125,10 +129,14 @@ class Exercisetablesmubus extends Component {
}
.ant-table-tbody > tr > td:nth-child(1){
text-align: left;
+ }
+ .Exermubu .ant-table-tbody > tr:nth-last-child(1) > td{
+ border:1px solid transparent;
}
`}
{datas===undefined?"":
this.experiment(`/api/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}
- calssName="color-dark">学生成绩
- 空白试卷
- 学生成绩
+ 空白试卷
+ this.experiment(`/api/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)}
>学生答题试卷
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js
index 74bf9d868..a49d38212 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js
@@ -215,7 +215,7 @@ class GraduationTasksSubmitnew extends Component{
let {search} = this.state;
- this.searchList(search,1,10)
+ this.searchList(search,1,20)
}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
index 64539adbc..3c9202921 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
@@ -240,12 +240,12 @@ class GraduationTasksedit extends Component{
handleSubmit=(e)=>{
let {fileList}=this.state;
- if(fileList.length===0){
- this.setState({
- shixunsreplace:true,
- })
- return
- }
+ // if(fileList.length===0){
+ // this.setState({
+ // shixunsreplace:true,
+ // })
+ // return
+ // }
this.Commoninterface(fileList);
}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js
index 74ba21b62..e6185188a 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js
@@ -214,13 +214,13 @@ class GraduationTasksnew extends Component {
// 提交按钮
handleSubmit = (e) => {
let {fileList} = this.state;
- if(fileList.length===0){
- this.setState({
- shixunsreplace:true,
- })
-
- return
- }
+ // if(fileList.length===0){
+ // this.setState({
+ // shixunsreplace:true,
+ // })
+ //
+ // return
+ // }
this.Commoninterface(fileList);
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
index c2ec26282..b5c34e975 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
@@ -1056,13 +1056,16 @@ class GraduationTaskssettingapp extends Component{
padding-top: 10px;
padding-bottom: 8px;
}
+ .drop_down_menu li .color-dark{
+ color: #666 !important;
+ }
`}
{this.props.isAdmin()?
导出
:""}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
index 735279a38..1433319b3 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
@@ -701,7 +701,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => (
- {record.turnovertime===""?"--":moment(record.turnovertime).format('YYYY-MM-DD HH:mm:ss')}
+ {record.turnovertime===""?"--":moment(record.turnovertime).format('YYYY-MM-DD HH:mm')}
),
@@ -741,11 +741,11 @@ class GraduationTaskssettinglist extends Component{
className:'edu-txt-center',
render: (text, record) => (
-
+
{record.finalscore.final_score.username}({record.finalscore.final_score.login})
{record.finalscore.ultimate_score===true?"":"教师评分:"+record.finalscore.teacher_comment_score+"分"}
- {record.finalscore.cross_comment_score===undefined?"":"交叉评分:"+record.finalscore.cross_comment_score+"分"+
}
- {record.finalscore.late_penalty===undefined?"":"迟交扣分:"+record.finalscore.late_penalty+"分"+
}
+ {record.finalscore.cross_comment_score===undefined||record.finalscore.cross_comment_score==="未批阅"?"交叉评分:--":"交叉评分:"+record.finalscore.cross_comment_score+"分"}
+ {record.finalscore.late_penalty===undefined?"":"迟交扣分:"+record.finalscore.late_penalty+"分"}
最终成绩:{record.finalscore.work_score}分
}>
90?'#DD1717':parseInt(record.finalscore.work_score)>60&&parseInt(record.finalscore.work_score)<90?"#FF6800":'#747A7F'}}>{record.finalscore.work_score==="--"?"--":record.finalscore.work_score}
@@ -1010,13 +1010,16 @@ class GraduationTaskssettinglist extends Component{
padding-top: 10px;
padding-bottom: 8px;
}
+ .drop_down_menu li .color-dark{
+ color: #666 !important;
+ }
`}
{this.props.isAdmin()?
导出
:""}
@@ -1141,17 +1144,28 @@ class GraduationTaskssettinglist extends Component{
-
+
{this.props.isAdmin()===true?
{taskslistdata&&taskslistdata.work_count}
个检索结果({taskslistdata&&taskslistdata.work_count} 学生) :""}
{this.props.isAdmin()===true?
-
+
{order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序
-
+
- this.funorder("updated_at")}>更新时间
- this.funorder("work_score" )}>最终成绩
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
index f1a06808c..68934e521 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
@@ -303,13 +303,16 @@ class GraduationTasksquestions extends Component{
padding-top: 10px;
padding-bottom: 8px;
}
+ .drop_down_menu li .color-dark{
+ color: #666 !important;
+ }
`}
{this.props.isAdmin()?
-
导出
:""}
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js
index 04a878dc0..687351934 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworks.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js
@@ -60,6 +60,7 @@ class Listofworks extends Component {
this.state = {
props: props,
data: [],
+ b_order: "desc",
page: 1,
limit: 20,
loadingstate: true,
@@ -385,8 +386,8 @@ class Listofworks extends Component {
// course_group:分班情况 [232, 231], []:不限(空数组)
var data = {
search: "",
- order: "desc",
- b_order: "asc",
+ order: "update_time",
+ b_order: "desc",
work_status: "",
course_group: "",
page:1,
@@ -427,19 +428,26 @@ class Listofworks extends Component {
//order 排序时间
//debug=t 是老师的意思
// console.log(ordervlue)7009
+ let{b_order,order}=this.state;
var homeworkid = this.props.match.params.homeworkid;
let urll = `/homework_commons/${homeworkid}/works_list.json?`;
- var order = "asc";
- if (ordervlue === "updated_at") {
- order = "desc";
+ var b_orders
+ // = "asc";
+ // if (ordervlue === "updated_at") {
+ // b_orders = "desc";
+ // }
+ if(b_order==="asc"){
+ b_orders = "desc";
+ }else{
+ b_orders = "asc";
}
var checkedValuesines = checkedValuesine;
var checkedValuesineinfos = checkedValuesineinfo;
var searchtexts = searchtext
var data = {
search: searchtexts,
- order: ordervlue,
- b_order: order,
+ order: order,
+ b_order: b_orders,
work_status: checkedValuesines,
course_group: checkedValuesineinfos,
page: page,
@@ -1274,14 +1282,14 @@ class Listofworks extends Component {
}
//排序
funorder = (e) => {
- if (e === "updated_at") {
+ if (e === "update_time") {
// 时间
// 时间排序是从小到大
this.setState({
- order: "updated_at",
+ order: "update_time",
loadingstate: true,
})
- this.Startsorting("updated_at", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsorting("update_time", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
}
if (e === "work_score") {
@@ -1738,8 +1746,8 @@ class Listofworks extends Component {
{this.props.isAdmin()? -
导出
:""}
{this.props.isAdmin() ?
@@ -1840,10 +1848,10 @@ class Listofworks extends Component {
-
- {order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序
+ {order === "update_time”" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序
From d7b586fe9ef654b84da28645875e5b100f472803 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 29 Jun 2019 00:48:01 +0800
Subject: [PATCH 04/10] Merge remote-tracking branch 'origin/master'
# Conflicts:
# public/react/src/modules/courses/shixunHomework/Listofworks.js
---
.../courses/shixunHomework/Listofworks.js | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js
index 25f122cec..581906575 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworks.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js
@@ -63,7 +63,8 @@ class Listofworks extends Component {
page: 1,
limit: 20,
loadingstate: true,
- order: "updated_at",
+ order: "update_time",
+ b_order:"desc",
search: null,
task_status: [],
course_group_info: [],
@@ -678,10 +679,11 @@ class Listofworks extends Component {
//order 排序时间
//debug=t 是老师的意思
// console.log(ordervlue)7009
+
var homeworkid = this.props.match.params.homeworkid;
let urll = `/homework_commons/${homeworkid}/works_list.json?`;
var order = "asc";
- if (ordervlue === "updated_at") {
+ if (ordervlue === "update_time") {
order = "desc";
}
var checkedValuesines = checkedValuesine;
@@ -2031,14 +2033,14 @@ class Listofworks extends Component {
}
//排序
funorder = (e) => {
- if (e === "updated_at") {
+ if (e === "update_time") {
// 时间
// 时间排序是从小到大
this.setState({
- order: "updated_at",
+ order: "update_time",
loadingstate: true,
})
- this.Startsorting("updated_at", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsorting("update_time", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
}
if (e === "work_score") {
@@ -2597,10 +2599,10 @@ class Listofworks extends Component {
-
- {order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序
+ {order === "update_time" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序
From 7b764d9a19ac37a936121adf5c489e677005747d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 29 Jun 2019 01:09:08 +0800
Subject: [PATCH 05/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Shixunworkdetails/ShixunWorkModal.js | 56 ++++++++++++-------
1 file changed, 35 insertions(+), 21 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
index 0885c155e..a1dd68ad0 100644
--- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
+++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
@@ -28,15 +28,13 @@ class ShixunWorkModal extends Component{
group_list:undefined
})
}else{
- let newgroup_list=group_list;
+ const newgroup_list=[];
response.data.group_list.map((item,key)=>{
newgroup_list.push(item)
- console.log(item);
})
- response.data.ungroup_list.map((items,keys)=>{
- newgroup_list.push(item)
- console.log(item);
- })
+ if( response.data.ungroup_list!== undefined || response.data.ungroup_list !== null){
+ newgroup_list.push(response.data.ungroup_list)
+ }
this.setState({
course_groups:response.data,
group_list:newgroup_list,
@@ -81,17 +79,33 @@ class ShixunWorkModal extends Component{
page:newpage,
}
}).then((response) => {
- response.data.group_list&&response.data.group_list.map((item,key)=>{
- newgroup_list.push(item)
- })
- response.data.ungroup_list&&response.data.ungroup_list.map((items,keys)=>{
- newgroup_list.push(items)
- })
- this.setState({
- course_groups:response.data,
- group_list:newgroup_list,
- page:newpage
- })
+ if(response!==null || response!==undefined){
+ if(response.data.group_list.length>0){
+ console.log("84");
+ response.data.group_list.map((item,key)=>{
+ newgroup_list.push(item);
+ this.setState({
+ course_groups:response.data,
+ group_list:newgroup_list,
+ page:newpage
+ })
+ })
+ }
+
+ if(response.data.ungroup_list===undefined || response.data.ungroup_list === null) {
+
+ }else {
+ console.log("95");
+ console.log(response.data.ungroup_list);
+ newgroup_list.push(response.data.ungroup_list);
+ this.setState({
+ course_groups:response.data,
+ group_list:newgroup_list,
+ page:newpage
+ })
+ }
+
+ }
}).catch((error) => {
console.log(error)
});
@@ -257,17 +271,17 @@ class ShixunWorkModal extends Component{
+ className="task-hide color-grey-name" title="frerere">{item===undefined?"":item.name}
-
- {item.works_count}
+ {item===undefined?"":item.works_count}
-
- {item.last_review_time}
+ {item===undefined?"":item.last_review_time}
)
From c4fd0316d4e94ac8f1c6b71c0783c7cac7a0b688 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 29 Jun 2019 09:13:11 +0800
Subject: [PATCH 06/10] Merge remote-tracking branch 'origin/master'
# Conflicts:
# public/react/src/modules/courses/shixunHomework/Listofworks.js
---
.../coursesPublic/modal/CheckCodeModal.js | 471 +++++++++---------
1 file changed, 236 insertions(+), 235 deletions(-)
diff --git a/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js b/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js
index cfc6d1245..e2aa2ab00 100644
--- a/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js
+++ b/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js
@@ -1,235 +1,236 @@
-import React, { Component } from "react";
-import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd";
-import axios from 'axios'
-import ModalWrapper from "../../common/ModalWrapper"
-import InfiniteScroll from 'react-infinite-scroller';
-import { ConditionToolTip } from 'educoder'
-const Option = Select.Option;
-const pageCount = 15;
-
-// 代码查重弹框
-class CheckCodeModal extends Component{
- constructor(props){
- super(props);
- this.state={
- checkBoxValues: [],
- candidates: [],
- hasMore: true,
- loading: false,
- page: 1
- }
- }
- fetchMemberList = (arg_page) => {
- const courseId = this.props.match.params.coursesId
- const page = arg_page || this.state.page;
- const { name, school_name } = this.state
- let url = `/courses/${courseId}/search_teacher_candidate.json`
- this.setState({ loading: true })
- axios.post(url, {
- page: page,
- limit: pageCount,
- school_name: school_name || '',
- name: name || ''
- })
- .then((response) => {
- if (!response.data.candidates || response.data.candidates.length == 0) {
- this.setState({
- page,
- loading: false,
- hasMore: false,
- })
- } else {
- this.setState({
- candidates: page == 1 ? response.data.candidates : this.state.candidates.concat(response.data.candidates),
- page,
- loading: false,
- hasMore: response.data.candidates.length == pageCount
- })
- }
-
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- componentDidMount() {
-
-
- }
- fetchOptions = () => {
- // add_teacher_popup
- const courseId = this.props.match.params.coursesId
-
- let url = `/courses/${courseId}/add_teacher_popup.json`
-
- axios.get(url, {
- })
- .then((response) => {
- if (response.data.graduation_groups) {
- this.setState({
- graduation_groups: response.data.graduation_groups
- })
- }
- if (response.data.course_groups) {
- this.setState({
- course_groups: response.data.course_groups
- })
- }
-
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- setVisible = (visible) => {
- if (visible) {
- this.fetchMemberList()
- this.fetchOptions()
- }
- this.refs.modalWrapper.setVisible(visible)
- if (visible == false) {
- this.setState({
- checkBoxValues: []
- })
- }
- }
-
- onSendOk = () => {
- const courseId = this.props.match.params.coursesId
- const url = `/courses/${courseId}/add_teacher.json`
- const params = {
- "user_list": this.state.checkBoxValues.map (item => { return { 'user_id': item }}) ,
- "graduation_group_id": "2",
- "course_group_id": "820",
- // "role": ROLE_TEACHER_NUM
- }
- const { graduationGroup, courseGroup } = this.state
- if (graduationGroup) {
- params.graduation_group_id = graduationGroup
- }
- if (courseGroup) {
- params.course_group_id = courseGroup
- }
- axios.post(url, params)
- .then((response) => {
- if (response.data.status == 0) {
- this.setVisible(false)
- this.props.showNotification('添加成功')
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- }
-
- onOk = () => {
- this.onSendOk()
- }
-
- onCheckBoxChange = (checkBoxValues) => {
- this.setState({
- checkBoxValues: checkBoxValues
- })
- }
-
- handleInfiniteOnLoad = () => {
- this.fetchMemberList(this.state.page + 1)
- }
-
- onSearch = () => {
- this.fetchMemberList(1)
- }
- handleGradationGroupChange = (value) => {
- this.setState({
- graduationGroup: value
- })
- }
- handleCourseGroupChange = (value) => {
- this.setState({
- courseGroup: value
- })
- }
- render(){
- const { candidates, checkBoxValues, loading, hasMore, name, school_name
- , graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
- const { moduleName } = this.props
- return(
-
-
-
-
-
-
-
-
-
-
-
- {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
-
-
-
- { candidates && candidates.map( candidate => {
- return (
-
-
-
- 12 }>
-
-
-
-
- 12 }>
-
-
-
-
-
-
- )
- }) }
-
-
-
-
-
- )
- }
-}
-export default CheckCodeModal;
+import React, { Component } from "react";
+import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd";
+import axios from 'axios'
+import ModalWrapper from "../../common/ModalWrapper"
+import InfiniteScroll from 'react-infinite-scroller';
+import { ConditionToolTip } from 'educoder'
+const Option = Select.Option;
+const pageCount = 15;
+
+// 代码查重弹框
+class CheckCodeModal extends Component{
+ constructor(props){
+ super(props);
+ this.state={
+ checkBoxValues: [],
+ candidates: [],
+ hasMore: true,
+ loading: false,
+ page: 1
+ }
+ }
+ fetchMemberList = (arg_page) => {
+ const courseId = this.props.match.params.coursesId
+ const page = arg_page || this.state.page;
+ const { name, school_name } = this.state
+ let url = `/courses/${courseId}/search_teacher_candidate.json`
+ this.setState({ loading: true })
+ axios.post(url, {
+ page: page,
+ limit: pageCount,
+ school_name: school_name || '',
+ name: name || ''
+ })
+ .then((response) => {
+ if (!response.data.candidates || response.data.candidates.length == 0) {
+ this.setState({
+ page,
+ loading: false,
+ hasMore: false,
+ })
+ } else {
+ this.setState({
+ candidates: page == 1 ? response.data.candidates : this.state.candidates.concat(response.data.candidates),
+ page,
+ loading: false,
+ hasMore: response.data.candidates.length == pageCount
+ })
+ }
+
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+ }
+ componentDidMount() {
+
+
+ }
+ fetchOptions = () => {
+ // add_teacher_popup
+ const courseId = this.props.match.params.coursesId
+
+ let url = `/courses/${courseId}/add_teacher_popup.json`
+
+ axios.get(url, {
+ })
+ .then((response) => {
+ if (response.data.graduation_groups) {
+ this.setState({
+ graduation_groups: response.data.graduation_groups
+ })
+ }
+ if (response.data.course_groups) {
+ this.setState({
+ course_groups: response.data.course_groups
+ })
+ }
+
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+ }
+ setVisible = (visible) => {
+ if (visible) {
+ this.fetchMemberList()
+ this.fetchOptions()
+ }
+ this.refs.modalWrapper.setVisible(visible)
+ if (visible == false) {
+ this.setState({
+ checkBoxValues: []
+ })
+ }
+ }
+
+ onSendOk = () => {
+ const courseId = this.props.match.params.coursesId
+ const url = `/courses/${courseId}/add_teacher.json`
+ const params = {
+ "user_list": this.state.checkBoxValues.map (item => { return { 'user_id': item }}) ,
+ "graduation_group_id": "2",
+ "course_group_id": "820",
+ // "role": ROLE_TEACHER_NUM
+ }
+ const { graduationGroup, courseGroup } = this.state
+ if (graduationGroup) {
+ params.graduation_group_id = graduationGroup
+ }
+ if (courseGroup) {
+ params.course_group_id = courseGroup
+ }
+ axios.post(url, params)
+ .then((response) => {
+ if (response.data.status == 0) {
+ this.setVisible(false)
+ this.props.showNotification('添加成功')
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+ }
+
+ onOk = () => {
+ this.onSendOk()
+ }
+
+ onCheckBoxChange = (checkBoxValues) => {
+ this.setState({
+ checkBoxValues: checkBoxValues
+ })
+ }
+
+ handleInfiniteOnLoad = () => {
+ this.fetchMemberList(this.state.page + 1)
+ }
+
+ onSearch = () => {
+ this.fetchMemberList(1)
+ }
+ handleGradationGroupChange = (value) => {
+ this.setState({
+ graduationGroup: value
+ })
+ }
+ handleCourseGroupChange = (value) => {
+ this.setState({
+ courseGroup: value
+ })
+ }
+ render(){
+ const { candidates, checkBoxValues, loading, hasMore, name, school_name
+ , graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
+ const { moduleName } = this.props
+ return(
+
+
+
+
+
+
+
+
+
+
+
+ {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
+
+
+
+ { candidates && candidates.map( candidate => {
+ console.log(candidates)
+ return (
+
+
+
+ 12 }>
+
+
+
+
+ 12 }>
+
+
+
+
+
+
+ )
+ }) }
+
+
+
+
+
+ )
+ }
+}
+export default CheckCodeModal;
From 3947693473479b4b7918be3fbcf148edb8cd2969 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 29 Jun 2019 09:20:58 +0800
Subject: [PATCH 07/10] Merge remote-tracking branch 'origin/master'
# Conflicts:
# public/react/src/modules/courses/shixunHomework/Listofworks.js
---
.../src/modules/courses/coursesPublic/modal/CheckCodeModal.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js b/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js
index e2aa2ab00..d38c0a515 100644
--- a/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js
+++ b/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js
@@ -206,7 +206,6 @@ class CheckCodeModal extends Component{
{ candidates && candidates.map( candidate => {
- console.log(candidates)
return (
From b2c9c8f5f734b61605883e97abbe36aa1043cc3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 29 Jun 2019 09:21:51 +0800
Subject: [PATCH 08/10] Merge remote-tracking branch 'origin/master'
# Conflicts:
# public/react/src/modules/courses/shixunHomework/Listofworks.js
---
.../shixunHomework/Shixunworkdetails/ShixunWorkModal.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
index a1dd68ad0..55f44d971 100644
--- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
+++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
@@ -154,10 +154,10 @@ class ShixunWorkModal extends Component{
this.props.showNotification(`请先选择分班`);
return
}
- if(group_ids&&group_ids.length < 2){
- this.props.showNotification(`有效作品数少于2个,无法查重`);
- return
- }
+ // if(group_ids&&group_ids.length < 2){
+ // this.props.showNotification(`有效作品数少于2个,无法查重`);
+ // return
+ // }
let url="/homework_commons/"+this.props.match.params.homeworkid+"/homework_code_repeat.json";
axios.post(url, {
From 19a1a13dfd098264815efc5f9fdb676e754a6fc5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 29 Jun 2019 09:22:25 +0800
Subject: [PATCH 09/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/courses/shixunHomework/Listofworks.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js
index 581906575..2fcc21cca 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworks.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js
@@ -1933,14 +1933,14 @@ class Listofworks extends Component {
loadingstate: true,
})
- this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, null, this.state.limit);
} else if (checkedValues.length === data.length) {
this.setState({
unlimited: 0,
course_groupyslstwo: [],
loadingstate: true,
})
- this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, null, this.state.limit);
} else {
// console.log(checkedValues);
this.setState({
@@ -1948,7 +1948,7 @@ class Listofworks extends Component {
unlimited: 1,
loadingstate: true
})
- this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, null, this.state.limit);
}
@@ -1965,9 +1965,9 @@ class Listofworks extends Component {
course_groupysls: undefined,
checkedValuesineinfo:[],
loadingstate: true,
-
+ page: 1,
})
- this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit);
} else if (checkedValues.length === data.length) {
this.setState({
unlimitedtwo: 1,
@@ -1975,7 +1975,7 @@ class Listofworks extends Component {
checkedValuesineinfo:[],
loadingstate: true,
})
- this.Startsorting(this.state.order, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsorting(this.state.order, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit);
} else {
this.setState({
checkedValuesineinfo: checkedValues,
@@ -1983,7 +1983,7 @@ class Listofworks extends Component {
unlimitedtwo: 0,
loadingstate: true,
})
- this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit);
}
From e5e2e2d4261b6720190a333de62d45a8d6b2a05b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 29 Jun 2019 09:37:24 +0800
Subject: [PATCH 10/10] Merge remote-tracking branch 'origin/master'
# Conflicts:
# public/react/src/modules/courses/shixunHomework/Listofworks.js
---
.../Shixunworkdetails/ShixunWorkModal.js | 39 +++++++++++++------
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
index 55f44d971..572bc5715 100644
--- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
+++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
@@ -21,7 +21,6 @@ class ShixunWorkModal extends Component{
page:1,
}
}).then((response) => {
- console.log(response);
if(response.data.group_list===undefined){
this.setState({
course_groups:response.data,
@@ -50,19 +49,35 @@ class ShixunWorkModal extends Component{
//勾选实训
shixunhomeworkedit=(checkedValues)=>{
+ let types=false
let{group_list}=this.state;
+ group_list.map((item,key)=>{
+ checkedValues.map((list,li)=>{
+ if(item.id===list){
+ if(item.works_count<2){
+ this.props.showNotification(`有效作品数少于2个,无法查重`)
+ types=true
+ return
+ }
+ }
+ })
+
+ })
+
+ if(types===false){
+ if(checkedValues.length===group_list.length){
+ this.setState({
+ onChangetype:true,
+ group_ids:checkedValues
+ })
+ }else{
+ this.setState({
+ group_ids:checkedValues,
+ onChangetype:false
+ })
+ }
+ }
- if(checkedValues.length===group_list.length){
- this.setState({
- onChangetype:true,
- group_ids:checkedValues
- })
- }else{
- this.setState({
- group_ids:checkedValues,
- onChangetype:false
- })
- }
}
contentViewScroll=(e)=>{