Merge branches 'dev_aliyun' and 'ysm1' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

problem_set
杨树明 5 years ago
commit 2e018f16f8

@ -4,13 +4,8 @@ import {Link} from 'react-router-dom';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import Loadable from 'react-loadable';
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 axios from 'axios';
import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType';
import AccessoryModal from "../coursesPublic/AccessoryModal";
import PublishRightnow from './PublishRightnow'

@ -1,7 +1,8 @@
import React,{ Component } from "react";
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 moment from 'moment'
import { getNextHalfHourOfMoment } from 'educoder'
@ -51,7 +52,8 @@ class PublishRightnow extends Component{
this.setState({
modalname: isPublish ? "立即发布" : "立即截止",
modaltype:1,
visible:true,
visible:isPublish?false:true,
OneSelftype:isPublish?true:false,
Topval: isPublish ? "学生将立即收到作业" : "学生将不能再提交作品",
// Botvalleft: isPublish ? "暂不发布" : "暂不截止",
Botval: this.props.fromListPage ? (isPublish ? "本操作只对“未发布”的分班有效" : "本操作只对“提交中”的分班有效") : '',
@ -70,6 +72,7 @@ class PublishRightnow extends Component{
modalname:undefined,
modaltype:undefined,
visible:false,
OneSelftype:false,
Topval:undefined,
Topvalright:undefined,
Botvalleft:undefined,
@ -106,18 +109,28 @@ class PublishRightnow extends Component{
this.props.showNotification('请至少选择一个分班');
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;
const url = `/courses/${coursesId}/homework_commons/${isPublish ? "publish_homework" : "end_homework"}.json`
axios.post(url, {
group_ids,
homework_ids: this.props.checkBoxValues,
all_check: 0,
end_time:endtime==="Invalid date"?undefined:endtime
})
axios.post(url, data)
.then((response) => {
if (response.data.status == 0) {
this.homeworkhide()
this.props.showNotification(isPublish ? "立即发布成功" : "立即截止成功")
this.props.doWhenSuccess && this.props.doWhenSuccess()
this.setState({ visible : false })
@ -153,6 +166,7 @@ class PublishRightnow extends Component{
this.showDialog()
this.setState({
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) {
@ -184,6 +198,7 @@ class PublishRightnow extends Component{
const { showActionButton } = this.props
return(
<div>
{/*立即截止*/}
{visible===true?<HomeworkModal
modaltype={modaltype}
modalname={modalname}
@ -204,6 +219,26 @@ class PublishRightnow extends Component{
onToPublishClick={this.props.onToPublishClick}
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> }
</div>
)

@ -33,52 +33,111 @@ class OneSelfOrderModal extends Component{
super(props);
this.state={
group_ids:[],
endtime:""
endtime:"",
course_groups:undefined,
Checkboxtype:true
}
}
componentDidMount() {
if(this.props.course_groups!=undefined&&this.props.course_groups.length!=0){
let arr=this.props.course_groups.map(item => item.id);
this.shixunhomeworkedit(arr);
if(this.props.course_groups!=undefined) {
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);
}
}
if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){
this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'months')).format("YYYY-MM-DD HH:mm")
})
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{
this.setState({
endtime:moment(handleDateString(this.props.starttimes)).format("YYYY-MM-DD HH:mm")
})
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")
})
}
}
}
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(this.props.course_groups!=undefined){
let arr=this.props.course_groups.map(item => item.id);
this.shixunhomeworkedit(arr);
}
if(this.props.course_groups!=undefined){
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);
}
}
if(prevProps.starttimes!=this.props.starttimes){
if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){
this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'months')).format("YYYY-MM-DD HH:mm")
})
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{
this.setState({
endtime:moment(handleDateString(this.props.starttimes)).format("YYYY-MM-DD HH:mm")
})
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")
})
}
}
}
}
@ -101,22 +160,38 @@ 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=date===null?"":moment(handleDateString(dateString)).format('YYYY-MM-DD HH:mm')
}
})
this.setState({
course_groups:arr
})
}
propsSaves=(ds,endtime)=>{
let {course_groups}=this.state;
if(ds.length ===0&&endtime === ""){
if(this.props.typs=="end"){
this.props.Saves()
}else{
if(this.props.typs!="end"){
if(endtime === ""||endtime===undefined||endtime===null){
if(this.props.typs!="end"){
if(!endtime){
this.setState({
endtimetype:true,
endtimetypevalue:"截止时间不能为空"
})
return
}
if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttimes,"YYYY-MM-DD HH:mm")){
if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttime,"YYYY-MM-DD HH:mm")){
this.setState({
endtimetype:true,
endtimetypevalue:"必须晚于发布时间"
@ -124,27 +199,79 @@ class OneSelfOrderModal extends Component{
return
}
}
this.props.Saves(ds,moment(handleDateString(endtime),"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm"))
}
let type=false
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"))
}else{
let arr=[]
ds.map((item,key)=>{
course_groups.map((items,key)=>{
if(item===items.id){
if(!items.end_time){
type=true
this.setState({
endtimetype:true,
endtimetypeid:items.id,
endtimetypevalue:"截止时间不能为空"
})
return
// arr.push(moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"))
}else{
arr.push(items.end_time)
}
}
})
})
if(type===false){
this.props.Saves(ds,arr)
}
}
}
}
render(){
let {group_ids,endtime}=this.state;
let {course_groups}=this.props;
Checkboxtype=(e)=>{
// console.log(this.props.starttimes)
// console.log(endtime)
// console.log(this.props.starttimes)
// console.log(this.state.endtime)
let {course_groups}=this.state;
// console.log(this.props.starttime,this.props.endtime)
// TODO course_groups为空时的处理
let arr=[];
if(e.target.checked==true){
course_groups.map((item,key)=>{
arr.push(item.id)
})
}else{
arr=[]
}
this.setState({
Checkboxtype:e.target.checked,
group_ids:arr
})
}
// let endtimelist=this.props.starttimes===undefined||this.props.starttimes===""?"":moment(handleDateString(endtime)).add(1,'months')
render(){
let {group_ids,endtime,course_groups}=this.state;
// console.log(course_groups)
// TODO course_groups为空时的处理
return(
<div>
<style>
{
`
.ant-input, .ant-input .ant-input-suffix{
background-color: #fff !important;
}
.width300{
width:300px;
display: inline-block;
}
`
}
</style>
{
this.props.OneSelftype===true?<style>
{
@ -186,22 +313,22 @@ class OneSelfOrderModal extends Component{
{this.props.Topval}
<span className={"color-blue underline"}>{this.props.Topvalright}</span>
</p>
<p className="task-popup-text-center font-16 mt10">
{this.props.Botvalleft===undefined?"":<span className={"colorFF6800"}>"{this.props.Botvalleft}"</span>}
{this.props.Botval}
</p>
{/*<p className="task-popup-text-center font-16 mt10">*/}
{/*{this.props.Botvalleft===undefined?"":<span className={"colorFF6800"}>"{this.props.Botvalleft}"</span>}*/}
{/*{this.props.Botval}*/}
{/*</p>*/}
</React.Fragment> }
{this.props.starttime===undefined||
this.props.starttime===""?""
: <p className="task-popup-text-center font-16 mt20">
<span className={"font-14 mr20 color979797"}>
<span className={"mr10"}>发布时间:</span>
{this.props.starttime}</span>
: <p className="task-popup-text-center font-16 mt10 mb10">
{/*<span className={"font-14 mr20 color979797"}>*/}
{/*<span className={"mr10"}>发布时间:</span>*/}
{/*{this.props.starttime}</span>*/}
{this.props.modaltype===undefined||this.props.modaltype===2? <span className={"font-14 color979797"}>
{/*{this.props.endtime}*/}
<span className={"mr10"}>截止时间:</span>
<span className={"mr10"}>截止时间</span>
<DatePicker
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
@ -218,6 +345,7 @@ class OneSelfOrderModal extends Component{
className={ this.state.endtimetype===true?"noticeTip":""}
/>
{this.state.endtimetype===true?<div className={"color-red fr mr90 mt5"}>{this.state.endtimetypevalue}</div>:""}
{/*<div className={"fr mr90 mt5"}>(仅支持半点和整点)</div>*/}
</span>:""}
</p>}
{/* usingCheckBeforePost 为true的时候 全选所有分班 */}
@ -245,7 +373,7 @@ class OneSelfOrderModal extends Component{
<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":"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>
</div>}
{this.props.modaltype===undefined||this.props.modaltype===2
@ -257,13 +385,13 @@ class OneSelfOrderModal extends Component{
{ <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(
<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"}>
<Checkbox
className="task-hide edu-txt-left"
className="task-hide edu-txt-left width300"
name="shixun_homework[]"
value={item.id}
key={item.id}
@ -279,11 +407,10 @@ class OneSelfOrderModal extends Component{
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
id={"endTime"}
width={"210px"}
value={item.end_time===null||item.end_time===""?"":moment(item.end_time, dateFormat)}
onChange={this.onChangeTimeend}
className={ this.state.endtimetype===true?"noticeTip fr":"fr"}
value={item.end_time===null||item.end_time===""?"":moment(handleDateString(item.end_time), dateFormat)}
onChange={(e,data)=>this.onChangeTimeendlist(e,data,item.id)}
className={ this.state.endtimetypeid===item.id&&this.state.endtimetype===true||moment(handleDateString(item.end_time),"YYYY-MM-DD HH:mm") <= moment(this.props.starttime,"YYYY-MM-DD HH:mm")?"noticeTip fr":"fr"}
/>
</li>
@ -297,6 +424,7 @@ class OneSelfOrderModal extends Component{
}
<div className="clearfix mt30 edu-txt-center mb10">
<Checkbox className="fl ml10" checked={this.state.Checkboxtype} onChange={this.Checkboxtype}>全选</Checkbox>
<a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname}</a>
<a className="task-btn task-btn-orange" onClick={()=>this.propsSaves(group_ids,this.state.endtime)}>{this.props.Savesname}</a>
</div>

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

@ -6,6 +6,7 @@ import Loadable from 'react-loadable';
import Loading from '../../../../Loading';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import axios from 'axios';
import OneSelfOrderModal from "../../coursesPublic/OneSelfOrderModal";
import HomeworkModal from "../../coursesPublic/HomeworkModal";
import AccessoryModal from "../../coursesPublic/AccessoryModal";
import Associationmodel from '../../coursesPublic/Associationmodel';
@ -60,7 +61,8 @@ class GraduationTaskDetail extends Component{
Modalstopval:undefined,
ModalCancel:undefined,
ModalSave:undefined,
acrossVisible:undefined
acrossVisible:undefined,
OneSelftype:false
}
}
componentDidMount(){
@ -113,19 +115,28 @@ class GraduationTaskDetail extends Component{
// this.props.history.goBack()
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=()=>{
let {questionslist}=this.state;
let starttime= this.props.getNowFormatDates(1,1);
let endtime=this.props.getNowFormatDates(2,1);
// this.homeworkstart()
console.log(this.bindRef.end_time)
this.setState({
modalname:"立即发布",
visible:true,
// visible:true,
OneSelftype:true,
Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改",
// Botval:`本操作只对"未发布"的分班有效`,
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",
endtime:endtime,
Cancelname:"暂不发布",
@ -169,7 +180,6 @@ class GraduationTaskDetail extends Component{
this.getdatas();
this.child && this.child.searchValue();
}
// 立即截止
end=()=>{
// this.homeworkstart()
@ -212,6 +222,7 @@ class GraduationTaskDetail extends Component{
Modalstype:false,
Loadtype:false,
visible:false,
OneSelftype:false,
Modulationtype:false,
Allocationtype:false,
Modalstopval:"",
@ -317,7 +328,7 @@ class GraduationTaskDetail extends Component{
getdatas:this.getdatas
}
document.title=questionslist&&questionslist.course_name;
return(
<div className="newMain clearfix">
{
@ -342,6 +353,34 @@ class GraduationTaskDetail extends Component{
modaltype={this.state.modaltype}
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?
<Associationmodel
@ -479,19 +518,19 @@ class GraduationTaskDetail extends Component{
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/list"
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 exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/setting"
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 exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/questions"
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>
</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"),
task_status: result.data.task_status
})
this.props.setend_time(result.data.end_time)
}
}).catch((error)=>{

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

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

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

@ -4,13 +4,14 @@ import React,{ Component } from "react";
import Modals from '../../../modals/Modals'
import { WordsBtn } from 'educoder'
import HomeworkModal from "../../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../../coursesPublic/OneSelfOrderModal";
import axios from 'axios'
import moment from 'moment';
class Immediatelypublish extends Component{
constructor(props){
super(props)
@ -39,104 +40,170 @@ class Immediatelypublish extends Component{
}
//立即发布
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){
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=`/courses/${coursesId}/exercises/publish_modal.json`;
axios.get(url,{
params:{
check_ids:checkBoxValues
}
}).then((response) => {
if(response.status===200){
let list=[];
if(response.data.course_info){
for(var i=0;i<response.data.course_info.length;i++){
list.push({
id:response.data.course_info[i].course_group_id,
name:response.data.course_info[i].course_group_name,
})
}
}
this.setState({
course_groups:list,
})
this.setState({
modalname:"立即发布",
modaltype:response.data.un_publish > 0 ? 1 : 2,
visible: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,
})
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)
});
}
}).catch((error) => {
console.log(error)
});
}else{
let url=`/courses/${coursesId}/polls/publish_modal.json`;
axios.get(url,{
params:{
check_ids:checkBoxValues
}
}).then((response) => {
if(response){
let list=[];
if(response.data.course_info){
for(var i=0;i<response.data.course_info.length;i++){
list.push({
id:response.data.course_info[i].course_group_id,
name:response.data.course_info[i].course_group_name,
})
}
}
this.setState({
course_groups:list,
})
this.setState({
modalname:"立即发布",
modaltype:response.data.un_publish > 0 ? 1 : 2,
visible: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,
})
}
}).catch((error) => {
console.log(error)
});
}
}
}
}else{
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=`/courses/${coursesId}/exercises/publish_modal.json`;
axios.get(url,{
params:{
check_ids:checkBoxValues
}
}).then((response) => {
if(response.status===200){
let list=[];
if(response.data.course_info){
for(var i=0;i<response.data.course_info.length;i++){
list.push({
id:response.data.course_info[i].course_group_id,
name:response.data.course_info[i].course_group_name,
})
}
}
this.setState({
course_groups:list,
})
this.setState({
modalname:"立即发布",
modaltype:response.data.un_publish > 0 ? 1 : 2,
visible: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,
})
}
}).catch((error) => {
console.log(error)
});
}else{
let url=`/courses/${coursesId}/polls/publish_modal.json`;
axios.get(url,{
params:{
check_ids:checkBoxValues
}
}).then((response) => {
if(response){
let list=[];
if(response.data.course_info){
for(var i=0;i<response.data.course_info.length;i++){
list.push({
id:response.data.course_info[i].course_group_id,
name:response.data.course_info[i].course_group_name,
})
}
}
this.setState({
course_groups:list,
})
this.setState({
modalname:"立即发布",
modaltype:response.data.un_publish > 0 ? 1 : 2,
visible: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,
})
}
}).catch((error) => {
console.log(error)
});
}
}
}
}
}
@ -154,6 +221,7 @@ class Immediatelypublish extends Component{
modalname:undefined,
modaltype:undefined,
visible:false,
OneSelftype:false,
Topval:undefined,
Topvalright:undefined,
Botvalleft:undefined,
@ -174,18 +242,42 @@ class Immediatelypublish extends Component{
// 确定立即发布
homeworkstartend=(ids,endtime)=>{
let {checkBoxValues}=this.props
let {checkBoxValues,pushtype}=this.props
let {chooseId}=this.state;
let coursesId=this.props.match.params.coursesId;
let data={};
if(pushtype===true){
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,
group_ids:chooseId,
end_time:endtime
}
}
if(this.props.Exercisetype==="exercise"){
let url=`/courses/${coursesId}/exercises/publish.json`
axios.post(url,{
check_ids:checkBoxValues,
group_ids:chooseId,
end_time:endtime
}).then((result)=>{
axios.post(url,data).then((result)=>{
if(result){
this.props.showNotification(result.data.message);
this.homeworkhide();
@ -210,11 +302,7 @@ class Immediatelypublish extends Component{
}else{
let url=`/courses/${coursesId}/polls/publish.json`
axios.post(url,{
check_ids:checkBoxValues,
group_ids:chooseId,
end_time:endtime
}).then((result)=>{
axios.post(url,data).then((result)=>{
if(result){
this.props.showNotification(result.data.message);
this.homeworkhide();
@ -277,6 +365,29 @@ class Immediatelypublish extends Component{
course_groups={course_groups}
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
modalsType={modalsType}

@ -32,6 +32,7 @@ import DownloadMessageysl from '../../modals/DownloadMessageysl';
import Startshixuntask from "../coursesPublic/Startshixuntask";
import ModulationModal from "../coursesPublic/ModulationModal";
import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import ShixunWorkModal from "./Shixunworkdetails/ShixunWorkModal";
import NoneData from '../../../modules/courses/coursesPublic/NoneData';
@ -1683,8 +1684,8 @@ class Listofworksstudentone extends Component {
}
seacthdatas = (teacherdata,student_works) => {
console.log("1197");
console.log(this.props.isNotMember());
// console.log("1197");
// console.log(this.props.isNotMember());
let {page, limit,work_efficiency} = this.state;
let datalist = [];
let datalists = [];
@ -1873,8 +1874,8 @@ class Listofworksstudentone extends Component {
}
// 设置数据
seacthdata = (teacherdata) => {
console.log("1326");
console.log(this.props.isNotMember());
// console.log("1326");
// console.log(this.props.isNotMember());
let datalist = [];
@ -2352,8 +2353,8 @@ class Listofworksstudentone extends Component {
if (work_efficiency === false) {
if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined||course_group_info === null){
//这里没有分班 没有 关卡得分 没有效率分
console.log("1739");
console.log(this.props.isNotMember());
// console.log("1739");
// console.log(this.props.isNotMember());
for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i];
@ -2389,8 +2390,8 @@ class Listofworksstudentone extends Component {
}else{
console.log("1767");
console.log(this.props.isNotMember());
// console.log("1767");
// console.log(this.props.isNotMember());
if(course_group_info.length < 2){
for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i];
@ -2427,8 +2428,8 @@ class Listofworksstudentone extends Component {
}
}else {
console.log("1795");
console.log(this.props.isNotMember());
// console.log("1795");
// console.log(this.props.isNotMember());
for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i];
@ -2461,8 +2462,8 @@ class Listofworksstudentone extends Component {
}
}
}else {
console.log("1821");
console.log(this.props.isNotMember());
// console.log("1821");
// console.log(this.props.isNotMember());
if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined || course_group_info === null){
@ -2497,8 +2498,8 @@ class Listofworksstudentone extends Component {
}else {
console.log("1849");
console.log(this.props.isNotMember());
// console.log("1849");
// console.log(this.props.isNotMember());
if(course_group_info.length < 2) {
for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i];
@ -2804,11 +2805,12 @@ class Listofworksstudentone extends Component {
this.setState({
modalname: "立即发布",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
svisible: true,
svisible: false,
OneSelftype:true,
Topval:"学生将立即收到作业",
// Botvalleft:"暂不发布",
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,
starttimes:starttime,
starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time,
@ -2840,6 +2842,7 @@ class Listofworksstudentone extends Component {
modalname: "立即截止",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
svisible: true,
OneSelftype:false,
Topval:"学生将不能再提交作业",
// Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`,
@ -2860,15 +2863,44 @@ class Listofworksstudentone extends Component {
// 立即发布
homeworkstartend = (ds,endtime) => {
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 url = "/courses/" + coursesId + "/homework_commons/publish_homework.json";
axios.post(url, {
homework_ids: [homeworkid],
group_ids: course_groupslist,
end_time:endtime,
}).then((result) => {
axios.post(url, data).then((result) => {
if (result) {
if (result.data.status === 0) {
notification.open({
@ -2943,6 +2975,7 @@ class Listofworksstudentone extends Component {
modalname: undefined,
modaltype: undefined,
svisible: false,
OneSelftype:false,
Topval: undefined,
Topvalright: undefined,
Botvalleft: undefined,
@ -3163,12 +3196,33 @@ class Listofworksstudentone extends Component {
</div>
: ""
}
{/*立即截止*/}
<HomeworkModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
visible={this.state.svisible}
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}
/>
{/*立即发布*/}
<HomeworkModal
<OneSelfOrderModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
visible={this.state.svisible}
OneSelftype={this.state.OneSelftype}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}

@ -62,9 +62,9 @@ class ShixunHomeworkPage extends Component {
}
Getdataback = (jobsettingsdata, teacherdata) => {
console.log("ShixunHomeworkPage56");
console.log(jobsettingsdata);
console.log(teacherdata);
// console.log("ShixunHomeworkPage56");
// console.log(jobsettingsdata);
// console.log(teacherdata);
this.setState({
jobsettingsdatapage: jobsettingsdata.data.message===undefined?jobsettingsdata:undefined,
@ -350,12 +350,7 @@ class ShixunHomeworkPage extends Component {
</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) === 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>:""}
@ -369,31 +364,3 @@ class ShixunHomeworkPage extends Component {
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 ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import DownloadMessageysl from '../../modals/DownloadMessageysl';
import NoneData from '../coursesPublic/NoneData';
import {
@ -422,7 +423,7 @@ class ShixunStudentWork extends Component {
this.setState({
modalname:"立即发布",
modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1,
visible:true,
OneSelftype:true,
Topval:"学生将立即收到作业",
// Botvalleft:"暂不发布",
Botval:`本操作只对"未发布"的分班有效`,
@ -476,15 +477,44 @@ class ShixunStudentWork extends Component {
// 立即发布
homeworkstartend=(ds,endtime)=>{
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 url ="/courses/"+coursesId+"/homework_commons/publish_homework.json";
axios.post(url,{
homework_ids:[homeworkid],
group_ids:course_groupslist,
end_time:endtime,
}).then((result)=>{
axios.post(url,data).then((result)=>{
if(result.status===200){
if(result.data.status===0){
notification.open({
@ -538,6 +568,7 @@ class ShixunStudentWork extends Component {
modalname:undefined,
modaltype:undefined,
visible:false,
OneSelftype:false,
Topval:undefined,
Topvalright:undefined,
Botvalleft:undefined,
@ -739,7 +770,7 @@ class ShixunStudentWork extends Component {
{/* {...this.props}*/}
{/* refs="DownloadMessage"*/}
{/*/>*/}
{/*立即发布*/}
{/*立即截止*/}
<HomeworkModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
@ -760,6 +791,29 @@ class ShixunStudentWork extends Component {
starttimesend={this.state.starttimesend}
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="edu-back-white">

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

@ -24,18 +24,21 @@ import {Link, Switch, Route, Redirect} from 'react-router-dom';
import moment from 'moment';
import 'moment/locale/zh-cn';
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 "../common/formCommon.css"
import '../css/Courses.css'
import './style.css'
import 'antd/lib/pagination/style/index.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 DownloadMessageysl from "../../modals/DownloadMessageysl";
const TextArea = Input.TextArea
//作业问答页面
@ -163,11 +166,11 @@ class Workquestionandanswer extends Component {
this.setState({
modalname: "立即发布",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
visible: true,
OneSelftype: true,
Topval: "学生将立即收到作业",
// Botvalleft:"暂不发布",
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,
Cancelname: "暂不发布",
Savesname: "立即发布",
@ -218,15 +221,43 @@ class Workquestionandanswer extends Component {
// 立即发布
homeworkstartend = (ds, endtime) => {
var homeworkid = this.props.match.params.homeworkid;
let {course_groupslist} = this.state;
let data={}
if(ds.length===0){
if(this.state.category.main===1){
data = {
homework_ids: [homeworkid],
end_time: endtime,
}
}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, {
homework_ids: [homeworkid],
group_ids: course_groupslist,
end_time: endtime,
}).then((result) => {
axios.post(url, data).then((result) => {
if (result.status === 200) {
if (result.data.status === 0) {
notification.open({
@ -335,6 +366,7 @@ class Workquestionandanswer extends Component {
addnametab: undefined,
typs: undefined,
starttimes: undefined,
OneSelftype:false,
})
}
getcourse_groupslist = (id) => {
@ -455,6 +487,28 @@ class Workquestionandanswer extends Component {
starttimesend={this.state.starttimesend}
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="edu-back-white" >

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

Loading…
Cancel
Save