Merge branch 'ysm1' of https://bdgit.educoder.net/Hjqreturn/educoder into ysmCompetitions

competitions
杨树明 5 years ago
commit 21eb8a19b5

@ -881,7 +881,7 @@ class GamesController < ApplicationController
end end
# actual_output为空表示暂时没有评测答题不允许查看 # actual_output为空表示暂时没有评测答题不允许查看
actual_output = output.try(:actual_output).try(:strip) actual_output = output.try(:actual_output).try(:strip)
has_answer << choose.answer if choose.answer.present? #has_answer << choose.answer if choose.answer.present?
# 标准答案处理,错误的不让用户查看,用-1替代 # 标准答案处理,错误的不让用户查看,用-1替代
standard_answer = (actual_output.blank? || !output.try(:result)) ? -1 : choose.standard_answer standard_answer = (actual_output.blank? || !output.try(:result)) ? -1 : choose.standard_answer
result = output.try(:result) result = output.try(:result)
@ -892,7 +892,7 @@ class GamesController < ApplicationController
@chooses << sin_choose @chooses << sin_choose
test_sets << sin_test_set test_sets << sin_test_set
end end
@has_answer = has_answer.presence @has_answer = true # 选择题永远都有答案
@choose_test_cases = {:had_submmit => had_submmit, :challenge_chooses_count => challenge_chooses_count, @choose_test_cases = {:had_submmit => had_submmit, :challenge_chooses_count => challenge_chooses_count,
:choose_correct_num => choose_correct_num, :test_sets => test_sets} :choose_correct_num => choose_correct_num, :test_sets => test_sets}
end end

@ -4,13 +4,8 @@ import {Link} from 'react-router-dom';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import Loading from '../../../Loading'; import Loading from '../../../Loading';
import { CNotificationHOC } from '../common/CNotificationHOC'
import { RouteHOC } from './common'
import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn, MarkdownToHtml, trigger, queryString, downloadFile } from 'educoder'; import { WordsBtn, MarkdownToHtml, trigger, queryString, downloadFile } from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import AccessoryModal from "../coursesPublic/AccessoryModal"; import AccessoryModal from "../coursesPublic/AccessoryModal";
import PublishRightnow from './PublishRightnow' import PublishRightnow from './PublishRightnow'

@ -1,7 +1,8 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Input,Checkbox,Menu,Pagination } from "antd"; import { Input,Checkbox,Menu,Pagination } from "antd";
import HomeworkModal from '../coursesPublic/HomeworkModal' import HomeworkModal from '../coursesPublic/HomeworkModal';
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import axios from 'axios' import axios from 'axios'
import moment from 'moment' import moment from 'moment'
import { getNextHalfHourOfMoment } from 'educoder' import { getNextHalfHourOfMoment } from 'educoder'
@ -51,7 +52,8 @@ class PublishRightnow extends Component{
this.setState({ this.setState({
modalname: isPublish ? "立即发布" : "立即截止", modalname: isPublish ? "立即发布" : "立即截止",
modaltype:1, modaltype:1,
visible:true, visible:isPublish?false:true,
OneSelftype:isPublish?true:false,
Topval: isPublish ? "学生将立即收到作业" : "学生将不能再提交作品", Topval: isPublish ? "学生将立即收到作业" : "学生将不能再提交作品",
// Botvalleft: isPublish ? "暂不发布" : "暂不截止", // Botvalleft: isPublish ? "暂不发布" : "暂不截止",
Botval: this.props.fromListPage ? (isPublish ? "本操作只对“未发布”的分班有效" : "本操作只对“提交中”的分班有效") : '', Botval: this.props.fromListPage ? (isPublish ? "本操作只对“未发布”的分班有效" : "本操作只对“提交中”的分班有效") : '',
@ -70,6 +72,7 @@ class PublishRightnow extends Component{
modalname:undefined, modalname:undefined,
modaltype:undefined, modaltype:undefined,
visible:false, visible:false,
OneSelftype:false,
Topval:undefined, Topval:undefined,
Topvalright:undefined, Topvalright:undefined,
Botvalleft:undefined, Botvalleft:undefined,
@ -107,17 +110,27 @@ class PublishRightnow extends Component{
return; return;
} }
let data={}
if(arg_group_ids.length===0){
data = {
homework_ids: this.props.checkBoxValues,
end_time: endtime==="Invalid date"?undefined:endtime,
}
}else{
data={
homework_ids: this.props.checkBoxValues,
group_ids: group_ids,
group_end_times:endtime,
detail:true
}
}
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
const url = `/courses/${coursesId}/homework_commons/${isPublish ? "publish_homework" : "end_homework"}.json` const url = `/courses/${coursesId}/homework_commons/${isPublish ? "publish_homework" : "end_homework"}.json`
axios.post(url, { axios.post(url, data)
group_ids,
homework_ids: this.props.checkBoxValues,
all_check: 0,
end_time:endtime==="Invalid date"?undefined:endtime
})
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.homeworkhide()
this.props.showNotification(isPublish ? "立即发布成功" : "立即截止成功") this.props.showNotification(isPublish ? "立即发布成功" : "立即截止成功")
this.props.doWhenSuccess && this.props.doWhenSuccess() this.props.doWhenSuccess && this.props.doWhenSuccess()
this.setState({ visible : false }) this.setState({ visible : false })
@ -153,6 +166,7 @@ class PublishRightnow extends Component{
this.showDialog() this.showDialog()
this.setState({ this.setState({
course_groups: response.data.course_groups, course_groups: response.data.course_groups,
starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time,
}) })
}) })
.catch(function (error) { .catch(function (error) {
@ -184,6 +198,7 @@ class PublishRightnow extends Component{
const { showActionButton } = this.props const { showActionButton } = this.props
return( return(
<div> <div>
{/*立即截止*/}
{visible===true?<HomeworkModal {visible===true?<HomeworkModal
modaltype={modaltype} modaltype={modaltype}
modalname={modalname} modalname={modalname}
@ -204,6 +219,26 @@ class PublishRightnow extends Component{
onToPublishClick={this.props.onToPublishClick} onToPublishClick={this.props.onToPublishClick}
typs={this.state.typs} typs={this.state.typs}
/>:""} />:""}
{/*立即发布*/}
<OneSelfOrderModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
OneSelftype={this.state.OneSelftype}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
starttimes={this.state.starttimes}
starttimesend={this.state.starttimesend}
typs={this.state.typs}
/>
{ showActionButton && <a href="javascript:void(0)" className="color-grey-9" onClick={this.homeworkstart}>{ isPublish ? "立即发布" : "立即截止" }</a> } { showActionButton && <a href="javascript:void(0)" className="color-grey-9" onClick={this.homeworkstart}>{ isPublish ? "立即发布" : "立即截止" }</a> }
</div> </div>
) )

@ -33,55 +33,113 @@ class OneSelfOrderModal extends Component{
super(props); super(props);
this.state={ this.state={
group_ids:[], group_ids:[],
endtime:"" endtime:"",
course_groups:undefined
} }
} }
componentDidMount() { componentDidMount() {
if(this.props.course_groups!=undefined&&this.props.course_groups.length!=0){ if(this.props.course_groups!=undefined&&this.props.course_groups.length!=0){
if(this.props.course_groups!=undefined) {
let arr=this.props.course_groups.map(item => item.id); let arr = this.props.course_groups.map(item => item.id);
let newarr = [];
let course_groups = this.props.course_groups;
course_groups.map((item, key) => {
if (item.end_time === null) {
if(this.props.starttimesend===undefined){
item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
}else{
item.end_time = moment(handleDateString(this.props.starttimesend)).format("YYYY-MM-DD HH:mm");
}
newarr.push(item)
} else {
newarr.push(item)
}
})
this.setState({
course_groups: newarr
})
this.shixunhomeworkedit(arr); this.shixunhomeworkedit(arr);
} }
}
if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){ if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){
if(this.props.starttimesend===undefined){
this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
})
}else{
this.setState({
endtime:moment(handleDateString(this.props.starttimesend)).format("YYYY-MM-DD HH:mm")
})
}
}else{
if(this.props.starttimesend===undefined){
this.setState({ this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'months')).format("YYYY-MM-DD HH:mm") endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
}) })
}else{ }else{
this.setState({ this.setState({
endtime:moment(handleDateString(this.props.starttimes)).format("YYYY-MM-DD HH:mm") endtime:moment(handleDateString(this.props.starttimesend)).format("YYYY-MM-DD HH:mm")
}) })
} }
} }
}
componentDidUpdate=(prevProps)=>{ componentDidUpdate=(prevProps)=>{
// if(prevProps.visible!=this.props.visible){
//
// if(this.props.course_groups!=undefined){
// let arr=this.props.course_groups.map(item => item.id);
// this.shixunhomeworkedit(arr);
// }
// }
if(prevProps.course_groups!=this.props.course_groups){ if(prevProps.course_groups!=this.props.course_groups){
if(this.props.course_groups!=undefined){ if(this.props.course_groups!=undefined){
let arr=this.props.course_groups.map(item => item.id); let arr=this.props.course_groups.map(item => item.id);
let newarr=[];
let course_groups=this.props.course_groups;
course_groups.map((item,key)=>{
if(item.end_time===null){
if(this.props.starttimesend===undefined){
item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
}else{
item.end_time = moment(handleDateString(this.props.starttimesend)).format("YYYY-MM-DD HH:mm");
}
newarr.push(item)
}else{
newarr.push(item)
}
})
this.setState({
course_groups:newarr
})
this.shixunhomeworkedit(arr); this.shixunhomeworkedit(arr);
} }
} }
if(prevProps.starttimes!=this.props.starttimes){ if(prevProps.starttimes!=this.props.starttimes){
if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){ if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){
if(this.props.starttimesend===undefined){
this.setState({ this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'months')).format("YYYY-MM-DD HH:mm") endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
}) })
}else{ }else{
this.setState({ this.setState({
endtime:moment(handleDateString(this.props.starttimes)).format("YYYY-MM-DD HH:mm") endtime:moment(handleDateString(this.props.starttimesend)).format("YYYY-MM-DD HH:mm")
})
}
}else{
if(this.props.starttimesend===undefined){
this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
})
}else{
this.setState({
endtime:moment(handleDateString(this.props.starttimesend)).format("YYYY-MM-DD HH:mm")
}) })
} }
} }
} }
}
//勾选实训 //勾选实训
shixunhomeworkedit=(list)=>{ shixunhomeworkedit=(list)=>{
@ -101,22 +159,37 @@ class OneSelfOrderModal extends Component{
} }
onChangeTimeendlist=(date, dateString,id)=>{
let {course_groups}=this.state;
let arr=course_groups;
arr.map((item,key)=>{
if(item.id===id){
item.end_time=dateString
}
})
this.setState({
course_groups:arr
})
}
propsSaves=(ds,endtime)=>{ propsSaves=(ds,endtime)=>{
let {course_groups}=this.state;
if(ds.length ===0&&endtime === ""){ if(this.props.typs=="end"){
this.props.Saves() this.props.Saves()
}else{ }else{
if(this.props.typs!="end"){ if(this.props.typs!="end"){
if(endtime === ""||endtime===undefined||endtime===null){ if(!endtime){
this.setState({ this.setState({
endtimetype:true, endtimetype:true,
endtimetypevalue:"截止时间不能为空" endtimetypevalue:"截止时间不能为空"
}) })
return return
} }
if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttime,"YYYY-MM-DD HH:mm")){
if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttimes,"YYYY-MM-DD HH:mm")){
this.setState({ this.setState({
endtimetype:true, endtimetype:true,
endtimetypevalue:"必须晚于发布时间" endtimetypevalue:"必须晚于发布时间"
@ -124,25 +197,38 @@ class OneSelfOrderModal extends Component{
return return
} }
} }
if(course_groups===undefined||course_groups.length===0){
this.props.Saves(ds,moment(handleDateString(endtime),"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm")) this.props.Saves(ds,moment(handleDateString(endtime),"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm"))
}else{
let arr=[]
ds.map((item,key)=>{
course_groups.map((items,key)=>{
if(item===items.id){
if(!items.end_time){
arr.push(moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"))
}else{
arr.push(items.end_time)
}
} }
})
})
this.props.Saves(ds,arr)
} }
render(){
let {group_ids,endtime}=this.state;
let {course_groups}=this.props;
// console.log(this.props.starttimes)
// console.log(endtime)
// console.log(this.props.starttimes)
// console.log(this.state.endtime)
// console.log(this.props.starttime,this.props.endtime) }
// TODO course_groups为空时的处理
// let endtimelist=this.props.starttimes===undefined||this.props.starttimes===""?"":moment(handleDateString(endtime)).add(1,'months') }
render(){
let {group_ids,endtime,course_groups}=this.state;
// TODO course_groups为空时的处理
return( return(
<div> <div>
{ {
@ -195,13 +281,13 @@ class OneSelfOrderModal extends Component{
{this.props.starttime===undefined|| {this.props.starttime===undefined||
this.props.starttime===""?"" this.props.starttime===""?""
: <p className="task-popup-text-center font-16 mt20"> : <p className="task-popup-text-center font-16 mt10 mb10">
<span className={"font-14 mr20 color979797"}> <span className={"font-14 mr20 color979797"}>
<span className={"mr10"}>发布时间:</span> <span className={"mr10"}>发布时间:</span>
{this.props.starttime}</span> {this.props.starttime}</span>
{this.props.modaltype===undefined||this.props.modaltype===2? <span className={"font-14 color979797"}> {this.props.modaltype===undefined||this.props.modaltype===2? <span className={"font-14 color979797"}>
{/*{this.props.endtime}*/} {/*{this.props.endtime}*/}
<span className={"mr10"}>截止时间:</span> <span className={"mr10"}>截止时间</span>
<DatePicker <DatePicker
dropdownClassName="hideDisable" dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }} showTime={{ format: 'HH:mm' }}
@ -218,6 +304,7 @@ class OneSelfOrderModal extends Component{
className={ this.state.endtimetype===true?"noticeTip":""} className={ this.state.endtimetype===true?"noticeTip":""}
/> />
{this.state.endtimetype===true?<div className={"color-red fr mr90 mt5"}>{this.state.endtimetypevalue}</div>:""} {this.state.endtimetype===true?<div className={"color-red fr mr90 mt5"}>{this.state.endtimetypevalue}</div>:""}
<div className={"fr mr90 mt5"}>(仅支持半点和整点)</div>
</span>:""} </span>:""}
</p>} </p>}
{/* usingCheckBeforePost 为true的时候 全选所有分班 */} {/* usingCheckBeforePost 为true的时候 全选所有分班 */}
@ -245,7 +332,7 @@ class OneSelfOrderModal extends Component{
<li style={{ width: '100%',padding: "0px 10px"}} className={"mb10"}> <li style={{ width: '100%',padding: "0px 10px"}} className={"mb10"}>
<span style={{"float":"left","color":"#05101A"}} className="task-hide color-grey-name ml50">分班名称</span> <span style={{"float":"left","color":"#05101A"}} className="task-hide color-grey-name ml50">分班名称</span>
<span style={{"float":"right","color":"#05101A"}} className="task-hide color-grey-name mr70">截止时间</span> <span style={{"float":"right","color":"#05101A"}} className="task-hide color-grey-name mr20">截止时间(仅支持半点和整点)</span>
</li> </li>
</div>} </div>}
{this.props.modaltype===undefined||this.props.modaltype===2 {this.props.modaltype===undefined||this.props.modaltype===2
@ -257,10 +344,10 @@ class OneSelfOrderModal extends Component{
{ <Checkbox.Group style={{ width: '100%' }} value={group_ids} onChange={this.shixunhomeworkedit}> { <Checkbox.Group style={{ width: '100%' }} value={group_ids} onChange={this.shixunhomeworkedit}>
{ {
course_groups.map((item,key)=>{ course_groups===undefined?"":course_groups.map((item,key)=>{
return( return(
<div className="clearfix edu-txt-center lineh-40" key={key}> <div className="clearfix edu-txt-center lineh-40 mb10" key={key}>
<li style={{ width: '100%',padding: "0px 10px"}} className={"mb10"}> <li style={{ width: '100%',padding: "0px 10px"}} className={"mb10"}>
<Checkbox <Checkbox
className="task-hide edu-txt-left" className="task-hide edu-txt-left"
@ -279,10 +366,9 @@ class OneSelfOrderModal extends Component{
locale={locale} locale={locale}
format={dateFormat} format={dateFormat}
placeholder="请选择截止时间" placeholder="请选择截止时间"
id={"endTime"}
width={"210px"} width={"210px"}
value={item.end_time===null||item.end_time===""?"":moment(item.end_time, dateFormat)} value={item.end_time===null||item.end_time===""?"":moment(item.end_time, dateFormat)}
onChange={this.onChangeTimeend} onChange={(e,data)=>this.onChangeTimeendlist(e,data,item.id)}
className={ this.state.endtimetype===true?"noticeTip fr":"fr"} className={ this.state.endtimetype===true?"noticeTip fr":"fr"}
/> />
</li> </li>

@ -430,6 +430,7 @@ class Testpapersettinghomepage extends Component{
className={"btn fr color-blue font-16 mt20 mr20"} className={"btn fr color-blue font-16 mt20 mr20"}
checkBoxValues={[parseInt(this.props.match.params.Id)]} checkBoxValues={[parseInt(this.props.match.params.Id)]}
Exercisetype={"exercise"} Exercisetype={"exercise"}
pushtype={true}
action={this.Commonheadofthetestpaper} action={this.Commonheadofthetestpaper}
single={true} single={true}
getsetdata={this.getsetdata} getsetdata={this.getsetdata}

@ -6,6 +6,7 @@ import Loadable from 'react-loadable';
import Loading from '../../../../Loading'; import Loading from '../../../../Loading';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
import OneSelfOrderModal from "../../coursesPublic/OneSelfOrderModal";
import HomeworkModal from "../../coursesPublic/HomeworkModal"; import HomeworkModal from "../../coursesPublic/HomeworkModal";
import AccessoryModal from "../../coursesPublic/AccessoryModal"; import AccessoryModal from "../../coursesPublic/AccessoryModal";
import Associationmodel from '../../coursesPublic/Associationmodel'; import Associationmodel from '../../coursesPublic/Associationmodel';
@ -60,7 +61,8 @@ class GraduationTaskDetail extends Component{
Modalstopval:undefined, Modalstopval:undefined,
ModalCancel:undefined, ModalCancel:undefined,
ModalSave:undefined, ModalSave:undefined,
acrossVisible:undefined acrossVisible:undefined,
OneSelftype:false
} }
} }
componentDidMount(){ componentDidMount(){
@ -113,19 +115,28 @@ class GraduationTaskDetail extends Component{
// this.props.history.goBack() // this.props.history.goBack()
this.props.history.replace(`/courses/${this.state.questionslist.course_id}/graduation_tasks/${this.state.questionslist.graduation_id}`); this.props.history.replace(`/courses/${this.state.questionslist.course_id}/graduation_tasks/${this.state.questionslist.graduation_id}`);
} }
setend_time=(time)=>{
this.setState({
starttimesend:time===undefined||time===null||time===""?undefined:time,
})
}
//立即发布 //立即发布
publish=()=>{ publish=()=>{
let {questionslist}=this.state;
let starttime= this.props.getNowFormatDates(1,1); let starttime= this.props.getNowFormatDates(1,1);
let endtime=this.props.getNowFormatDates(2,1); let endtime=this.props.getNowFormatDates(2,1);
// this.homeworkstart() console.log(this.bindRef.end_time)
this.setState({ this.setState({
modalname:"立即发布", modalname:"立即发布",
visible:true, // visible:true,
OneSelftype:true,
Topval:"学生将立即收到毕设任务", Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改", // Botvalleft:"点击修改",
// Botval:`本操作只对"未发布"的分班有效`, // Botval:`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") , starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1), starttimes:questionslist.end_time,
staytime:this.props.getNowFormatDates(1),
typs:"start", typs:"start",
endtime:endtime, endtime:endtime,
Cancelname:"暂不发布", Cancelname:"暂不发布",
@ -169,7 +180,6 @@ class GraduationTaskDetail extends Component{
this.getdatas(); this.getdatas();
this.child && this.child.searchValue(); this.child && this.child.searchValue();
} }
// 立即截止 // 立即截止
end=()=>{ end=()=>{
// this.homeworkstart() // this.homeworkstart()
@ -212,6 +222,7 @@ class GraduationTaskDetail extends Component{
Modalstype:false, Modalstype:false,
Loadtype:false, Loadtype:false,
visible:false, visible:false,
OneSelftype:false,
Modulationtype:false, Modulationtype:false,
Allocationtype:false, Allocationtype:false,
Modalstopval:"", Modalstopval:"",
@ -317,7 +328,7 @@ class GraduationTaskDetail extends Component{
getdatas:this.getdatas getdatas:this.getdatas
} }
document.title=questionslist&&questionslist.course_name;
return( return(
<div className="newMain clearfix"> <div className="newMain clearfix">
{ {
@ -342,6 +353,34 @@ class GraduationTaskDetail extends Component{
modaltype={this.state.modaltype} modaltype={this.state.modaltype}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)} getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
/> />
<OneSelfOrderModal
{...this.props}
staytime={this.state.staytime}
starttimes={this.state.starttimes}
typs={this.state.typs}
modalname={this.state.modalname}
OneSelftype={this.state.OneSelftype}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
modaltype={this.state.modaltype}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
starttimes={this.state.starttimes}
starttimesend={this.state.starttimesend}
typs={this.state.typs}
/>
{/*关联项目*/} {/*关联项目*/}
{visibles===true? {visibles===true?
<Associationmodel <Associationmodel
@ -479,19 +518,19 @@ class GraduationTaskDetail extends Component{
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/list" <Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/list"
render={ render={
(props) => (<GraduationTaskslist {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`list`}/>) (props) => (<GraduationTaskslist {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} setend_time={(time)=>this.setend_time(time)} tab={`list`}/>)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/setting" <Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/setting"
render={ render={
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`setting`}/>) (props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} setend_time={(time)=>this.setend_time(time)} tab={`setting`}/>)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/questions" <Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/questions"
render={ render={
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`questions`}/>) (props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} setend_time={(time)=>this.setend_time(time)} tab={`questions`}/>)
}></Route> }></Route>
</Switch> </Switch>

@ -143,6 +143,7 @@ class GraduationTaskssettingapp extends Component{
commenttime:result.data.comment_time===null||result.data.comment_time=== ""?"":moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"), commenttime:result.data.comment_time===null||result.data.comment_time=== ""?"":moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"),
task_status: result.data.task_status task_status: result.data.task_status
}) })
this.props.setend_time(result.data.end_time)
} }
}).catch((error)=>{ }).catch((error)=>{

@ -151,7 +151,9 @@ class GraduationTaskssettinglist extends Component{
taskslistdata: result.data, taskslistdata: result.data,
data: datalist, data: datalist,
loadingstate: false, loadingstate: false,
end_time:result.data.end_time
}) })
this.props.setend_time(result.data.end_time)
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)

@ -54,8 +54,10 @@ class GraduationTasksquestions extends Component{
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if(result.status===200){ if(result.status===200){
this.setState({ this.setState({
questionslist:result.data questionslist:result.data,
end_time:result.data.end_time
}) })
this.props.setend_time(result.data.end_time)
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)

@ -185,6 +185,7 @@ class PollDetailIndex extends Component{
className={"font-16"} className={"font-16"}
checkBoxValues={[this.props.match.params.pollId]} checkBoxValues={[this.props.match.params.pollId]}
action={this.getPollInfo} action={this.getPollInfo}
pushtype={true}
single={true} single={true}
></ImmediatelyPublish> ></ImmediatelyPublish>
</li> </li>

@ -4,13 +4,14 @@ import React,{ Component } from "react";
import Modals from '../../../modals/Modals' import Modals from '../../../modals/Modals'
import { WordsBtn } from 'educoder' import { WordsBtn } from 'educoder'
import HomeworkModal from "../../coursesPublic/HomeworkModal"; import HomeworkModal from "../../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../../coursesPublic/OneSelfOrderModal";
import axios from 'axios' import axios from 'axios'
import moment from 'moment'; import moment from 'moment';
class Immediatelypublish extends Component{ class Immediatelypublish extends Component{
constructor(props){ constructor(props){
super(props) super(props)
@ -39,12 +40,76 @@ class Immediatelypublish extends Component{
} }
//立即发布 //立即发布
homeworkstart=()=>{ homeworkstart=()=>{
let {checkBoxValues}=this.props let {checkBoxValues,pushtype}=this.props
// console.log(this.props.Exercisetype==="exercise") if(pushtype===true){
if(checkBoxValues.length==0){
this.props.showNotification("请先在列表中选择数据");
// this.setState({
// modalsType:true,
// modalsTopval:"请先在列表中选择数据",
// loadtype:true
// })
}else{
let coursesId=this.props.match.params.coursesId;
if(this.props.Exercisetype==="exercise"){
let url=`/exercises/${this.props.match.params.Id}/publish_groups.json`;
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
modalname:"立即发布",
modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1,
OneSelftype:true,
Topval:"学生将立即收到试卷",
// Botvalleft:"暂不发布",
Botval:this.props.single ? "":`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:this.props.getNowFormatDates(1),
endtime:"截止时间:"+this.props.getNowFormatDates(2),
Cancelname:"暂不发布",
Savesname:"立即发布",
Cancel:this.homeworkhide,
Saves:this.homeworkstartend,
course_groups:response.data.course_groups,
starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time,
})
}
}).catch((error) => {
console.log(error)
});
}else{
let url=`/polls/${this.props.match.params.pollId}/publish_groups.json`;
axios.get(url).then((response) => {
if(response){
this.setState({
modalname:"立即发布",
modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1,
OneSelftype:true,
Topval:"学生将立即收到问卷",
// Botvalleft:"暂不发布",
Botval:this.props.single ? "":`本操作只对"未发布"的分班有效`,
starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:this.props.getNowFormatDates(1),
endtime:"截止时间:"+this.props.getNowFormatDates(2),
Cancelname:"暂不发布",
Savesname:"立即发布",
Cancel:this.homeworkhide,
Saves:this.homeworkstartend,
course_groups:response.data.course_groups,
starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time,
})
}
}).catch((error) => {
console.log(error)
});
}
}
}else{
if(checkBoxValues.length==0){ if(checkBoxValues.length==0){
this.props.showNotification("请先在列表中选择数据"); this.props.showNotification("请先在列表中选择数据");
// this.setState({ // this.setState({
@ -137,6 +202,8 @@ class Immediatelypublish extends Component{
} }
} }
}
} }
@ -154,6 +221,7 @@ class Immediatelypublish extends Component{
modalname:undefined, modalname:undefined,
modaltype:undefined, modaltype:undefined,
visible:false, visible:false,
OneSelftype:false,
Topval:undefined, Topval:undefined,
Topvalright:undefined, Topvalright:undefined,
Botvalleft:undefined, Botvalleft:undefined,
@ -174,18 +242,42 @@ class Immediatelypublish extends Component{
// 确定立即发布 // 确定立即发布
homeworkstartend=(ids,endtime)=>{ homeworkstartend=(ids,endtime)=>{
let {checkBoxValues}=this.props let {checkBoxValues,pushtype}=this.props
let {chooseId}=this.state; let {chooseId}=this.state;
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
if(this.props.Exercisetype==="exercise"){ let data={};
let url=`/courses/${coursesId}/exercises/publish.json` if(pushtype===true){
axios.post(url,{
if(ids.length===0){
data = {
check_ids:checkBoxValues,
end_time: endtime,
}
}else{
data={
check_ids: checkBoxValues,
group_ids: ids,
group_end_times:endtime,
detail:true
}
}
}else{
data={
check_ids:checkBoxValues, check_ids:checkBoxValues,
group_ids:chooseId, group_ids:chooseId,
end_time:endtime end_time:endtime
}).then((result)=>{ }
}
if(this.props.Exercisetype==="exercise"){
let url=`/courses/${coursesId}/exercises/publish.json`
axios.post(url,data).then((result)=>{
if(result){ if(result){
this.props.showNotification(result.data.message); this.props.showNotification(result.data.message);
this.homeworkhide(); this.homeworkhide();
@ -210,11 +302,7 @@ class Immediatelypublish extends Component{
}else{ }else{
let url=`/courses/${coursesId}/polls/publish.json` let url=`/courses/${coursesId}/polls/publish.json`
axios.post(url,{ axios.post(url,data).then((result)=>{
check_ids:checkBoxValues,
group_ids:chooseId,
end_time:endtime
}).then((result)=>{
if(result){ if(result){
this.props.showNotification(result.data.message); this.props.showNotification(result.data.message);
this.homeworkhide(); this.homeworkhide();
@ -277,6 +365,29 @@ class Immediatelypublish extends Component{
course_groups={course_groups} course_groups={course_groups}
getcourse_groupslist={(id)=>this.getcourse_groupslist(id)} getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}
/> />
{/*立即发布*/}
<OneSelfOrderModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
OneSelftype={this.state.OneSelftype}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
starttimes={this.state.starttimes}
starttimesend={this.state.starttimesend}
typs={this.state.typs}
/>
{/* 公用的提示弹框 */} {/* 公用的提示弹框 */}
<Modals <Modals
modalsType={modalsType} modalsType={modalsType}

@ -32,6 +32,7 @@ import DownloadMessageysl from '../../modals/DownloadMessageysl';
import Startshixuntask from "../coursesPublic/Startshixuntask"; import Startshixuntask from "../coursesPublic/Startshixuntask";
import ModulationModal from "../coursesPublic/ModulationModal"; import ModulationModal from "../coursesPublic/ModulationModal";
import HomeworkModal from "../coursesPublic/HomeworkModal"; import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import ShixunWorkModal from "./Shixunworkdetails/ShixunWorkModal"; import ShixunWorkModal from "./Shixunworkdetails/ShixunWorkModal";
import NoneData from '../../../modules/courses/coursesPublic/NoneData'; import NoneData from '../../../modules/courses/coursesPublic/NoneData';
@ -1679,8 +1680,8 @@ class Listofworksstudentone extends Component {
} }
seacthdatas = (teacherdata,student_works) => { seacthdatas = (teacherdata,student_works) => {
console.log("1197"); // console.log("1197");
console.log(this.props.isNotMember()); // console.log(this.props.isNotMember());
let {page, limit,work_efficiency} = this.state; let {page, limit,work_efficiency} = this.state;
let datalist = []; let datalist = [];
let datalists = []; let datalists = [];
@ -1867,8 +1868,8 @@ class Listofworksstudentone extends Component {
} }
// 设置数据 // 设置数据
seacthdata = (teacherdata) => { seacthdata = (teacherdata) => {
console.log("1326"); // console.log("1326");
console.log(this.props.isNotMember()); // console.log(this.props.isNotMember());
let datalist = []; let datalist = [];
@ -2344,8 +2345,8 @@ class Listofworksstudentone extends Component {
if (work_efficiency === false) { if (work_efficiency === false) {
if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined||course_group_info === null){ if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined||course_group_info === null){
//这里没有分班 没有 关卡得分 没有效率分 //这里没有分班 没有 关卡得分 没有效率分
console.log("1739"); // console.log("1739");
console.log(this.props.isNotMember()); // console.log(this.props.isNotMember());
for(var i=0;i< this.state.columns.length;i++){ for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i]; var item = this.state.columns[i];
@ -2381,8 +2382,8 @@ class Listofworksstudentone extends Component {
}else{ }else{
console.log("1767"); // console.log("1767");
console.log(this.props.isNotMember()); // console.log(this.props.isNotMember());
if(course_group_info.length < 2){ if(course_group_info.length < 2){
for(var i=0;i< this.state.columns.length;i++){ for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i]; var item = this.state.columns[i];
@ -2419,8 +2420,8 @@ class Listofworksstudentone extends Component {
} }
}else { }else {
console.log("1795"); // console.log("1795");
console.log(this.props.isNotMember()); // console.log(this.props.isNotMember());
for(var i=0;i< this.state.columns.length;i++){ for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i]; var item = this.state.columns[i];
@ -2453,8 +2454,8 @@ class Listofworksstudentone extends Component {
} }
} }
}else { }else {
console.log("1821"); // console.log("1821");
console.log(this.props.isNotMember()); // console.log(this.props.isNotMember());
if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined || course_group_info === null){ if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined || course_group_info === null){
@ -2489,8 +2490,8 @@ class Listofworksstudentone extends Component {
}else { }else {
console.log("1849"); // console.log("1849");
console.log(this.props.isNotMember()); // console.log(this.props.isNotMember());
if(course_group_info.length < 2) { if(course_group_info.length < 2) {
for(var i=0;i< this.state.columns.length;i++){ for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i]; var item = this.state.columns[i];
@ -2796,11 +2797,12 @@ class Listofworksstudentone extends Component {
this.setState({ this.setState({
modalname: "立即发布", modalname: "立即发布",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
svisible: true, svisible: false,
OneSelftype:true,
Topval:"学生将立即收到作业", Topval:"学生将立即收到作业",
// Botvalleft:"暂不发布", // Botvalleft:"暂不发布",
Botval:`本操作只对"未发布"的分班有效`, Botval:`本操作只对"未发布"的分班有效`,
starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), starttime: moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
endtime: "截止时间:" + endtime, endtime: "截止时间:" + endtime,
starttimes:starttime, starttimes:starttime,
starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time, starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time,
@ -2832,6 +2834,7 @@ class Listofworksstudentone extends Component {
modalname: "立即截止", modalname: "立即截止",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
svisible: true, svisible: true,
OneSelftype:false,
Topval:"学生将不能再提交作业", Topval:"学生将不能再提交作业",
// Botvalleft:"暂不截止", // Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`, Botval:`本操作只对"提交中"的分班有效`,
@ -2852,15 +2855,44 @@ class Listofworksstudentone extends Component {
// 立即发布 // 立即发布
homeworkstartend = (ds,endtime) => { homeworkstartend = (ds,endtime) => {
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
let {course_groupslist} = this.state;
let data={}
if(ds.length===0){
if(this.state.teacherdata.category.main===1){
data = {
homework_ids: [homeworkid],
end_time: endtime,
}
}else {
data = {
homework_ids: [homeworkid],
end_time: endtime,
category_id:this.state.teacherdata.category.category_id,
}
}
}else{
if(this.state.teacherdata.category.main===1){
data={
homework_ids: [homeworkid],
group_ids: ds,
group_end_times:endtime,
detail:true
}
}else{
data={
homework_ids: [homeworkid],
group_ids: ds,
group_end_times:endtime,
category_id:this.state.teacherdata.category.category_id,
detail:true
}
}
}
let coursesId = this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json"; let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json";
axios.post(url, { axios.post(url, data).then((result) => {
homework_ids: [homeworkid],
group_ids: course_groupslist,
end_time:endtime,
}).then((result) => {
if (result) { if (result) {
if (result.data.status === 0) { if (result.data.status === 0) {
notification.open({ notification.open({
@ -2935,6 +2967,7 @@ class Listofworksstudentone extends Component {
modalname: undefined, modalname: undefined,
modaltype: undefined, modaltype: undefined,
svisible: false, svisible: false,
OneSelftype:false,
Topval: undefined, Topval: undefined,
Topvalright: undefined, Topvalright: undefined,
Botvalleft: undefined, Botvalleft: undefined,
@ -3155,8 +3188,7 @@ class Listofworksstudentone extends Component {
</div> </div>
: "" : ""
} }
{/*立即截止*/}
{/*立即发布*/}
<HomeworkModal <HomeworkModal
modaltype={this.state.modaltype} modaltype={this.state.modaltype}
modalname={this.state.modalname} modalname={this.state.modalname}
@ -3176,6 +3208,28 @@ class Listofworksstudentone extends Component {
starttimes={this.state.starttimes} starttimes={this.state.starttimes}
starttimesend={this.state.starttimesend} starttimesend={this.state.starttimesend}
typs={this.state.typs} typs={this.state.typs}
/>
{/*立即发布*/}
<OneSelfOrderModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
OneSelftype={this.state.OneSelftype}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
starttimes={this.state.starttimes}
starttimesend={this.state.starttimesend}
typs={this.state.typs}
/> />
{ {
homework_status&&homework_status.length===0? homework_status&&homework_status.length===0?

@ -62,9 +62,9 @@ class ShixunHomeworkPage extends Component {
} }
Getdataback = (jobsettingsdata, teacherdata) => { Getdataback = (jobsettingsdata, teacherdata) => {
console.log("ShixunHomeworkPage56"); // console.log("ShixunHomeworkPage56");
console.log(jobsettingsdata); // console.log(jobsettingsdata);
console.log(teacherdata); // console.log(teacherdata);
this.setState({ this.setState({
jobsettingsdatapage: jobsettingsdata.data.message===undefined?jobsettingsdata:undefined, jobsettingsdatapage: jobsettingsdata.data.message===undefined?jobsettingsdata:undefined,
@ -350,12 +350,7 @@ class ShixunHomeworkPage extends Component {
</div> </div>
</div> </div>
</div> </div>
{/*<DownloadMessageysl*/}
{/*{...this.props}*/}
{/*value={this.state.DownloadMessageval}*/}
{/*modalCancel={this.Downloadcal}*/}
{/*modalsType={this.state.DownloadType}*/}
{/*/>*/}
{parseInt(tab) === 0 ?<Listofworksstudentone triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>:""} {parseInt(tab) === 0 ?<Listofworksstudentone triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>:""}
{parseInt(tab) === 1 ?<Workquestionandanswer triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)} Showupdateinstructionsboolfalse={(i)=>this.Showupdateinstructionsboolfalse(i)}></Workquestionandanswer>:""} {parseInt(tab) === 1 ?<Workquestionandanswer triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)} Showupdateinstructionsboolfalse={(i)=>this.Showupdateinstructionsboolfalse(i)}></Workquestionandanswer>:""}
{parseInt(tab) === 2 ?<ShixunStudentWork triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>:""} {parseInt(tab) === 2 ?<ShixunStudentWork triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>:""}
@ -369,31 +364,3 @@ class ShixunHomeworkPage extends Component {
export default ShixunHomeworkPage; export default ShixunHomeworkPage;
// <div className="edu-back-white mt10" >
// <div className="stud-class-set bor-bottom-greyE ">
// <div className=" clearfix edu-back-white pl30 pr30">
// <div className="fl task_menu_ul">
// {this.props.isAdmin() === true ?
//
// <Menu mode="horizontal" selectedKeys={tab} onClick={(e)=>this.changeTab(e)}>
// <Menu.Item key="0">作品列表</Menu.Item>
// <Menu.Item key="1">作业回答</Menu.Item>
// <Menu.Item key="2">代码查重</Menu.Item>
// <Menu.Item key="3">设置</Menu.Item>
// </Menu>
// :
// <Menu mode="horizontal" selectedKeys={tab} onClick={(e)=>this.changeTab(e)}>
// <Menu.Item key="0">作品列表</Menu.Item>
// <Menu.Item key="1">作业回答</Menu.Item>
// <Menu.Item key="2">代码查重</Menu.Item>
// </Menu>
// }
//
// </div>
// </div>
{/* </div>*/
}
{/*</div>*/
}

@ -3,6 +3,7 @@ import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn,ActionBtn} from 'educoder'; import {WordsBtn,ActionBtn} from 'educoder';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal'; import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal"; import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import DownloadMessageysl from '../../modals/DownloadMessageysl'; import DownloadMessageysl from '../../modals/DownloadMessageysl';
import NoneData from '../coursesPublic/NoneData'; import NoneData from '../coursesPublic/NoneData';
import { import {
@ -422,7 +423,7 @@ class ShixunStudentWork extends Component {
this.setState({ this.setState({
modalname:"立即发布", modalname:"立即发布",
modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1, modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1,
visible:true, OneSelftype:true,
Topval:"学生将立即收到作业", Topval:"学生将立即收到作业",
// Botvalleft:"暂不发布", // Botvalleft:"暂不发布",
Botval:`本操作只对"未发布"的分班有效`, Botval:`本操作只对"未发布"的分班有效`,
@ -476,15 +477,44 @@ class ShixunStudentWork extends Component {
// 立即发布 // 立即发布
homeworkstartend=(ds,endtime)=>{ homeworkstartend=(ds,endtime)=>{
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
let {course_groupslist} = this.state;
let data={}
if(ds.length===0){
if(this.props.teacherdatapage.category.main===1){
data = {
homework_ids: [homeworkid],
end_time: endtime,
}
}else {
data = {
homework_ids: [homeworkid],
end_time: endtime,
category_id:this.props.teacherdatapage.category.category_id,
}
}
}else{
if(this.props.teacherdatapage.category.main===1){
data={
homework_ids: [homeworkid],
group_ids: ds,
group_end_times:endtime,
detail:true
}
}else{
data={
homework_ids: [homeworkid],
group_ids: ds,
group_end_times:endtime,
category_id:this.props.teacherdatapage.category.category_id,
detail:true
}
}
}
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
let url ="/courses/"+coursesId+"/homework_commons/publish_homework.json"; let url ="/courses/"+coursesId+"/homework_commons/publish_homework.json";
axios.post(url,{ axios.post(url,data).then((result)=>{
homework_ids:[homeworkid],
group_ids:course_groupslist,
end_time:endtime,
}).then((result)=>{
if(result.status===200){ if(result.status===200){
if(result.data.status===0){ if(result.data.status===0){
notification.open({ notification.open({
@ -538,6 +568,7 @@ class ShixunStudentWork extends Component {
modalname:undefined, modalname:undefined,
modaltype:undefined, modaltype:undefined,
visible:false, visible:false,
OneSelftype:false,
Topval:undefined, Topval:undefined,
Topvalright:undefined, Topvalright:undefined,
Botvalleft:undefined, Botvalleft:undefined,
@ -739,7 +770,7 @@ class ShixunStudentWork extends Component {
{/* {...this.props}*/} {/* {...this.props}*/}
{/* refs="DownloadMessage"*/} {/* refs="DownloadMessage"*/}
{/*/>*/} {/*/>*/}
{/*立即发布*/} {/*立即截止*/}
<HomeworkModal <HomeworkModal
modaltype={this.state.modaltype} modaltype={this.state.modaltype}
modalname={this.state.modalname} modalname={this.state.modalname}
@ -760,6 +791,29 @@ class ShixunStudentWork extends Component {
starttimesend={this.state.starttimesend} starttimesend={this.state.starttimesend}
typs={this.state.typs} typs={this.state.typs}
/> />
{/*立即发布*/}
<OneSelfOrderModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
OneSelftype={this.state.OneSelftype}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
starttimes={this.state.starttimes}
starttimesend={this.state.starttimesend}
typs={this.state.typs}
/>
<div className={"educontent "}> <div className={"educontent "}>
<div className="edu-back-white"> <div className="edu-back-white">

@ -17,17 +17,20 @@ import {
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import axios from 'axios'; import axios from 'axios';
import moment from 'moment';
import 'moment/locale/zh-cn';
import Modals from "../../modals/Modals";
import DownloadMessageysl from "../../modals/DownloadMessageysl";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import '../css/members.css'; import '../css/members.css';
import "../common/formCommon.css"; import "../common/formCommon.css";
import '../css/Courses.css'; import '../css/Courses.css';
import './style.css'; import './style.css';
import '../css/busyWork.css' import '../css/busyWork.css'
import '../poll/pollStyle.css' import '../poll/pollStyle.css'
import moment from 'moment';
import 'moment/locale/zh-cn';
import Modals from "../../modals/Modals";
import Startshixuntask from "../coursesPublic/Startshixuntask"; import Startshixuntask from "../coursesPublic/Startshixuntask";
import DownloadMessageysl from "../../modals/DownloadMessageysl";
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
//GraduationTaskssetting.js //GraduationTaskssetting.js
@ -1531,7 +1534,7 @@ class Trainingjobsetting extends Component {
this.setState({ this.setState({
modalname: "立即发布", modalname: "立即发布",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
visible: true, OneSelftype: true,
Topval:"学生将立即收到作业", Topval:"学生将立即收到作业",
// Botvalleft:"暂不发布", // Botvalleft:"暂不发布",
Botval:`本操作只对"未发布"的分班有效`, Botval:`本操作只对"未发布"的分班有效`,
@ -1587,15 +1590,44 @@ class Trainingjobsetting extends Component {
// 立即发布 // 立即发布
homeworkstartend = (ds,endtime) => { homeworkstartend = (ds,endtime) => {
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
let {course_groupslist} = this.state;
let data={}
if(ds.length===0){
if(this.props.teacherdatapage.category.main===1){
data = {
homework_ids: [homeworkid],
end_time: endtime,
}
}else {
data = {
homework_ids: [homeworkid],
end_time: endtime,
category_id:this.props.teacherdatapage.category.category_id,
}
}
}else{
if(this.props.teacherdatapage.category.main===1){
data={
homework_ids: [homeworkid],
group_ids: ds,
group_end_times:endtime,
detail:true
}
}else{
data={
homework_ids: [homeworkid],
group_ids: ds,
group_end_times:endtime,
category_id:this.props.teacherdatapage.category.category_id,
detail:true
}
}
}
let coursesId = this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json"; let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json";
axios.post(url, { axios.post(url,data).then((result) => {
homework_ids: [homeworkid],
group_ids: course_groupslist,
end_time:endtime,
}).then((result) => {
if (result.status === 200) { if (result.status === 200) {
if (result.data.status === 0) { if (result.data.status === 0) {
notification.open({ notification.open({
@ -1654,6 +1686,7 @@ class Trainingjobsetting extends Component {
modalname: undefined, modalname: undefined,
modaltype: undefined, modaltype: undefined,
visible: false, visible: false,
OneSelftype:false,
Topval: undefined, Topval: undefined,
Topvalright: undefined, Topvalright: undefined,
Botvalleft: undefined, Botvalleft: undefined,
@ -1799,8 +1832,8 @@ class Trainingjobsetting extends Component {
}; };
//一进来就是老师要用的编辑页面 //一进来就是老师要用的编辑页面
editSettings=(datas)=>{ editSettings=(datas)=>{
console.log("编辑页面"); // console.log("编辑页面");
console.log(datas); // console.log(datas);
try { try {
if (datas.data.is_end === true) { if (datas.data.is_end === true) {
this.setState({ this.setState({
@ -2127,6 +2160,30 @@ class Trainingjobsetting extends Component {
starttimesend={this.state.starttimesend} starttimesend={this.state.starttimesend}
typs={this.state.typs} typs={this.state.typs}
/> />
{/*立即发布*/}
<OneSelfOrderModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
OneSelftype={this.state.OneSelftype}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
starttimes={this.state.starttimes}
starttimesend={this.state.starttimesend}
typs={this.state.typs}
/>
<Modals <Modals
modalsType={modalsType} modalsType={modalsType}
modalsTopval={modalsTopval} modalsTopval={modalsTopval}

@ -24,18 +24,21 @@ import {Link, Switch, Route, Redirect} from 'react-router-dom';
import moment from 'moment'; import moment from 'moment';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import axios from 'axios'; import axios from 'axios';
import CommonReply from "../common/comments/CommonReply";
import Homeworddescription from "../shixunHomework/Homeworddescription";
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import DownloadMessageysl from "../../modals/DownloadMessageysl";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import '../css/members.css' import '../css/members.css'
import "../common/formCommon.css" import "../common/formCommon.css"
import '../css/Courses.css' import '../css/Courses.css'
import './style.css' import './style.css'
import 'antd/lib/pagination/style/index.css'; import 'antd/lib/pagination/style/index.css';
import './Challenges.css' import './Challenges.css'
import CommonReply from "../common/comments/CommonReply";
import Homeworddescription from "../shixunHomework/Homeworddescription";
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import Startshixuntask from "../coursesPublic/Startshixuntask"; import Startshixuntask from "../coursesPublic/Startshixuntask";
import DownloadMessageysl from "../../modals/DownloadMessageysl";
const TextArea = Input.TextArea const TextArea = Input.TextArea
//作业问答页面 //作业问答页面
@ -163,11 +166,11 @@ class Workquestionandanswer extends Component {
this.setState({ this.setState({
modalname: "立即发布", modalname: "立即发布",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
visible: true, OneSelftype: true,
Topval: "学生将立即收到作业", Topval: "学生将立即收到作业",
// Botvalleft:"暂不发布", // Botvalleft:"暂不发布",
Botval: `本操作只对"未发布"的分班有效`, Botval: `本操作只对"未发布"的分班有效`,
starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), starttime: moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
endtime: "截止时间:" + endtime, endtime: "截止时间:" + endtime,
Cancelname: "暂不发布", Cancelname: "暂不发布",
Savesname: "立即发布", Savesname: "立即发布",
@ -218,15 +221,43 @@ class Workquestionandanswer extends Component {
// 立即发布 // 立即发布
homeworkstartend = (ds, endtime) => { homeworkstartend = (ds, endtime) => {
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
let {course_groupslist} = this.state;
let coursesId = this.props.match.params.coursesId; let data={}
let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json"; if(ds.length===0){
axios.post(url, { if(this.state.category.main===1){
data = {
homework_ids: [homeworkid], homework_ids: [homeworkid],
group_ids: course_groupslist,
end_time: endtime, end_time: endtime,
}).then((result) => { }
}else {
data = {
homework_ids: [homeworkid],
end_time: endtime,
category_id:this.state.category.category_id,
}
}
}else{
if(this.state.category.main===1){
data={
homework_ids: [homeworkid],
group_ids: ds,
group_end_times:endtime,
detail:true
}
}else{
data={
homework_ids: [homeworkid],
group_ids: ds,
group_end_times:endtime,
category_id:this.state.category.category_id,
detail:true
}
}
}
let coursesId = this.props.match.params.coursesId;
let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json";
axios.post(url, data).then((result) => {
if (result.status === 200) { if (result.status === 200) {
if (result.data.status === 0) { if (result.data.status === 0) {
notification.open({ notification.open({
@ -335,6 +366,7 @@ class Workquestionandanswer extends Component {
addnametab: undefined, addnametab: undefined,
typs: undefined, typs: undefined,
starttimes: undefined, starttimes: undefined,
OneSelftype:false,
}) })
} }
getcourse_groupslist = (id) => { getcourse_groupslist = (id) => {
@ -455,6 +487,28 @@ class Workquestionandanswer extends Component {
starttimesend={this.state.starttimesend} starttimesend={this.state.starttimesend}
typs={this.state.typs} typs={this.state.typs}
/> />
{/*立即发布*/}
<OneSelfOrderModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
OneSelftype={this.state.OneSelftype}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
starttimes={this.state.starttimes}
starttimesend={this.state.starttimesend}
typs={this.state.typs}
/>
<div className={"educontent "}> <div className={"educontent "}>
<div className="edu-back-white" > <div className="edu-back-white" >

@ -111,7 +111,7 @@ class ShixunsHome extends Component {
} }
const MyRate = ({ defaultValue, ...rest }) => { const MyRate = ({ defaultValue, ...rest }) => {
let myValue = defaultValue; let myValue = defaultValue;
console.log(myValue-Math.floor(myValue)) // console.log(myValue-Math.floor(myValue))
// if (myValue < Math.ceil(myValue)) { // if (myValue < Math.ceil(myValue)) {
// myValue = Math.floor(myValue) + 0.5; // myValue = Math.floor(myValue) + 0.5;
// } // }

Loading…
Cancel
Save