|
|
@ -75,10 +75,11 @@ class Exercisesetting extends Component{
|
|
|
|
limit:10,
|
|
|
|
limit:10,
|
|
|
|
searchtext:"",
|
|
|
|
searchtext:"",
|
|
|
|
order: "end_at",
|
|
|
|
order: "end_at",
|
|
|
|
|
|
|
|
assistant_auth:false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log("Exercisesetting");
|
|
|
|
// console.log("Exercisesetting");
|
|
|
|
console.log("69");
|
|
|
|
// console.log("69");
|
|
|
|
console.log(props);
|
|
|
|
// console.log(props);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_getRequestParams() {
|
|
|
|
_getRequestParams() {
|
|
|
|
const { order, exercise_group_id,searchtext, page ,limit} = this.state
|
|
|
|
const { order, exercise_group_id,searchtext, page ,limit} = this.state
|
|
|
@ -92,6 +93,10 @@ class Exercisesetting extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//加载
|
|
|
|
//加载
|
|
|
|
componentDidMount=()=>{
|
|
|
|
componentDidMount=()=>{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
assistant_auth:this.props.assistant_auth,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
this.getSettingInfo();
|
|
|
|
this.getSettingInfo();
|
|
|
|
|
|
|
|
|
|
|
|
// window.addEventListener('click', this.handleClick);
|
|
|
|
// window.addEventListener('click', this.handleClick);
|
|
|
@ -113,6 +118,11 @@ class Exercisesetting extends Component{
|
|
|
|
if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){
|
|
|
|
if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){
|
|
|
|
this.editSetting()
|
|
|
|
this.editSetting()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(prevProps.assistant_auth!= this.props.assistant_auth){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
assistant_auth:this.props.assistant_auth,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_getRequestParams() {
|
|
|
|
_getRequestParams() {
|
|
|
@ -348,10 +358,16 @@ class Exercisesetting extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
this.commitSetting((result)=>{
|
|
|
|
this.commitSetting((result)=>{
|
|
|
|
console.log(result)
|
|
|
|
console.log(result)
|
|
|
|
if(result.status==200){
|
|
|
|
if(result.status===200){
|
|
|
|
this.props.showNotification(`${result.data.message}`);
|
|
|
|
this.props.showNotification(`${result.data.message}`);
|
|
|
|
this.getSettingInfo(1);
|
|
|
|
this.getSettingInfo(1);
|
|
|
|
this.cancelEdit();
|
|
|
|
this.cancelEdit();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
this.props.assistantauthoritys(this.state.assistant_auth);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -371,6 +387,12 @@ class Exercisesetting extends Component{
|
|
|
|
this.props.showNotification(`${result.data.message}`);
|
|
|
|
this.props.showNotification(`${result.data.message}`);
|
|
|
|
this.cancelEdit();
|
|
|
|
this.cancelEdit();
|
|
|
|
this.getSettingInfo(1);
|
|
|
|
this.getSettingInfo(1);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
this.props.assistantauthoritys(this.state.assistant_auth);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -386,11 +408,12 @@ class Exercisesetting extends Component{
|
|
|
|
publish_time:this.state.publish_time,
|
|
|
|
publish_time:this.state.publish_time,
|
|
|
|
end_time:this.state.end_time,
|
|
|
|
end_time:this.state.end_time,
|
|
|
|
show_statistic:this.state.show_statistic,
|
|
|
|
show_statistic:this.state.show_statistic,
|
|
|
|
choice_random:this.state.choice_random,
|
|
|
|
choice_random:this.state.choice_random,
|
|
|
|
score_open:this.state.score_open,
|
|
|
|
score_open:this.state.score_open,
|
|
|
|
answer_open:this.state.answer_open,
|
|
|
|
answer_open:this.state.answer_open,
|
|
|
|
question_random:this.state.question_random,
|
|
|
|
question_random:this.state.question_random,
|
|
|
|
time:this.state.time,
|
|
|
|
time:this.state.time,
|
|
|
|
|
|
|
|
assistant_auth:this.state.assistant_auth,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
let list=this.state.rules;
|
|
|
|
let list=this.state.rules;
|
|
|
@ -403,7 +426,6 @@ class Exercisesetting extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lists.push(newlist)
|
|
|
|
lists.push(newlist)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
params={
|
|
|
|
params={
|
|
|
|
unified_setting:this.state.unified_setting,
|
|
|
|
unified_setting:this.state.unified_setting,
|
|
|
|
show_statistic:this.state.show_statistic,
|
|
|
|
show_statistic:this.state.show_statistic,
|
|
|
@ -413,6 +435,7 @@ class Exercisesetting extends Component{
|
|
|
|
answer_open:this.state.answer_open,
|
|
|
|
answer_open:this.state.answer_open,
|
|
|
|
publish_time_groups:lists,
|
|
|
|
publish_time_groups:lists,
|
|
|
|
time:this.state.time,
|
|
|
|
time:this.state.time,
|
|
|
|
|
|
|
|
assistant_auth:this.state.assistant_auth,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
axios.post((url),params).then((result)=>{
|
|
|
|
axios.post((url),params).then((result)=>{
|
|
|
@ -491,6 +514,12 @@ class Exercisesetting extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assistantauthority=(e)=>{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
assistant_auth:e.target.checked
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onChangeTimepublish=(date, dateString)=>{
|
|
|
|
onChangeTimepublish=(date, dateString)=>{
|
|
|
|
if(date===null){
|
|
|
|
if(date===null){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -608,7 +637,9 @@ class Exercisesetting extends Component{
|
|
|
|
// console.log("asdasdasda");
|
|
|
|
// console.log("asdasdasda");
|
|
|
|
// console.log(this.props);
|
|
|
|
// console.log(this.props);
|
|
|
|
// console.log(this.props.Commonheadofthetestpaper);
|
|
|
|
// console.log(this.props.Commonheadofthetestpaper);
|
|
|
|
return(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<Modals
|
|
|
|
<Modals
|
|
|
|
modalsType={modalsType}
|
|
|
|
modalsType={modalsType}
|
|
|
@ -769,7 +800,7 @@ class Exercisesetting extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="padding20-30">
|
|
|
|
<div className="padding20-30">
|
|
|
|
<p className="mb30 clearfix font-16">公开设置</p>
|
|
|
|
<p className="mb30 clearfix font-16">属性设置</p>
|
|
|
|
<div className="pl33">
|
|
|
|
<div className="pl33">
|
|
|
|
<p className="mb20">
|
|
|
|
<p className="mb20">
|
|
|
|
|
|
|
|
|
|
|
@ -790,7 +821,7 @@ class Exercisesetting extends Component{
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
<span className="color-grey-c">(选中,则在试卷截止时间之后,已提交答题的学生可以查看试卷题目的答案,否则不能查看)</span>
|
|
|
|
<span className="color-grey-c">(选中,则在试卷截止时间之后,已提交答题的学生可以查看试卷题目的答案,否则不能查看)</span>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
<p className="clearfix mb5">
|
|
|
|
<p className="clearfix mb20">
|
|
|
|
<Form.Item className="fl pollForm">
|
|
|
|
<Form.Item className="fl pollForm">
|
|
|
|
{getFieldDecorator('show_statistic')
|
|
|
|
{getFieldDecorator('show_statistic')
|
|
|
|
(
|
|
|
|
(
|
|
|
@ -799,6 +830,15 @@ class Exercisesetting extends Component{
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
<span className="color-grey-c">(选中,则在试卷截止时间之后,已提交答题的学生可以查看答题统计,否则不能查看)</span>
|
|
|
|
<span className="color-grey-c">(选中,则在试卷截止时间之后,已提交答题的学生可以查看答题统计,否则不能查看)</span>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p className="clearfix mb5">
|
|
|
|
|
|
|
|
<Form.Item className="fl pollForm">
|
|
|
|
|
|
|
|
{getFieldDecorator('assistantauthority')
|
|
|
|
|
|
|
|
(
|
|
|
|
|
|
|
|
<Checkbox disabled={this.props.isAdmin()===true?!flagPageEdit:true} className="mr15 font-16 color-grey-6" checked={this.state.assistant_auth} onChange={this.assistantauthority}>助教权限</Checkbox>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
<span className="color-grey-c">(勾选则允许助教查看答案)</span>
|
|
|
|
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
@ -820,70 +860,3 @@ const WrappedExercisesetting = Form.create({ name: 'exercisesetting' })(Exercise
|
|
|
|
export default WrappedExercisesetting;
|
|
|
|
export default WrappedExercisesetting;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //提交form表单
|
|
|
|
|
|
|
|
// handleSubmit = (e) => {
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// let{unified_setting,answer_open}=this.state;
|
|
|
|
|
|
|
|
// e.preventDefault();
|
|
|
|
|
|
|
|
// let exercise_id=this.props.match.params.Id;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// this.props.form.validateFieldsAndScroll((err, values) => {
|
|
|
|
|
|
|
|
// debugger
|
|
|
|
|
|
|
|
// if(!err){
|
|
|
|
|
|
|
|
// // 第一次进行问卷设置或者勾选了统一设置
|
|
|
|
|
|
|
|
// if(unified_setting==true){
|
|
|
|
|
|
|
|
// if(this.state.p_flag == false && this.state.e_flag == true){
|
|
|
|
|
|
|
|
// // 选择了发布时间但截至时间没有选择
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// modalsType:true,
|
|
|
|
|
|
|
|
// modalsTopval:"请选择截止时间",
|
|
|
|
|
|
|
|
// loadtype:true,
|
|
|
|
|
|
|
|
// modalSave:this.cancelBox
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }else if(this.state.p_flag == true && this.state.e_flag == true){
|
|
|
|
|
|
|
|
// // 如果两个时间都没有填写则弹出立即发布弹框
|
|
|
|
|
|
|
|
// let{publish_time,end_time}=this.state
|
|
|
|
|
|
|
|
// if(publish_time==undefined && end_time ==undefined){
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// // 否则就是选择的时间错误
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// modalsType:true,
|
|
|
|
|
|
|
|
// modalsTopval:"请选择正确的发布时间和截止时间",
|
|
|
|
|
|
|
|
// loadtype:true,
|
|
|
|
|
|
|
|
// modalSave:this.cancelBox
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// let url=`/exercises/${exercise_id}/commit_setting.json`;
|
|
|
|
|
|
|
|
// let params=[];
|
|
|
|
|
|
|
|
// if(values.unitSet){
|
|
|
|
|
|
|
|
// params={
|
|
|
|
|
|
|
|
// unified_setting:values.unitSet,
|
|
|
|
|
|
|
|
// publish_time:this.state.publish_time,
|
|
|
|
|
|
|
|
// end_time:this.state.end_time,
|
|
|
|
|
|
|
|
// show_result:values.public,
|
|
|
|
|
|
|
|
// un_anonymous:values.real
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// params={
|
|
|
|
|
|
|
|
// unified_setting:values.unitSet,
|
|
|
|
|
|
|
|
// show_result:values.public,
|
|
|
|
|
|
|
|
// un_anonymous:values.real,
|
|
|
|
|
|
|
|
// publish_time_groups:this.state.rules
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// axios.post((url),{params}).then((result)=>{
|
|
|
|
|
|
|
|
// if(result.status==200){
|
|
|
|
|
|
|
|
// this.props.showNotification(`${result.data.message}`);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }).catch((error)=>{
|
|
|
|
|
|
|
|
// console.log(error);
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|