diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js
index e69cdb4d5..a2f57a8e1 100644
--- a/public/react/src/modules/courses/Resource/Fileslistitem.js
+++ b/public/react/src/modules/courses/Resource/Fileslistitem.js
@@ -38,14 +38,10 @@ class Fileslistitem extends Component{
if(result.data.attachment_histories.length===0){
let link = document.createElement('a');
- // link.href = window.URL.createObjectURL(new Blob([result.data.url]));
+ document.body.appendChild(link);
link.href = result.data.url;
- let filesname=encodeURIComponent(result.data.title)
- console.log(result.data.title)
- link.download = decodeURIComponent(filesname)
+ link.download = result.data.title;
//兼容火狐浏览器
- console.log(result.data.title)
- document.body.appendChild(link);
let evt = document.createEvent("MouseEvents");
evt.initEvent("click", false, false);
link.dispatchEvent(evt);
@@ -300,7 +296,7 @@ class Fileslistitem extends Component{
:""}
- {this.props.current_user.login===discussMessage.author.login?
+ {this.props.isStudent===true&&this.props.current_user.login===discussMessage.author.login?
diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js
index 07731686e..8ce285ae1 100644
--- a/public/react/src/modules/courses/Resource/index.js
+++ b/public/react/src/modules/courses/Resource/index.js
@@ -7,11 +7,12 @@ import Sendtofilesmodal from "../coursesPublic/SendToFilesModal";
import Selectresource from "../coursesPublic/SelectResource";
import Sendresource from "../coursesPublic/sendResource";
import Selectsetting from "../coursesPublic/SelectSetting";
-import CourseLayoutcomponent from '../common/CourseLayoutComponent';
+import HomeworkModal from "../coursesPublic/HomeworkModal";
import Fileslistitem from './Fileslistitem';
import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
import './style.css';
import '../css/members.css';
+import moment from 'moment';
class Fileslists extends Component{
constructor(props){
@@ -232,7 +233,9 @@ class Fileslists extends Component{
this.props.showNotification("请先在列表中选择要发送的资源");
}else if(value===3){
this.props.showNotification("请先在列表中选择要公开的资源");
- }
+ }else if(value===4){
+ this.props.showNotification("请先在列表中选择要发布的资源");
+ }
}
onDelete = () => {
@@ -549,7 +552,78 @@ class Fileslists extends Component{
})
}
+ homeworkstart=()=>{
+ let selectnum= this.testonSelect();
+ if(selectnum===true){
+ this.noSelect(4);
+ return
+ }
+ let starttime= this.props.getNowFormatDates(1);
+ let endtime=this.props.getNowFormatDates(2);
+ this.setState({
+ modalname:"立即发布",
+ visible:true,
+ typs:"start",
+ Topval:"学生将能立即查看和下载发布资源",
+ // Botvalleft:"暂不发布",
+ // Botval:`本操作只对"未发布"的分班有效`,
+ // starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
+ // starttimes:starttime,
+ // endtime:"截止时间:"+endtime,
+ Cancelname:"暂不发布",
+ Savesname:"立即发布",
+ Cancel:this.homeworkhide,
+ Saves:this.homeworkstartend,
+ })
+ }
+ // 立即发布
+ homeworkstartend=(ds,endtime)=>{
+ let {checkBoxValues}=this.state;
+ let coursesId=this.props.match.params.coursesId;
+ let url ="/files/bulk_publish.json";
+ axios.put(url, {
+ course_id:coursesId,
+ ids :checkBoxValues,
+ }).then((result)=>{
+ if(result.status===200){
+ this.props.showNotification("发布成功")
+ this.setState({
+ checkBoxValues:[],
+ checkAllValue:false
+ })
+ this.homeworkhide()
+ this.props.updataleftNavfun()
+ this.updatafiled()
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+ }
+
+ homeworkhide=()=>{
+ this.setState({
+ modalname:undefined,
+ modaltype:undefined,
+ visible:false,
+ Topval:undefined,
+ Topvalright:undefined,
+ Botvalleft:undefined,
+ Botval:undefined,
+ starttime:undefined,
+ endtime:undefined,
+ Cancelname:undefined,
+ Savesname:undefined,
+ Cancel:undefined,
+ Saves:undefined,
+ StudentList_value:undefined,
+ addname:undefined,
+ addnametype:false,
+ addnametab:undefined,
+ typs:undefined,
+ starttimes:undefined,
+ })
+ }
render(){
let { searchValue,
@@ -582,6 +656,26 @@ class Fileslists extends Component{
return(
+ {/*立即发布*/}
+ {this.state.visible===true?:""}
{/*发送*/}
{this.props.isAdmin()?删除:""}
{this.props.isAdmin()?发送:""}
- {/*{this.props.isAdmin()?*/}
- {/*立即发布*/}
- {/*:""}*/}
+ {this.props.isAdmin()?
+ 立即发布
+ :""}
{this.props.isAdmin()?course_is_public===true?
设为公开
:"":""}
diff --git a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js
index bc2fb60b5..440d8893c 100644
--- a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js
+++ b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js
@@ -88,25 +88,30 @@ class HomeworkModal extends Component{
propsSaves=(ds,endtime)=>{
- if(this.props.typs!="end"){
- if(endtime === ""||endtime===undefined||endtime===null){
+ if(ds.length ===0&&endtime === ""){
+ this.props.Saves()
+ }else{
+ if(this.props.typs!="end"){
+ if(endtime === ""||endtime===undefined||endtime===null){
- this.setState({
- endtimetype:true,
- endtimetypevalue:"截止时间不能为空"
- })
- return
- }
+ this.setState({
+ endtimetype:true,
+ endtimetypevalue:"截止时间不能为空"
+ })
+ return
+ }
- if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttimes,"YYYY-MM-DD HH:mm")){
- this.setState({
- endtimetype:true,
- endtimetypevalue:"必须晚于发布时间"
- })
- return
+ if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttimes,"YYYY-MM-DD HH:mm")){
+ this.setState({
+ endtimetype:true,
+ endtimetypevalue:"必须晚于发布时间"
+ })
+ return
+ }
}
+ 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"))
+
}
diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js
index d07258ab3..1e151b654 100644
--- a/public/react/src/modules/courses/exercise/Exercisesetting.js
+++ b/public/react/src/modules/courses/exercise/Exercisesetting.js
@@ -131,9 +131,9 @@ class Exercisesetting extends Component{
// end_timetype:false
// })
// }else{
- this.setState({
- end_timetype:true
- })
+ // this.setState({
+ // end_timetype:true
+ // })
// }
}
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js
index 67f1ed656..342fef706 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworks.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js
@@ -1441,7 +1441,7 @@ class Listofworks extends Component {
作业问答
{this.props.isAdmin() ?
- this.state.code_review === true ? "" :
代码查重 : ""}
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index cac639d13..759b936ae 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -752,11 +752,12 @@ class Listofworksstudentone extends Component {
}
setComputeTime=()=>{
+ let {teacherdata}=this.state;
this.setState({
computeTimetype:false
})
let homeworkid = this.props.match.params.homeworkid;
- let url = "/homework_commons/"+homeworkid+"/update_student_score.json";
+ let url = "/homework_commons/"+homeworkid+"/update_student_score.json?shixun_id="+teacherdata.shixun_id;
axios.get(url).then((response) => {
this.props.showNotification(`${response.data.message}`);
@@ -929,13 +930,13 @@ class Listofworksstudentone extends Component {
计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}
-
+ {teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":
{computeTimetype===true?
计算成绩
:
计算成绩
}
-
+ }
@@ -1083,22 +1084,61 @@ class Listofworksstudentone extends Component {
{teacherdata.left_time.time}}
+
+
+
-
-
-
计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}
-
+ 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}
+ {teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":
{computeTimetype===true?
计算成绩
:
计算成绩
}
-
-
-
-
-
+ }
+
{/*因为计算按钮占了和这个位置,和设计沟通学生视角取消这个按钮*/}
{/**/}
{/*
*/}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
index c7ae7292d..7188c65bd 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
@@ -94,7 +94,6 @@ class ShixunStudentWork extends Component {
let url = "/homework_commons/" + homeworkid + "/code_review_results.json";
axios.get(url).then((response) => {
- debugger
if (response.data.status === undefined || response.data.status === 0) {
if(response.data!=undefined){
if(response.data.status!=-2){
@@ -688,6 +687,7 @@ class ShixunStudentWork extends Component {
分班情况:
@@ -756,7 +756,7 @@ class ShixunStudentWork extends Component {
dataSource={datalist}
columns={columns}
pagination={{ //分页
- total: data&&data.all_reviews_count, //数据总数量
+ total: datalist.length===0?0:data&&data.all_reviews_count, //数据总数量
pageSize: 10, //显示几条一页
current:page,
}}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js
index ba3eea530..c1233ed3f 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js
@@ -51,13 +51,17 @@ class ShixunWorkDetails extends Component {
})
}
- goback=()=>{
- window.history.go(-1)
+ goback=(sum)=>{
+ let{data}=this.state
+ if(sum===1){
+ window.location.href = "/courses/"+data.course_id+"/students";
+ }else{
+ window.history.go(-1)
+ }
+
}
render() {
-
let{data}=this.state;
- console.log(data)
return (
{data===undefined? "":
@@ -65,17 +69,18 @@ class ShixunWorkDetails extends Component {
-
-
- {data&&data.course_name}
-
-
+ this.goback(1)}
+ >
+ {data&&data.course_name}123
+
>
-
-
+
实训作业
-
-
+
>
{data&&data.username}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
index aaf02498b..5731c3b73 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
@@ -360,7 +360,7 @@ class ShixunhomeWorkItem extends Component{
{this.props.isAdmin?
:""}
diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
index 715ffb7e8..5a4ad673c 100644
--- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
+++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js
@@ -221,7 +221,7 @@ class ShixunWorkModal extends Component{
let {course_groups,group_ids,onChangetype,group_list}=this.state;
// let {data}=this.props;
// console.log(group_list)
- // console.log(course_groups)
+ console.log(group_list)
return(
:
- group_list&&group_list.map((item,key)=>{
+ group_list&&group_list.length===0?"":group_list[0]===undefined?"":group_list.map((item,key)=>{
return(
item.work_count===0?"":
-
diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
index 8837b83c3..362e3dc40 100644
--- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
+++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
@@ -1676,7 +1676,7 @@ class Trainingjobsetting extends Component {
}
作业问答
- {this.props.isAdmin()?this.state.code_review===true?"": 代码查重 : ""}