courseware
dinglink 5 years ago
commit be13e5ca52

@ -18,19 +18,17 @@ class QuestionBanksController < ApplicationController
# 已认证才能获取题库 # 已认证才能获取题库
if @certification_teacher if @certification_teacher
sql = %Q{ sql = %Q{
#{@objects.table_name}.is_public = 1 and concat(#{@objects.table_name}.name, course_lists.name) like #{@objects.table_name}.is_public = 1 and concat(#{@objects.table_name}.name, course_lists.name) like :keyword
'%#{params[:search]}%' }
} @objects.joins(:course_list).where(sql, keyword: "%#{params[:search]}%")
@objects.joins(:course_list).where(sql)
else else
@objects.none @objects.none
end end
else else
sql = %Q{ sql = %Q{
#{@objects.table_name}.user_id = #{current_user.id} and concat(#{@objects.table_name}.name, course_lists.name) like #{@objects.table_name}.user_id = #{current_user.id} and concat(#{@objects.table_name}.name, course_lists.name) like :keyword
'%#{params[:search]}%' }
} @objects.joins(:course_list).where(sql, keyword: "%#{params[:search]}%")
@objects.joins(:course_list).where(sql)
end end
else else
if params[:filter] == 'public' if params[:filter] == 'public'

@ -769,7 +769,7 @@ function showcity(province, cityField) {
var cityOptions = new Array("福州","厦门","泉州","漳州","龙岩","南平","宁德","莆田","三明"); var cityOptions = new Array("福州","厦门","泉州","漳州","龙岩","南平","宁德","莆田","三明");
break; break;
case "甘肃": case "甘肃":
var cityOptions = new Array("兰州","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水","武都","武威","西峰","张掖"); var cityOptions = new Array("兰州","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水","陇南","武威","西峰","张掖");
break; break;
case "广西": case "广西":
var cityOptions = new Array("南宁","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林"); var cityOptions = new Array("南宁","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林");

@ -91,6 +91,7 @@
"react-router-dom": "^4.2.2", "react-router-dom": "^4.2.2",
"react-split-pane": "^0.1.89", "react-split-pane": "^0.1.89",
"react-url-query": "^1.4.0", "react-url-query": "^1.4.0",
"react-zmage": "^0.8.5-beta.31",
"redux": "^4.0.0", "redux": "^4.0.0",
"redux-thunk": "2.3.0", "redux-thunk": "2.3.0",
"rsuite": "^4.0.1", "rsuite": "^4.0.1",

@ -46,7 +46,11 @@ debugType = "admin";
// 老师 // 老师
// debugType="teacher"; // debugType="teacher";
// 学生 // 学生
<<<<<<< HEAD
//debugType="student"; //debugType="student";
=======
// debugType="student";
>>>>>>> 65f1f7ca73d06c88eeec624eaa865b259c525706

@ -524,8 +524,8 @@ const options = [{
value: '天水', value: '天水',
label: '天水' label: '天水'
},{ },{
value: '武都', value: '陇南',
label: '武都' label: '陇南'
},{ },{
value: '武威', value: '武威',
label: '武威' label: '武威'

@ -41,7 +41,7 @@ function ImageLayer2(props) {
}) })
return ( return (
<ImageLayer showImage={showImage} imageSrc={imageSrc} onImageLayerClose={onImageLayerClose}></ImageLayer> showImage?<ImageLayer showImage={showImage} imageSrc={imageSrc} onImageLayerClose={onImageLayerClose}></ImageLayer>:""
) )
} }

@ -107,6 +107,15 @@ class CommonWorkAppraise extends Component{
} }
gotoget_next_work=(id)=>{ gotoget_next_work=(id)=>{
if(this.props.match.path===`/classrooms/:coursesId/common_homework/:workId/:studentWorkId/appraise`){
this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`);
}
if(this.props.match.path===`/classrooms/:coursesId/group_homework/:workId/:studentWorkId/appraise`){
this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`);
}
if(this.props.match.path===`/classrooms/:coursesId/common_homeworks/:workId/:studentWorkId/appraise`){ if(this.props.match.path===`/classrooms/:coursesId/common_homeworks/:workId/:studentWorkId/appraise`){
this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`); this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`);
} }
@ -114,6 +123,7 @@ class CommonWorkAppraise extends Component{
if(this.props.match.path===`/classrooms/:coursesId/group_homeworks/:workId/:studentWorkId/appraise`){ if(this.props.match.path===`/classrooms/:coursesId/group_homeworks/:workId/:studentWorkId/appraise`){
this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`); this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`);
} }
this.setState({ this.setState({
get_next_worktype:false get_next_worktype:false
}) })

@ -547,8 +547,9 @@ class Trainingjobsetting extends Component {
} }
} else { } else {
//不是统一设置
//分班设置 //分班设置
// console.log("分班设置"); console.log("分班设置");
// console.log(this.$pollDetailTabForthRules); // console.log(this.$pollDetailTabForthRules);
const result=this.$pollDetailTabForthRules.notUnifiedSettingCheck(this.state.rules); const result=this.$pollDetailTabForthRules.notUnifiedSettingCheck(this.state.rules);
@ -561,11 +562,79 @@ class Trainingjobsetting extends Component {
return false; return false;
} }
let rulesdata = this.state.rulesdata; let rulesdata = this.state.rulesdata;
if (rulesdata.length === 0) { if (rulesdata.length === 0) {
this.props.showNotification(`分班发布设置不能为空`); this.props.showNotification(`分班发布设置不能为空`);
return; return;
} }
} }
}else{
// console.log("分班设置");
var mylate_times=false;
if (this.state.unifiedsetting === false) {
///非统一设置
let rulesdata = this.state.rulesdata;
//开启了补交
if(this.state.allowreplenishment===true){
//补交结束时间不为空
if(this.state.late_time){
// 分班设置数组不为空
if(rulesdata){
for(var i=0;i<rulesdata.length-1;i++){
let item=rulesdata[i];
if(item.end_time!=="Invalid date"){
let emdtimes=null;
try {
emdtimes= moment(item.end_time, "YYYY-MM-DD HH:mm")
}catch (e) {
}
if(emdtimes){
if(moment(this.state.late_time, "YYYY-MM-DD HH:mm") <= emdtimes){
mylate_times=true;
let kus=i+1;
this.setState({
hand__e_tip: "补交时间必须晚于发布规则" +kus+ "的截止时间",
hand_flags: true,
handclass: "bor-reds",
});
this.props.showNotification(`补交结束时间必须晚于截止时间`);
break;
}else{
mylate_times=false;
this.setState({
hand__e_tip: "",
hand_flags: false,
handclass: undefined,
})
}
}
}
}
}
}
}
if(mylate_times){
this.scrollToAnchor("late_timeids");
return
}
}else{
///统一设置
}
} }
@ -787,22 +856,27 @@ class Trainingjobsetting extends Component {
// console.log(JSON.stringify(data)); // console.log(JSON.stringify(data));
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status == 0) { if(result){
// console.log(JSON.stringify(result)); if(result.data){
this.getTrainingjobsetting(true); if (result.data.status == 0) {
this.props.showNotification(`更新成功`); // console.log(JSON.stringify(result));
this.setState({ this.getTrainingjobsetting(true);
flagPageEditsbox: false, this.props.showNotification(`更新成功`);
flagPageEdit: false, this.setState({
flagPageEditstwo: false, flagPageEditsbox: false,
flagPageEditsthrees: false, flagPageEdit: false,
flagPageEditsfor: false, flagPageEditstwo: false,
whethertopay: false, flagPageEditsthrees: false,
completionefficiencyscore: false, flagPageEditsfor: false,
}) whethertopay: false,
this.refs.targetElementTrainingjobsetting.scrollIntoView() completionefficiencyscore: false,
})
this.refs.targetElementTrainingjobsetting.scrollIntoView()
}
}
} }
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
}) })
@ -2577,7 +2651,7 @@ class Trainingjobsetting extends Component {
</div> </div>
{/*补交设置*/} {/*补交设置*/}
<div className="stud-class-set bor-bottom-greyE edu-back-white"> <div className="stud-class-set bor-bottom-greyE edu-back-white" id={"late_timeids"}>
<div className=" clearfix edu-back-white poll_list mt10"> <div className=" clearfix edu-back-white poll_list mt10">
<div className={"font-16 color-dark fl pl20 mt10 "} style={{color: "#05101A"}}>补交设置</div> <div className={"font-16 color-dark fl pl20 mt10 "} style={{color: "#05101A"}}>补交设置</div>
</div> </div>
@ -2660,7 +2734,7 @@ class Trainingjobsetting extends Component {
<p className="color-red lineh-25 clearfix ml70" style={{height: "25px"}}> <p className="color-red lineh-25 clearfix ml70" style={{height: "25px"}}>
{ {
this.state.hand__e_tip && this.state.hand__e_tip != "" ? this.state.hand__e_tip && this.state.hand__e_tip != "" ?
<span className="fl">{this.state.hand__e_tip}</span> : "" <span className="fl ml10">{this.state.hand__e_tip}</span> : ""
} }
</p> </p>
</div> </div>
@ -2929,75 +3003,3 @@ class Trainingjobsetting extends Component {
} }
export default Trainingjobsetting; export default Trainingjobsetting;
// <div className="stud-class-set bor-bottom-greyE ">
// <div className=" clearfix edu-back-white poll_list">
// <a onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
// <a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
// {this.props.isAdmin()?this.state.code_review===true||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"?"": <a onClick={(e)=>this.ChangeTab(2)}>代码查重</a> : ""}
// <style>{
// `
// .poll_list a.active:after {
// content: '';
// width: 57px;
// left: 10px;
// bottom: 0px;
// height: 2px;
// background-color: #4CACFF;
// position: absolute;
// }
// `
// }</style>
// <a className="active"
// onClick={(e)=>this.ChangeTab(3)}
// >设置</a>
// <style>{`
// .drop_down_menu li a {
// padding: 0px;
// font-size: 14px;
// }
// .drop_down_menu {
// width: 93px;
// }
// .drop_down_menu li {
// overflow: visible;
// width: 93px;
// }
// .drop_down_menu, .drop_down_normal {
// padding-top: 10px;
// padding-bottom: 8px;
// }
// a:hover {
// color:#1A0B00 !important;
// }
// `}</style>
// {this.props.isAdmin() ? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}>
// 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
// <ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
// <li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>
// </li>
// <li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>
// </li>
// </ul>
// </li>: ""}
// {this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.end_immediately===true?
// <a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
// : "": ""}
// {this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.publish_immediately===true?
// <a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>: "" : ""}
// {this.props.isAdmin()?
// jobsettingsdata&&jobsettingsdata.data.code_review===true?
// <a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>: "":""}
// {
// jobsettingsdata&& jobsettingsdata&&jobsettingsdata.data === undefined ? ""
// : jobsettingsdata&& jobsettingsdata.data.commit_des === null || jobsettingsdata&& jobsettingsdata.data.commit_des === undefined ? "" :
// <a className="fr color-blue font-16"
// href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${ jobsettingsdata&& jobsettingsdata.data === undefined ? "" : jobsettingsdata&& jobsettingsdata.data.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{ jobsettingsdata&& jobsettingsdata.data.commit_des}</a>
// }
// { jobsettingsdata&&jobsettingsdata.data === undefined ? "" : <Startshixuntask
// {...this.props}
// data={ jobsettingsdata&& jobsettingsdata.data}
// />}
{/* </div>*/
}
{/*</div>*/
}

@ -1,14 +1,27 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactDOM from 'react-dom' import ReactDOM from 'react-dom'
import { Redirect } from 'react-router'; import { Button,Icon} from 'antd';
import PropTypes from 'prop-types';
import Rate from 'rc-rate';
import './TaskResultLayer.css' import './TaskResultLayer.css'
class ImageLayer extends Component { class ImageLayer extends Component {
constructor(props) {
super(props);
this.state = {
visible: false,
previewImage: '',
current: 90,
transStyle: ''
}
}
translate = () => {
this.setState({
current:(this.state.current+90)%360,
transStyle:'rotate('+this.state.current+'deg)'
});
}
render() { render() {
let { showImage, imageSrc, onImageLayerClose } = this.props; let { showImage, imageSrc, onImageLayerClose } = this.props;
@ -17,10 +30,34 @@ class ImageLayer extends Component {
return ReactDOM.createPortal( return ReactDOM.createPortal(
<div> <div>
{showImage ? {showImage ?
<div className="taskResultLayer" onClick={onImageLayerClose} style={{overflow: 'auto'}}> <div className="taskResultLayer">
<div className="passContent"> <div className={"ImageLayerbutton mt20"}>
<img src={ imageSrc } className="passImg" unselectable="on" alt=""/> <Button
</div> className={"fr"}
onClick={()=>this.props.onImageLayerClose()}
>
关闭<Icon type="close" />
</Button>
<Button
href={imageSrc}
className={"fr mr10"}
>
下载<Icon type="vertical-align-bottom" />
</Button>
<Button
onClick = {()=>this.translate()}
className={"fr mr10"}
>
旋转<Icon type="reload" theme="outlined" />
</Button>
</div>
<div className="passContent" style={{ transform:this.state.transStyle}}>
<img src={imageSrc} className="passImg" unselectable="on" alt=""/>
</div>
</div> </div>
: :
<div></div> <div></div>

@ -40,7 +40,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
display: -webkit-flex; display: -webkit-flex;
height: 100%; height: 90%;
text-align: center; text-align: center;
} }
.passImg{ .passImg{
@ -138,3 +138,10 @@
.vertical4{ .vertical4{
vertical-align: -4px; vertical-align: -4px;
} }
.ImageLayerbutton{
position: absolute;
top: 0px;
right: 10px;
z-index: 10;
}
Loading…
Cancel
Save