|
|
|
@ -12,42 +12,138 @@ class Statistics extends Component{
|
|
|
|
|
nd1:60,
|
|
|
|
|
nd2:40,
|
|
|
|
|
nd3:20,
|
|
|
|
|
data:undefined
|
|
|
|
|
data:undefined,
|
|
|
|
|
bomdata:undefined,
|
|
|
|
|
topisSpin:true,
|
|
|
|
|
bomisSpin:true,
|
|
|
|
|
sort:'desc',
|
|
|
|
|
course_groups:[],
|
|
|
|
|
page:1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true,
|
|
|
|
|
})
|
|
|
|
|
let {page,group_ids,sort}=this.state;
|
|
|
|
|
let courseId=this.props.match.params.coursesId;
|
|
|
|
|
let url=`/courses/${courseId}/statistics.json`;
|
|
|
|
|
axios.get(url).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
this.setState({
|
|
|
|
|
data:result.data.top_scores
|
|
|
|
|
data:result.data.top_scores,
|
|
|
|
|
topisSpin:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpins:false,
|
|
|
|
|
topisSpin:false,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let courseurl=`/courses/${courseId}/all_course_groups.json`;
|
|
|
|
|
axios.get(courseurl).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
this.setState({
|
|
|
|
|
course_groups:result.data.course_groups
|
|
|
|
|
})
|
|
|
|
|
let list=result.data.course_groups;
|
|
|
|
|
if(list.length>0){
|
|
|
|
|
this.setState({
|
|
|
|
|
group_ids:[list[0].id],
|
|
|
|
|
})
|
|
|
|
|
this.getwork_scoredata(page,[list[0].id],sort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getwork_scoredata=(page,group_ids,sort)=>{
|
|
|
|
|
let courseId=this.props.match.params.coursesId;
|
|
|
|
|
let url=`/courses/${courseId}/work_score.json`;
|
|
|
|
|
let data={
|
|
|
|
|
limit:20,
|
|
|
|
|
page:page,
|
|
|
|
|
group_ids:group_ids,
|
|
|
|
|
sort:sort
|
|
|
|
|
}
|
|
|
|
|
axios.get(url,{params:
|
|
|
|
|
data
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
this.setState({
|
|
|
|
|
bomdata:result.data.course_members,
|
|
|
|
|
bomisSpin:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
this.setState({
|
|
|
|
|
bomisSpin:false,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
callback=(key)=>{
|
|
|
|
|
console.log(key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
let {nd1,nd2,nd3,data}=this.state;
|
|
|
|
|
let {nd1,nd2,nd3,data,bomdata,course_groups}=this.state;
|
|
|
|
|
let course_grouptype=false
|
|
|
|
|
if(this.props&&this.props.course_modules!=undefined){
|
|
|
|
|
{this.props&&this.props.course_modules.map((item,key)=>{
|
|
|
|
|
if(item.type==="course_group"){
|
|
|
|
|
course_grouptype=true
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// const columns = [
|
|
|
|
|
// {
|
|
|
|
|
// title: 'Name',
|
|
|
|
|
// dataIndex: 'name',
|
|
|
|
|
// sorter: true,
|
|
|
|
|
// render: name => `${name.first} ${name.last}`,
|
|
|
|
|
// width: '20%',
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// title: 'Gender',
|
|
|
|
|
// dataIndex: 'gender',
|
|
|
|
|
// filters: course_groups,
|
|
|
|
|
// width: '20%',
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// title: 'Email',
|
|
|
|
|
// dataIndex: 'email',
|
|
|
|
|
// },
|
|
|
|
|
// ];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(bomdata)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//common_score: 0
|
|
|
|
|
// course_group: "威风威风急急急"
|
|
|
|
|
// exercise_score: "0.0"
|
|
|
|
|
// graduation_score: 0
|
|
|
|
|
// group_score: 0
|
|
|
|
|
// practice_score: 3232
|
|
|
|
|
// total_score: 3232
|
|
|
|
|
// user_login: "p40793521"
|
|
|
|
|
// user_name: "李明霞"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<React.Fragment >
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
<div className="edu-back-white">
|
|
|
|
|
<Spin size="large" spinning={this.state.topisSpin}>
|
|
|
|
|
<p className="clearfix padding30">
|
|
|
|
|
<Row gutter={24}>
|
|
|
|
|
<Col>
|
|
|
|
@ -200,18 +296,26 @@ class Statistics extends Component{
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
</p>
|
|
|
|
|
</Spin>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="mt20 edu-back-white">
|
|
|
|
|
<Spin size="large" spinning={this.state.bomisSpin}>
|
|
|
|
|
<Tabs className="statisticsTabs" defaultActiveKey="1" onChange={this.callback}>
|
|
|
|
|
<TabPane tab="学习成绩" key="1" className={"statisticsTabs1"}>
|
|
|
|
|
Content of Tab Pane 1
|
|
|
|
|
{/*<Table*/}
|
|
|
|
|
{/*columns={columns}*/}
|
|
|
|
|
{/*dataSource={bomdata}*/}
|
|
|
|
|
{/*onChange={this.handleTableChange}*/}
|
|
|
|
|
{/*/>*/}
|
|
|
|
|
</TabPane>
|
|
|
|
|
<TabPane tab="课堂活跃度" key="2">
|
|
|
|
|
Content of Tab Pane 2
|
|
|
|
|
</TabPane>
|
|
|
|
|
</Tabs>
|
|
|
|
|
</Spin>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
)
|
|
|
|
|