diff --git a/public/react/src/modules/courses/statistics/Statistics.js b/public/react/src/modules/courses/statistics/Statistics.js
index 00a47a81d..21041a59c 100644
--- a/public/react/src/modules/courses/statistics/Statistics.js
+++ b/public/react/src/modules/courses/statistics/Statistics.js
@@ -99,7 +99,6 @@ class Statistics extends Component{
}
getwork_scoredata=(page,group_ids,sort,key)=>{
-
this.setState({
page:page,
sort:sort,
@@ -189,8 +188,45 @@ class Statistics extends Component{
}
+ //计算成绩
+ setComputeTimet = (homeworkid) => {
+ let url = `/courses/${homeworkid}/calculate_all_shixun_scores.json`;
+ try {
+ this.props.yslslowCheckresults();
+ } catch (e) {
+
+ }
+ axios.get(url).then((response) => {
+ if (response) {
+ if (response.data.status === 0) {
+ let{page,group_ids,sort}=this.state;
+ setTimeout(() => {
+ try {
+ this.props.showNotification(`${response.data.message}`);
+ } catch (e) {
+
+ }
+ try {
+ this.props.yslslowCheckresultsNo();
+ } catch (e) {
+
+ }
+ this.getwork_scoredata(page,group_ids,sort);
+ }, 2500);
+ }
+ }
+ }).catch((error) => {
+ try {
+ this.props.yslslowCheckresultsNo();
+ } catch (e) {
+
+ }
+ console.log(error)
+ });
+ };
+
render(){
- let {nd1,nd2,nd3,data,bomdata,course_members}=this.state;
+ let {nd1,nd2,nd3,data,bomdata,course_members,activeKey}=this.state;
const columns = [
{
@@ -360,12 +396,26 @@ class Statistics extends Component{
const operations =
- {course_grouptype===false||this.state.course_groups.length===0?"":this.getwork_scoredata(1,group_idss,'desc')}
- />}
+ {course_grouptype===false||this.state.course_groups.length===0?"":
+ this.state.activeKey==="1"?
+ this.getwork_scoredata(1,group_idss,'desc')
+ }
+ />
+ :""
+ }
+ {
+ this.state.activeKey==="1"?
+ this.setComputeTimet(this.props.match.params.coursesId)}>获取最新成绩
+ :""
+ }
+ {
+ this.state.activeKey==="1"?
this.derivefun(this.state.activeKey==="1"?`/courses/${this.props.match.params.coursesId}/export_member_scores_excel.xlsx`:`/courses/${this.props.match.params.coursesId}/export_member_act_score.xlsx`)}>导出
+ :""
+ }
;
return(