From 603b3dd270384018cc93f127ba5153f18dbac4e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Mon, 23 Mar 2020 11:51:31 +0800
Subject: [PATCH 1/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9F=8E=E5=B8=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/javascripts/educoder/edu_application.js | 4 ++--
public/react/src/common/components/form/City.js | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/public/javascripts/educoder/edu_application.js b/public/javascripts/educoder/edu_application.js
index d11511c63..e18c15930 100644
--- a/public/javascripts/educoder/edu_application.js
+++ b/public/javascripts/educoder/edu_application.js
@@ -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("南宁","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林");
@@ -1267,7 +1267,7 @@ function opClickString(item) {
operationItem = item
// setTimeout(function(){ $(item).css('background', '#4CACFF');$(item).html(value); }, 4000)
}
-//
+//
// var isOperationSending = false;
$(document).bind('ajaxStop', function(event, xhr, settings) {
if (settings && settings.url && (settings.url.match(/operation\?/))) {
diff --git a/public/react/src/common/components/form/City.js b/public/react/src/common/components/form/City.js
index 5ee0c080b..e5346ba3e 100644
--- a/public/react/src/common/components/form/City.js
+++ b/public/react/src/common/components/form/City.js
@@ -524,8 +524,8 @@ const options = [{
value: '天水',
label: '天水'
},{
- value: '武都',
- label: '武都'
+ value: '陇南',
+ label: '陇南'
},{
value: '武威',
label: '武威'
From 96928934cf5b6b9cc7fdb0a3f90a27ad4460917a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Mon, 23 Mar 2020 17:48:23 +0800
Subject: [PATCH 2/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=84=E9=98=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/package.json | 1 +
public/react/src/AppConfig.js | 2 +-
.../src/modules/courses/busyWork/CommonWorkAppraise.js | 10 ++++++++++
public/react/src/modules/page/layers/ImageLayer.js | 10 +++-------
4 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/public/react/package.json b/public/react/package.json
index e21a44df3..47e7ecddd 100644
--- a/public/react/package.json
+++ b/public/react/package.json
@@ -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",
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js
index 5182cb991..2d04baa58 100644
--- a/public/react/src/AppConfig.js
+++ b/public/react/src/AppConfig.js
@@ -46,7 +46,7 @@ debugType = "admin";
// 老师
// debugType="teacher";
// 学生
- debugType="student";
+// debugType="student";
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js
index 75fbaaab4..db06f0166 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js
@@ -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
})
diff --git a/public/react/src/modules/page/layers/ImageLayer.js b/public/react/src/modules/page/layers/ImageLayer.js
index b1adc5b6b..af9359fe4 100644
--- a/public/react/src/modules/page/layers/ImageLayer.js
+++ b/public/react/src/modules/page/layers/ImageLayer.js
@@ -1,22 +1,18 @@
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 './TaskResultLayer.css'
class ImageLayer extends Component {
-
+
render() {
let { showImage, imageSrc, onImageLayerClose } = this.props;
-
+
// 语法介绍 https://reactjs.org/docs/portals.html
// 将html渲染都指定的element下
return ReactDOM.createPortal(
- {showImage ?
+ {showImage ?
From c36be3f87f192497998f12eef08588da3a8fffcb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 23 Mar 2020 18:25:43 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../shixunHomework/Trainingjobsetting.js | 178 +++++++++---------
1 file changed, 89 insertions(+), 89 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
index e14ad1408..6f41869ef 100644
--- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
+++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
@@ -329,6 +329,7 @@ class Trainingjobsetting extends Component {
//跳转道描点的地方
scrollToAnchor = (anchorName) => {
+ debugger
if (anchorName) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
@@ -547,8 +548,9 @@ class Trainingjobsetting extends Component {
}
} else {
+ //不是统一设置
//分班设置
- // console.log("分班设置");
+ console.log("分班设置");
// console.log(this.$pollDetailTabForthRules);
const result=this.$pollDetailTabForthRules.notUnifiedSettingCheck(this.state.rules);
@@ -561,11 +563,76 @@ 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;
+ // console.log(rulesdata);
+ //开启了补交
+ if(this.state.allowreplenishment===true){
+ //补交结束时间不为空
+ if(this.state.late_time){
+ // 分班设置数组不为空
+ if(rulesdata){
+ for(var i=0;i
{
- if (result.data.status == 0) {
- // console.log(JSON.stringify(result));
- this.getTrainingjobsetting(true);
- this.props.showNotification(`更新成功`);
- this.setState({
- flagPageEditsbox: false,
- flagPageEdit: false,
- flagPageEditstwo: false,
- flagPageEditsthrees: false,
- flagPageEditsfor: false,
- whethertopay: false,
- completionefficiencyscore: false,
- })
- this.refs.targetElementTrainingjobsetting.scrollIntoView()
+ if(result){
+ if(result.data){
+ if (result.data.status == 0) {
+ // console.log(JSON.stringify(result));
+ this.getTrainingjobsetting(true);
+ this.props.showNotification(`更新成功`);
+ this.setState({
+ flagPageEditsbox: false,
+ flagPageEdit: false,
+ flagPageEditstwo: false,
+ flagPageEditsthrees: false,
+ flagPageEditsfor: false,
+ whethertopay: false,
+ completionefficiencyscore: false,
+ })
+ this.refs.targetElementTrainingjobsetting.scrollIntoView()
+ }
+ }
}
+
}).catch((error) => {
console.log(error);
})
@@ -2577,7 +2649,7 @@ class Trainingjobsetting extends Component {
{/*补交设置*/}
-
+
@@ -2660,7 +2732,7 @@ class Trainingjobsetting extends Component {
{
this.state.hand__e_tip && this.state.hand__e_tip != "" ?
- {this.state.hand__e_tip} : ""
+ {this.state.hand__e_tip} : ""
}
@@ -2929,75 +3001,3 @@ class Trainingjobsetting extends Component {
}
export default Trainingjobsetting;
-//
-//
-//
this.ChangeTab(0)}>作品列表
-//
this.ChangeTab(1)}>作业问答
-// {this.props.isAdmin()?this.state.code_review===true||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"?"":
this.ChangeTab(2)}>代码查重 : ""}
-//
-//
this.ChangeTab(3)}
-// >设置
-//
-// {this.props.isAdmin() ?
-// 导出
-//
-// : ""}
-// {this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.end_immediately===true?
-//
立即截止
-// : "": ""}
-// {this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.publish_immediately===true?
-//
立即发布: "" : ""}
-// {this.props.isAdmin()?
-// jobsettingsdata&&jobsettingsdata.data.code_review===true?
-//
代码查重: "":""}
-// {
-// jobsettingsdata&& jobsettingsdata&&jobsettingsdata.data === undefined ? ""
-// : jobsettingsdata&& jobsettingsdata.data.commit_des === null || jobsettingsdata&& jobsettingsdata.data.commit_des === undefined ? "" :
-//
{ jobsettingsdata&& jobsettingsdata.data.commit_des}
-// }
-// { jobsettingsdata&&jobsettingsdata.data === undefined ? "" :
}
-{/*
*/
-}
-{/*
*/
-}
From 3480de8929cac55f6a4d2c1c49c8553a32153607 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 23 Mar 2020 18:26:58 +0800
Subject: [PATCH 4/6] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../shixunHomework/Trainingjobsetting.js | 40 ++++++++++---------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
index 6f41869ef..64a956d28 100644
--- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
+++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
@@ -329,7 +329,6 @@ class Trainingjobsetting extends Component {
//跳转道描点的地方
scrollToAnchor = (anchorName) => {
- debugger
if (anchorName) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
@@ -579,7 +578,6 @@ class Trainingjobsetting extends Component {
if (this.state.unifiedsetting === false) {
///非统一设置
let rulesdata = this.state.rulesdata;
- // console.log(rulesdata);
//开启了补交
if(this.state.allowreplenishment===true){
//补交结束时间不为空
@@ -595,25 +593,29 @@ class Trainingjobsetting extends Component {
}catch (e) {
}
- if(moment(this.state.late_time, "YYYY-MM-DD HH:mm") <= emdtimes){
- this.props.showNotification(`补交结束时间必须晚于截止时间`);
- mylate_times=true;
- let kus=i+1;
- this.setState({
- hand__e_tip: "补交时间必须晚于发布规则" +kus+ "的截止时间",
- hand_flags: true,
- handclass: "bor-reds",
- });
- break;
- }else{
- mylate_times=false;
- this.setState({
- hand__e_tip: "",
- hand_flags: false,
- handclass: undefined,
- })
+ 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,
+ })
+ }
}
+
+
}
}
}
From 963bb9063c760dd795e82b48d51c3aaad00356bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Mon, 23 Mar 2020 20:24:06 +0800
Subject: [PATCH 5/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=84=E9=98=85?=
=?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=9B=BE=E7=89=87=E4=BA=A4=E4=BA=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/AppConfig.js | 2 +-
public/react/src/common/hooks/ImageLayer2.js | 6 +--
.../src/modules/page/layers/ImageLayer.js | 51 +++++++++++++++++--
.../modules/page/layers/TaskResultLayer.css | 11 +++-
4 files changed, 59 insertions(+), 11 deletions(-)
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js
index 5182cb991..2d04baa58 100644
--- a/public/react/src/AppConfig.js
+++ b/public/react/src/AppConfig.js
@@ -46,7 +46,7 @@ debugType = "admin";
// 老师
// debugType="teacher";
// 学生
- debugType="student";
+// debugType="student";
diff --git a/public/react/src/common/hooks/ImageLayer2.js b/public/react/src/common/hooks/ImageLayer2.js
index 202a7f343..504e491ca 100644
--- a/public/react/src/common/hooks/ImageLayer2.js
+++ b/public/react/src/common/hooks/ImageLayer2.js
@@ -18,8 +18,8 @@ function ImageLayer2(props) {
const fileName = event.target.innerHTML.trim()
if (isImageExtension((imageSrc && imageSrc.trim())) || isImageExtension(fileName) || event.target.tagName == 'IMG' || (imageSrc && imageSrc.indexOf('base64,')) != -1) {
// 非回复里的头像图片; 非emoticons
- if (imageSrc.indexOf('/images/avatars/User') === -1 &&
- imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {
+ if (imageSrc.indexOf('/images/avatars/User') === -1 &&
+ imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {
setShowImage(true)
setImageSrc(imageSrc)
}
@@ -41,7 +41,7 @@ function ImageLayer2(props) {
})
return (
-
+ showImage?
:""
)
}
diff --git a/public/react/src/modules/page/layers/ImageLayer.js b/public/react/src/modules/page/layers/ImageLayer.js
index af9359fe4..17f40bdf9 100644
--- a/public/react/src/modules/page/layers/ImageLayer.js
+++ b/public/react/src/modules/page/layers/ImageLayer.js
@@ -1,10 +1,27 @@
import React, { Component } from 'react';
import ReactDOM from 'react-dom'
-
+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;
@@ -13,10 +30,34 @@ class ImageLayer extends Component {
return ReactDOM.createPortal(
{showImage ?
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
:
diff --git a/public/react/src/modules/page/layers/TaskResultLayer.css b/public/react/src/modules/page/layers/TaskResultLayer.css
index 25f570a56..962aed0db 100644
--- a/public/react/src/modules/page/layers/TaskResultLayer.css
+++ b/public/react/src/modules/page/layers/TaskResultLayer.css
@@ -7,7 +7,7 @@
background:rgba(0,0,0,0.8);
top: 0px;
overflow: hidden;
-}
+}
.taskResultLayer .closeIcon{
position: absolute;
right: 100px;
@@ -40,7 +40,7 @@
justify-content: center;
align-items: center;
display: -webkit-flex;
- height: 100%;
+ height: 90%;
text-align: center;
}
.passImg{
@@ -137,4 +137,11 @@
.vertical4{
vertical-align: -4px;
+}
+
+.ImageLayerbutton{
+ position: absolute;
+ top: 0px;
+ right: 10px;
+ z-index: 10;
}
\ No newline at end of file
From 9cec7861156ce010b53eb8b2edd6d10de560972a Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Mon, 23 Mar 2020 22:31:21 +0800
Subject: [PATCH 6/6] =?UTF-8?q?=E9=A2=98=E5=BA=93=E5=88=97=E8=A1=A8SQL?=
=?UTF-8?q?=E6=B3=A8=E5=85=A5=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/question_banks_controller.rb | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb
index af6305a64..2ad815fc9 100644
--- a/app/controllers/question_banks_controller.rb
+++ b/app/controllers/question_banks_controller.rb
@@ -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.joins(:course_list).where(sql)
+ #{@objects.table_name}.is_public = 1 and concat(#{@objects.table_name}.name, course_lists.name) like :keyword
+ }
+ @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.joins(:course_list).where(sql)
+ #{@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, keyword: "%#{params[:search]}%")
end
else
if params[:filter] == 'public'