courseware
dinglink 5 years ago
commit be13e5ca52

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

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

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

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

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

@ -41,7 +41,7 @@ function ImageLayer2(props) {
})
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)=>{
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`){
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`){
this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`);
}
this.setState({
get_next_worktype:false
})

@ -547,8 +547,9 @@ class Trainingjobsetting extends Component {
}
} else {
//不是统一设置
//分班设置
// console.log("分班设置");
console.log("分班设置");
// console.log(this.$pollDetailTabForthRules);
const result=this.$pollDetailTabForthRules.notUnifiedSettingCheck(this.state.rules);
@ -561,13 +562,81 @@ class Trainingjobsetting extends Component {
return false;
}
let rulesdata = this.state.rulesdata;
if (rulesdata.length === 0) {
this.props.showNotification(`分班发布设置不能为空`);
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{
///统一设置
}
}
if (this.state.allowreplenishment === true) {
if (this.state.latededuction === undefined) {
@ -787,6 +856,8 @@ class Trainingjobsetting extends Component {
// console.log(JSON.stringify(data));
axios.post(url, data)
.then((result) => {
if(result){
if(result.data){
if (result.data.status == 0) {
// console.log(JSON.stringify(result));
this.getTrainingjobsetting(true);
@ -801,8 +872,11 @@ class Trainingjobsetting extends Component {
completionefficiencyscore: false,
})
this.refs.targetElementTrainingjobsetting.scrollIntoView()
}
}
}
}).catch((error) => {
console.log(error);
})
@ -2577,7 +2651,7 @@ class Trainingjobsetting extends Component {
</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={"font-16 color-dark fl pl20 mt10 "} style={{color: "#05101A"}}>补交设置</div>
</div>
@ -2660,7 +2734,7 @@ class Trainingjobsetting extends Component {
<p className="color-red lineh-25 clearfix ml70" style={{height: "25px"}}>
{
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>
</div>
@ -2929,75 +3003,3 @@ class Trainingjobsetting extends Component {
}
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 ReactDOM from 'react-dom'
import { Redirect } from 'react-router';
import PropTypes from 'prop-types';
import Rate from 'rc-rate';
import { Button,Icon} from 'antd';
import './TaskResultLayer.css'
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() {
let { showImage, imageSrc, onImageLayerClose } = this.props;
@ -17,10 +30,34 @@ class ImageLayer extends Component {
return ReactDOM.createPortal(
<div>
{showImage ?
<div className="taskResultLayer" onClick={onImageLayerClose} style={{overflow: 'auto'}}>
<div className="passContent">
<div className="taskResultLayer">
<div className={"ImageLayerbutton mt20"}>
<Button
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>

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