From 01489d7f0fa220fa127563c58ad6a4cad5237347 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Mon, 19 Aug 2019 20:41:48 +0800
Subject: [PATCH 01/60] =?UTF-8?q?=E6=A0=BC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../react/src/modules/user/usersInfo/video/VideoUploadList.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js
index dcf195deb..178580c8a 100644
--- a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js
+++ b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js
@@ -423,7 +423,7 @@ function VideoUploadList (props) {
{/* windows video/* 不管用 TODO */}
)
From bb1e7616b953d907963dec8a4174862564b83ff4 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 20 Aug 2019 09:35:14 +0800
Subject: [PATCH 02/60] =?UTF-8?q?=E9=87=91=E8=AF=BE=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/subjects_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb
index ac5bd027f..5389ff961 100644
--- a/app/controllers/subjects_controller.rb
+++ b/app/controllers/subjects_controller.rb
@@ -1,7 +1,7 @@
class SubjectsController < ApplicationController
before_action :require_login, :check_auth, except: [:index, :show, :right_banner]
# before_action :check_auth, except: [:index]
- before_action :check_account, except: [:index, :show]
+ before_action :check_account, except: [:index, :show, :right_banner]
before_action :find_subject, except: [:index, :create, :new, :append_to_stage]
before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish,
:search_members, :add_subject_members, :statistics, :shixun_report, :school_report,
From ee2547d0151bc185e774b2df3786db829097ba2d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Tue, 20 Aug 2019 09:37:46 +0800
Subject: [PATCH 03/60] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/paths/PathDetail/PathDetailIndex.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
index 0e4a581a3..d64763980 100644
--- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
+++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
@@ -476,7 +476,7 @@ class PathDetailIndex extends Component{
}
{
- this.props.checkIfLogin()===false?"123213":progress === undefined ? "" : progress === null ? "" :
+ this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" :
我的进展
From a6076a4ecf2a46bc579fcb536784e62022ae565a Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 20 Aug 2019 09:50:57 +0800
Subject: [PATCH 04/60] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index aaf24eadb..d97c26127 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -12,7 +12,7 @@ class CoursesController < ApplicationController
end
before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
- :left_banner, :top_banner]
+ :left_banner, :top_banner, :informs, :online_learning]
before_action :check_account, only: [:new, :create, :apply_to_join_course, :join_excellent_course]
before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
:left_banner, :top_banner, :apply_to_join_course, :exit_course]
From 28280a7d7da14df231d8192e1dd89c772fa8a5df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 20 Aug 2019 10:04:46 +0800
Subject: [PATCH 05/60] Merge branches 'dev_Ysm' and 'dev_admin' of
https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl
# Conflicts:
# app/controllers/application_controller.rb
---
.../modules/courses/elearning/Elearning.js | 40 +++++++++++++++++--
.../courses/elearning/YslDetailCards.js | 3 ++
2 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js
index 4f55fb178..4d469274e 100644
--- a/public/react/src/modules/courses/elearning/Elearning.js
+++ b/public/react/src/modules/courses/elearning/Elearning.js
@@ -4,7 +4,9 @@ import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder';
import './myelearning.css'
import axios from 'axios';
import YslDetailCards from "./YslDetailCards.js";
-import Jointheclass from '../../modals/Jointheclass'
+import Jointheclass from '../../modals/Jointheclass';
+import LoginDialog from "../../login/LoginDialog";
+
//在线学习
class Elearning extends Component{
constructor(props){
@@ -23,7 +25,8 @@ class Elearning extends Component{
shixunsmessage:"",
startshixunCombattype:false,
isSpins:false,
-
+ userlogin:"",
+ isRender:false,
}
}
@@ -58,6 +61,10 @@ class Elearning extends Component{
})
});
+ this.setState({
+ userlogin:this.props.current_user.login,
+ })
+
}
@@ -68,6 +75,7 @@ class Elearning extends Component{
};
//开始学习
Startlearning=()=>{
+ this.Tojoinclass();
if(this.props.isNotMember()===true){
this.setState({
yslJointhe:true
@@ -206,7 +214,28 @@ class Elearning extends Component{
this.setState({
startshixunCombattypes:false
})
+ };
+ Modifyloginvalue=()=>{
+ this.setState({
+ isRender:false,
+ })
+ };
+ Tojoinclass=()=> {
+ let {userlogin} = this.state;
+ if (userlogin === undefined) {
+ this.setState({
+ isRender: true
+ })
+ return
+ }
+ if (userlogin === "") {
+ this.setState({
+ isRender: true
+ })
+ return;
+ }
}
+
render(){
let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages} =this.state;
const isNotMembers=this.props.isNotMember();//非课堂成员
@@ -214,6 +243,11 @@ class Elearning extends Component{
return(
+ {isRender===true?
this.Modifyloginvalue()}
+ {...this.props}
+ {...this.state}
+ />:""}
this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}>
:
{/*开始学习*/}
- this.Startlearningtwo()} Myreload={()=>this.Myreload()} >
+ this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()}>
}
diff --git a/public/react/src/modules/courses/elearning/YslDetailCards.js b/public/react/src/modules/courses/elearning/YslDetailCards.js
index 1d5c77284..38cc32d18 100644
--- a/public/react/src/modules/courses/elearning/YslDetailCards.js
+++ b/public/react/src/modules/courses/elearning/YslDetailCards.js
@@ -33,6 +33,9 @@ class YslDetailCards extends Component{
})
};
startgameid=(id)=>{
+ // 上面传过来的方法是用来没登入弹出弹框的
+ this.props.Tojoinclass();
+
if(this.props.isNotMember()===true){
//这个是外部传过来的
this.props.Startlearningtwo();
From e3a906516100e9a68cc583b48304dcafccc55206 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 20 Aug 2019 10:11:14 +0800
Subject: [PATCH 06/60] Merge branches 'dev_Ysm' and 'dev_admin' of
https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl
# Conflicts:
# app/controllers/application_controller.rb
---
public/react/src/modules/courses/elearning/Elearning.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js
index 4d469274e..d587d88c8 100644
--- a/public/react/src/modules/courses/elearning/Elearning.js
+++ b/public/react/src/modules/courses/elearning/Elearning.js
@@ -237,7 +237,7 @@ class Elearning extends Component{
}
render(){
- let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages} =this.state;
+ let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages,isRender} =this.state;
const isNotMembers=this.props.isNotMember();//非课堂成员
const antIcon = ;
return(
From dbdd03378c687ac06b1725bd2a5214e83d0657b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Tue, 20 Aug 2019 10:16:02 +0800
Subject: [PATCH 07/60] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/public/css/edu-all.css | 1 +
public/stylesheets/educoder/edu-all.css | 1 +
2 files changed, 2 insertions(+)
diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css
index 55f42e608..c8f567058 100644
--- a/public/react/public/css/edu-all.css
+++ b/public/react/public/css/edu-all.css
@@ -122,6 +122,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
border: 1px solid #fff;
border-radius: 3px;
font-size: 14px;
+ opacity: 0.56;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:12px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css
index 5a464a4c0..797307e18 100644
--- a/public/stylesheets/educoder/edu-all.css
+++ b/public/stylesheets/educoder/edu-all.css
@@ -124,6 +124,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
border: 1px solid #fff;
border-radius: 3px;
font-size: 14px;
+ opacity: 0.56;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:12px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
From de5ff94bea87eaab1a245bddc10b44b9d95aa664 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 20 Aug 2019 10:40:35 +0800
Subject: [PATCH 08/60] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E7=9A=84=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_commons_controller.rb | 2 --
app/models/course.rb | 5 +++++
app/models/homework_common.rb | 3 +++
.../20190820021047_migrate_course_task_position.rb | 13 +++++++++++++
4 files changed, 21 insertions(+), 2 deletions(-)
create mode 100644 db/migrate/20190820021047_migrate_course_task_position.rb
diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb
index 5d1733983..eb3576f24 100644
--- a/app/controllers/homework_commons_controller.rb
+++ b/app/controllers/homework_commons_controller.rb
@@ -37,8 +37,6 @@ class HomeworkCommonsController < ApplicationController
@category = @main_category.course_second_categories.find_by(id: params[:category])
tip_exception("子目录id有误") if !@category.present?
@homework_commons = @homework_commons.where(course_second_category_id: params[:category])
- elsif @homework_type == 4
- @homework_commons = @homework_commons
end
@all_count = @homework_commons.size
diff --git a/app/models/course.rb b/app/models/course.rb
index b7bea6ec0..baed1efe6 100644
--- a/app/models/course.rb
+++ b/app/models/course.rb
@@ -32,7 +32,12 @@ class Course < ApplicationRecord
has_many :teacher_course_members, -> { teachers_and_admin }, class_name: 'CourseMember'
has_many :teacher_users, through: :teacher_course_members, source: :user
has_many :course_messages, dependent: :destroy
+
has_many :homework_commons, dependent: :destroy
+ has_many :normal_homeworks, -> { normals }, class_name: 'HomeworkCommon'
+ has_many :group_homeworks, -> { groups }, class_name: 'HomeworkCommon'
+ has_many :practice_homeworks, -> { practices }, class_name: 'HomeworkCommon'
+
has_many :homework_group_settings
has_many :graduation_works, dependent: :destroy
diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb
index f198a7143..e510ca666 100644
--- a/app/models/homework_common.rb
+++ b/app/models/homework_common.rb
@@ -48,6 +48,9 @@ class HomeworkCommon < ApplicationRecord
scope :search_homework_type, lambda {|num| where(homework_type:num)}
scope :unified_setting, -> {where("unified_setting = ? ", 1)}
+ scope :normals, -> {where(homework_type: %i[normal])}
+ scope :groups, -> {where(homework_type: %i[group])}
+ scope :practices, -> {where(homework_type: %i[practice])}
# 是否显示参考答案
def view_answer identity, user_id
diff --git a/db/migrate/20190820021047_migrate_course_task_position.rb b/db/migrate/20190820021047_migrate_course_task_position.rb
new file mode 100644
index 000000000..cf1b633bd
--- /dev/null
+++ b/db/migrate/20190820021047_migrate_course_task_position.rb
@@ -0,0 +1,13 @@
+class MigrateCourseTaskPosition < ActiveRecord::Migration[5.2]
+ def change
+ add_column :homework_commons, :position, :integer, :default => 0
+
+ Course.find_each do |course|
+ puts course.id
+ course.practice_homeworks.order("IF(ISNULL(homework_commons.publish_time),0,1), homework_commons.publish_time DESC,
+ homework_commons.created_at DESC").reverse.each_with_index do |homework, index|
+ homework.update_columns(position: index + 1)
+ end
+ end
+ end
+end
From 38e307487a29dd9f904356d0c1a920a39bdc0aa6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 20 Aug 2019 10:46:05 +0800
Subject: [PATCH 09/60] Merge branches 'dev_Ysm' and 'dev_admin' of
https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl
# Conflicts:
# app/controllers/application_controller.rb
---
.../modules/courses/elearning/Elearning.js | 26 +++++++++---------
.../courses/elearning/YslDetailCards.js | 27 +++++++++++++++----
2 files changed, 36 insertions(+), 17 deletions(-)
diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js
index d587d88c8..81f300538 100644
--- a/public/react/src/modules/courses/elearning/Elearning.js
+++ b/public/react/src/modules/courses/elearning/Elearning.js
@@ -75,7 +75,19 @@ class Elearning extends Component{
};
//开始学习
Startlearning=()=>{
- this.Tojoinclass();
+ let {userlogin} = this.state;
+ if (userlogin === undefined) {
+ this.setState({
+ isRender: true
+ })
+ return
+ }
+ if (userlogin === "") {
+ this.setState({
+ isRender: true
+ })
+ return;
+ }
if(this.props.isNotMember()===true){
this.setState({
yslJointhe:true
@@ -221,20 +233,10 @@ class Elearning extends Component{
})
};
Tojoinclass=()=> {
- let {userlogin} = this.state;
- if (userlogin === undefined) {
- this.setState({
- isRender: true
- })
- return
- }
- if (userlogin === "") {
this.setState({
isRender: true
})
- return;
- }
- }
+ };
render(){
let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages,isRender} =this.state;
diff --git a/public/react/src/modules/courses/elearning/YslDetailCards.js b/public/react/src/modules/courses/elearning/YslDetailCards.js
index 38cc32d18..a1ad44e67 100644
--- a/public/react/src/modules/courses/elearning/YslDetailCards.js
+++ b/public/react/src/modules/courses/elearning/YslDetailCards.js
@@ -34,13 +34,30 @@ class YslDetailCards extends Component{
};
startgameid=(id)=>{
// 上面传过来的方法是用来没登入弹出弹框的
- this.props.Tojoinclass();
+ try {
+ let {userlogin} = this.props;
+ if (userlogin === undefined) {
+ this.props.Tojoinclass();
+ return
+ }
+ if (userlogin === "") {
+ this.props.Tojoinclass();
+ return;
+ }
+ }catch (e) {
- if(this.props.isNotMember()===true){
- //这个是外部传过来的
- this.props.Startlearningtwo();
- return
}
+
+ try {
+ if(this.props.isNotMember()===true){
+ //这个是外部传过来的
+ this.props.Startlearningtwo();
+ return
+ }
+ }catch (e) {
+
+ }
+
let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => {
From ab59a180c3bc25e08fbbb48afdd652f4b06f1c27 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 20 Aug 2019 10:54:30 +0800
Subject: [PATCH 10/60] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E7=9A=84=E5=90=8D=E7=A7=B0=E9=95=BF=E5=BA=A6=E9=99=90=E5=88=B6?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/shixuns_controller.rb | 20 ++++++++++----------
app/controllers/subjects_controller.rb | 4 ++--
app/models/subject.rb | 2 +-
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index c9b56bb98..b9c2086d8 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -562,16 +562,16 @@ class ShixunsController < ApplicationController
commit_id = commit["id"]
end
- # 如果该实训是金课中的实训,则将当前用户加入到当期开课的课堂
- # if StageShixun.exists?(shixun_id: @shixun.id, subject_id: Subject.where(excellent: 1))
- # subject = Subject.where(excellent: 1, id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id)).take
- # course = subject.courses.where("start_date is not null and start_date <= '#{Date.today}' and end_date is not null and end_date >= '#{Date.today}'").take
- # if course.present? && !CourseMember.exists?(course_id: course.id, user_id: current_user.id)
- # # 为了不影响后续操作,用create而不是create!
- # CourseMember.create(course_id: course.id, user_id: current_user.id, role: 4)
- # CourseAddStudentCreateWorksJob.perform_later(course.id, [current_user.id])
- # end
- # end
+ 如果该实训是金课中的实训,则将当前用户加入到当期开课的课堂
+ if StageShixun.exists?(shixun_id: @shixun.id, subject_id: Subject.where(excellent: 1))
+ subject = Subject.where(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1).take(1)
+ course = subject.courses.where("start_date is not null and start_date <= '#{Date.today}' and end_date is not null and end_date >= '#{Date.today}'").take
+ if course.present? && !CourseMember.exists?(course_id: course.id, user_id: current_user.id)
+ # 为了不影响后续操作,用create而不是create!
+ CourseMember.create(course_id: course.id, user_id: current_user.id, role: 4)
+ CourseAddStudentCreateWorksJob.perform_later(course.id, [current_user.id])
+ end
+ end
ActiveRecord::Base.transaction do
begin
diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb
index 5389ff961..431423d87 100644
--- a/app/controllers/subjects_controller.rb
+++ b/app/controllers/subjects_controller.rb
@@ -149,7 +149,7 @@ class SubjectsController < ApplicationController
end
def choose_subject_shixun
- @search = params[:search]
+ @search = params[:search].strip
@type = params[:type]
# 超级管理员用户显示所有未隐藏的实训、非管理员显示合作团队用户的实训(对本单位公开且未隐藏)
if current_user.admin?
@@ -163,7 +163,7 @@ class SubjectsController < ApplicationController
tag_ids = @shixuns.joins(:shixun_tag_repertoires).pluck(:tag_repertoire_id).uniq
@tags = TagRepertoire.select([:id, :name]).where(id: tag_ids)
- if params[:search]
+ unless @search.blank?
@shixuns = @shixuns.where("name like ?", "%#{@search}%")
end
diff --git a/app/models/subject.rb b/app/models/subject.rb
index 113460375..5116cce75 100644
--- a/app/models/subject.rb
+++ b/app/models/subject.rb
@@ -21,7 +21,7 @@ class Subject < ApplicationRecord
# 开放课堂
has_many :courses, -> { order("courses.id ASC") }
- validates :name, length: { maximum: 40 }
+ validates :name, length: { maximum: 60 }
validates :description, length: { maximum: 5000 }
validates :learning_notes, length: { maximum: 500 }
From 0095202a66bf14d75659d87a2439dc16cd592937 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 20 Aug 2019 11:01:05 +0800
Subject: [PATCH 11/60] tiaoz
---
app/controllers/subjects_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb
index 431423d87..df6ee31de 100644
--- a/app/controllers/subjects_controller.rb
+++ b/app/controllers/subjects_controller.rb
@@ -149,7 +149,7 @@ class SubjectsController < ApplicationController
end
def choose_subject_shixun
- @search = params[:search].strip
+ @search = params[:search].strip if params[:search]
@type = params[:type]
# 超级管理员用户显示所有未隐藏的实训、非管理员显示合作团队用户的实训(对本单位公开且未隐藏)
if current_user.admin?
From 4aa48dfaed4076d7416b5f438aee41958ebd6fe7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 20 Aug 2019 11:16:45 +0800
Subject: [PATCH 12/60] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/courses/Index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js
index 1430b8c5d..57d323955 100644
--- a/public/react/src/modules/courses/Index.js
+++ b/public/react/src/modules/courses/Index.js
@@ -828,7 +828,7 @@ class CoursesIndex extends Component{
{/*新建精品课堂*/}
{/*coursesId 课堂id */}
{/*id 是否是私有或者公有*/}
- ()
}
From c497048359ff11b60fa0aff6ea119369438d9bf5 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 20 Aug 2019 11:26:18 +0800
Subject: [PATCH 13/60] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=87=91=E8=AF=BE?=
=?UTF-8?q?=E6=97=B6=E8=BF=94=E5=9B=9E=E8=AF=BE=E5=A0=82=E5=90=8D=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 7 ++++++-
app/controllers/shixuns_controller.rb | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index d97c26127..725c9815b 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -100,7 +100,12 @@ class CoursesController < ApplicationController
# GET /courses/new
def new
@course = Course.new
- normal_status("成功")
+ unless params[:subject_id].blank?
+ subject = Subject.find_by(id: params[:subject_id], excellent: 1)
+ render :json => {status: 0, course_name: "#{subject&.name}第#{subject&.courses&.count.to_i + 1}期"}
+ else
+ normal_status("成功")
+ end
end
# Get /courses/:id/settings
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index b9c2086d8..ebc2db1d6 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -564,7 +564,7 @@ class ShixunsController < ApplicationController
如果该实训是金课中的实训,则将当前用户加入到当期开课的课堂
if StageShixun.exists?(shixun_id: @shixun.id, subject_id: Subject.where(excellent: 1))
- subject = Subject.where(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1).take(1)
+ subject = Subject.find_by(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1)
course = subject.courses.where("start_date is not null and start_date <= '#{Date.today}' and end_date is not null and end_date >= '#{Date.today}'").take
if course.present? && !CourseMember.exists?(course_id: course.id, user_id: current_user.id)
# 为了不影响后续操作,用create而不是create!
From 0e13d279dd0c0e526f51a7f2b599e08bc9735f26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Tue, 20 Aug 2019 11:37:20 +0800
Subject: [PATCH 14/60] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/paths/PathDetail/DetailCardsEditAndAdd.js | 4 ++--
public/react/src/modules/paths/PathDetail/OpenCourse.js | 5 +++--
public/react/src/modules/paths/PathDetail/PathDetailIndex.js | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
index ed99968cb..8a48fabea 100644
--- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
+++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
@@ -620,8 +620,8 @@ class DetailCardsEditAndAdd extends Component{
}
- {this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?
-
+点击新建阶段(选择1至多个实训项目,组成一个阶段)
+ {this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?
+ +点击新建阶段(选择1至多个实训项目,组成一个阶段)
:'':''}
)
diff --git a/public/react/src/modules/paths/PathDetail/OpenCourse.js b/public/react/src/modules/paths/PathDetail/OpenCourse.js
index bd9b309fd..b8c6fb287 100644
--- a/public/react/src/modules/paths/PathDetail/OpenCourse.js
+++ b/public/react/src/modules/paths/PathDetail/OpenCourse.js
@@ -68,10 +68,11 @@ class OpenCourse extends Component {
-
+
开放课堂:所有用户可以随时访问
-
+
+
私有课堂:仅报名参与的课堂成员可以访问
diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
index d64763980..889f9d9f0 100644
--- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
+++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
@@ -542,7 +542,7 @@ class PathDetailIndex extends Component{
{
detailInfoList===undefined?"":detailInfoList.allow_add_member===true?
{key!=0?
:""}
- {key+1!= members&&members.length?
:""}
+ {key+1=== members.length?"":
}
:""
}
From e07baf9f3d62f28b774bd01111c3d44a15b08704 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Tue, 20 Aug 2019 11:55:59 +0800
Subject: [PATCH 15/60] merge
---
app/controllers/courses_controller.rb | 7 +------
app/controllers/shixuns_controller.rb | 2 +-
.../src/modules/paths/PathDetail/DetailCardsEditAndAdd.js | 4 ++--
public/react/src/modules/paths/PathDetail/OpenCourse.js | 5 ++---
.../react/src/modules/paths/PathDetail/PathDetailIndex.js | 2 +-
5 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 725c9815b..d97c26127 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -100,12 +100,7 @@ class CoursesController < ApplicationController
# GET /courses/new
def new
@course = Course.new
- unless params[:subject_id].blank?
- subject = Subject.find_by(id: params[:subject_id], excellent: 1)
- render :json => {status: 0, course_name: "#{subject&.name}第#{subject&.courses&.count.to_i + 1}期"}
- else
- normal_status("成功")
- end
+ normal_status("成功")
end
# Get /courses/:id/settings
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index ebc2db1d6..b9c2086d8 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -564,7 +564,7 @@ class ShixunsController < ApplicationController
如果该实训是金课中的实训,则将当前用户加入到当期开课的课堂
if StageShixun.exists?(shixun_id: @shixun.id, subject_id: Subject.where(excellent: 1))
- subject = Subject.find_by(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1)
+ subject = Subject.where(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1).take(1)
course = subject.courses.where("start_date is not null and start_date <= '#{Date.today}' and end_date is not null and end_date >= '#{Date.today}'").take
if course.present? && !CourseMember.exists?(course_id: course.id, user_id: current_user.id)
# 为了不影响后续操作,用create而不是create!
diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
index 8a48fabea..ed99968cb 100644
--- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
+++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
@@ -620,8 +620,8 @@ class DetailCardsEditAndAdd extends Component{
}
- {this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?
-
+点击新建阶段(选择1至多个实训项目,组成一个阶段)
+ {this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?
+ +点击新建阶段(选择1至多个实训项目,组成一个阶段)
:'':''}
)
diff --git a/public/react/src/modules/paths/PathDetail/OpenCourse.js b/public/react/src/modules/paths/PathDetail/OpenCourse.js
index b8c6fb287..bd9b309fd 100644
--- a/public/react/src/modules/paths/PathDetail/OpenCourse.js
+++ b/public/react/src/modules/paths/PathDetail/OpenCourse.js
@@ -68,11 +68,10 @@ class OpenCourse extends Component {
-
+
开放课堂:所有用户可以随时访问
-
-
+
私有课堂:仅报名参与的课堂成员可以访问
diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
index 889f9d9f0..d64763980 100644
--- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
+++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
@@ -542,7 +542,7 @@ class PathDetailIndex extends Component{
{
detailInfoList===undefined?"":detailInfoList.allow_add_member===true?
{key!=0?
:""}
- {key+1=== members.length?"":
}
+ {key+1!= members&&members.length?
:""}
:""
}
From 84dbad63b0f943b17364242fdea7e1ca4f6d8a8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 20 Aug 2019 12:01:15 +0800
Subject: [PATCH 16/60] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/courses/Index.js | 2 +-
.../src/modules/courses/new/Goldsubject.js | 44 ++++++++++++-------
.../modules/paths/PathDetail/OpenCourse.js | 4 +-
3 files changed, 31 insertions(+), 19 deletions(-)
diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js
index 57d323955..01117b4f8 100644
--- a/public/react/src/modules/courses/Index.js
+++ b/public/react/src/modules/courses/Index.js
@@ -828,7 +828,7 @@ class CoursesIndex extends Component{
{/*新建精品课堂*/}
{/*coursesId 课堂id */}
{/*id 是否是私有或者公有*/}
-
()
}
diff --git a/public/react/src/modules/courses/new/Goldsubject.js b/public/react/src/modules/courses/new/Goldsubject.js
index d72ccc486..418a57fd0 100644
--- a/public/react/src/modules/courses/new/Goldsubject.js
+++ b/public/react/src/modules/courses/new/Goldsubject.js
@@ -145,9 +145,24 @@ class Goldsubject extends Component {
console.log(error);
})
}else{
+ let subjectid= this.props.match.params.subjectid;
let url = "/courses/new.json"
- axios.get(url).then((result) => {
- console.log(result)
+ axios.get(url,{params:{
+ subject_id:subjectid, //这是带过来的值
+ }}).then((response) => {
+ if (response) {
+ // this.goback
+ if(response.data){
+ console.log("获取Goldsubject.js");
+ console.log(response.data);
+ if(response.data.status===0){
+ this.props.form.setFieldsValue({
+ classroom: response.data.course_name,
+ name: response.data.name,
+ });
+ }
+ }
+ }
}).catch((error) => {
console.log(error);
})
@@ -159,10 +174,7 @@ class Goldsubject extends Component {
school:user_school,
Whethertocreateanewclassroom:true,
});
-
this.handleSearchschool(user_school);
-
-
}
@@ -700,17 +712,17 @@ class Goldsubject extends Component {
{options}
)}
-
- {/*(如果本学期包含多个班级,只需创建一个课堂然后在课堂内部建立不同的分班)*/}
-
-
- 正确示例:数据结构2019春季班级
-
-
-
- 错误示例:2019春季班级数据结构
-
-
+ {/**/}
+ {/* /!*(如果本学期包含多个班级,只需创建一个课堂然后在课堂内部建立不同的分班)*!/*/}
+ {/* */}
+ {/* */}
+ {/* 正确示例:数据结构2019春季班级*/}
+ {/*
*/}
+ {/* */}
+ {/* */}
+ {/* 错误示例:2019春季班级数据结构*/}
+ {/*
*/}
+ {/* */}
diff --git a/public/react/src/modules/paths/PathDetail/OpenCourse.js b/public/react/src/modules/paths/PathDetail/OpenCourse.js
index bd9b309fd..6f75886a2 100644
--- a/public/react/src/modules/paths/PathDetail/OpenCourse.js
+++ b/public/react/src/modules/paths/PathDetail/OpenCourse.js
@@ -26,9 +26,9 @@ class OpenCourse extends Component {
console.log(this.props.match.params.pathId)
if(value===0){
- window.open(`/courses/${this.props.match.params.pathId}/newgold/0 `);
+ window.open(`/courses/news/${this.props.match.params.pathId}/newgold/0 `);
}else{
- window.open(`/courses/${this.props.match.params.pathId}/newgold/1`);
+ window.open(`/courses/news/${this.props.match.params.pathId}/newgold/1`);
}
this.props.OpenCourseCancel();
}
From ff96a521d925cb3853a299222e3efa612fbd7ecd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 20 Aug 2019 12:08:19 +0800
Subject: [PATCH 17/60] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/search/SearchPage.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/public/react/src/search/SearchPage.js b/public/react/src/search/SearchPage.js
index 5c23d331e..499eb2f68 100644
--- a/public/react/src/search/SearchPage.js
+++ b/public/react/src/search/SearchPage.js
@@ -240,7 +240,9 @@ class SearchPage extends Component{
return (
关卡标签:
- 1?" tzbq ":" tzbqx"}
+ 1?" tzbq ":" tzbqx"} style={{
+ width:"100%"
+ }}
dangerouslySetInnerHTML={{__html:item6}} />
)
From 720aad8a3a3b55d3a30455e9d65c18350269dc35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Tue, 20 Aug 2019 12:19:50 +0800
Subject: [PATCH 18/60] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/paths/PathDetail/DetailTop.js | 21 +++++++++----------
.../paths/PathDetail/PathDetailIndex.js | 2 +-
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js
index 14342aff6..7a1e74856 100644
--- a/public/react/src/modules/paths/PathDetail/DetailTop.js
+++ b/public/react/src/modules/paths/PathDetail/DetailTop.js
@@ -321,7 +321,13 @@ class DetailTop extends Component{
{ detailInfoList.allow_send === true?this.props.courses===undefined?
:"":""
}
-
+
+ {this.props.courses===undefined?"":detailInfoList.is_creator===true?
this.OpenCoursefun()}>开课:""}
+ {detailInfoList===undefined?"":detailInfoList.allow_statistics===true?this.props.courses===undefined?"":
+ 学习统计
+ :""
+ }
+
{
@@ -335,11 +341,11 @@ class DetailTop extends Component{
{ detailInfoList.member_count!=0 ?
学习人数{detailInfoList.member_count} : ""}
}
- {this.props.courses===undefined?
+
{detailInfoList===undefined?"":detailInfoList.allow_delete===true?
删除路径:""}
+ >删除课程:""}
{
detailInfoList.publish_status===0&&detailInfoList.allow_add_member===true?
@@ -356,16 +362,9 @@ class DetailTop extends Component{
detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true?
撤销发布:""
}
-
:""}
+
- {this.props.courses===undefined?"":detailInfoList.is_creator===true?
:""}
-
{this.props.courses===undefined||this.props.courses.length===0?"":
diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
index d64763980..c576a3515 100644
--- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
+++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
@@ -542,7 +542,7 @@ class PathDetailIndex extends Component{
{
detailInfoList===undefined?"":detailInfoList.allow_add_member===true?
{key!=0?
:""}
- {key+1!= members&&members.length?
:""}
+ {key+1== members.length?"":
}
:""
}
From 972cd6efa3b92b58073957e60308b4802c3c3bc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Tue, 20 Aug 2019 13:49:24 +0800
Subject: [PATCH 19/60] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/paths/PathDetail/OpenCourse.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/paths/PathDetail/OpenCourse.js b/public/react/src/modules/paths/PathDetail/OpenCourse.js
index 6f75886a2..ccc11185e 100644
--- a/public/react/src/modules/paths/PathDetail/OpenCourse.js
+++ b/public/react/src/modules/paths/PathDetail/OpenCourse.js
@@ -68,10 +68,11 @@ class OpenCourse extends Component {
-
+
开放课堂:所有用户可以随时访问
-
+
+
私有课堂:仅报名参与的课堂成员可以访问
From 56cc4aec698c6e1b4ff1f2be38280d14275520f9 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 20 Aug 2019 14:11:36 +0800
Subject: [PATCH 20/60] tiaoz
---
app/controllers/shixuns_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index b9c2086d8..4e3b206e2 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -562,7 +562,7 @@ class ShixunsController < ApplicationController
commit_id = commit["id"]
end
- 如果该实训是金课中的实训,则将当前用户加入到当期开课的课堂
+ # 如果该实训是金课中的实训,则将当前用户加入到当期开课的课堂
if StageShixun.exists?(shixun_id: @shixun.id, subject_id: Subject.where(excellent: 1))
subject = Subject.where(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1).take(1)
course = subject.courses.where("start_date is not null and start_date <= '#{Date.today}' and end_date is not null and end_date >= '#{Date.today}'").take
From 9b720cde16126a341d09913d4277f53a91559645 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 20 Aug 2019 14:32:18 +0800
Subject: [PATCH 21/60] tiaoz
---
app/controllers/courses_controller.rb | 14 ++++++++++++--
app/models/homework_common.rb | 6 +++---
config/routes.rb | 2 ++
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index aaf24eadb..c1c0336be 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -26,12 +26,14 @@ class CoursesController < ApplicationController
:base_info, :get_historical_courses, :create_group_by_importing_file,
:attahcment_category_list,:export_member_scores_excel, :duplicate_course,
:switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course,
- :informs, :update_informs, :join_excellent_course, :online_learning]
+ :informs, :update_informs, :join_excellent_course, :online_learning,
+ :update_task_position, :tasks_list]
before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate,
:transfer_to_course_group, :delete_from_course,
:search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup, :add_teacher]
before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin,
- :set_course_group, :create_group_by_importing_file, :update_informs]
+ :set_course_group, :create_group_by_importing_file, :update_informs,
+ :update_task_position, :tasks_list]
before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group,
:change_course_teacher, :export_member_scores_excel, :course_group_list,
:teacher_application_review, :apply_teachers, :delete_course_teacher]
@@ -1115,6 +1117,14 @@ class CoursesController < ApplicationController
render_ok(count: count, courses: courses.select(:id, :name).as_json)
end
+ def tasks_list
+
+ end
+
+ def update_task_position
+
+ end
+
private
# Use callbacks to share common setup or constraints between actions.
diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb
index e510ca666..ae6ecfd5d 100644
--- a/app/models/homework_common.rb
+++ b/app/models/homework_common.rb
@@ -48,9 +48,9 @@ class HomeworkCommon < ApplicationRecord
scope :search_homework_type, lambda {|num| where(homework_type:num)}
scope :unified_setting, -> {where("unified_setting = ? ", 1)}
- scope :normals, -> {where(homework_type: %i[normal])}
- scope :groups, -> {where(homework_type: %i[group])}
- scope :practices, -> {where(homework_type: %i[practice])}
+ scope :normals, -> {where(homework_type: %i[normal]).order("position desc")}
+ scope :groups, -> {where(homework_type: %i[group]).order("position desc")}
+ scope :practices, -> {where(homework_type: %i[practice]).order("position desc")}
# 是否显示参考答案
def view_answer identity, user_id
diff --git a/config/routes.rb b/config/routes.rb
index 2ecd6502e..7577f3afb 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -351,6 +351,8 @@ Rails.application.routes.draw do
post 'update_informs'
get 'online_learning'
post 'join_excellent_course'
+ get 'tasks_list'
+ post 'update_task_position'
end
collection do
From 500d0761eb66e6a6deaee6702f6cfb5a090896d8 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 20 Aug 2019 14:33:38 +0800
Subject: [PATCH 22/60] tiaoz
---
app/controllers/shixuns_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index 4e3b206e2..bfd386e1c 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -564,7 +564,7 @@ class ShixunsController < ApplicationController
# 如果该实训是金课中的实训,则将当前用户加入到当期开课的课堂
if StageShixun.exists?(shixun_id: @shixun.id, subject_id: Subject.where(excellent: 1))
- subject = Subject.where(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1).take(1)
+ subject = Subject.find_by(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1)
course = subject.courses.where("start_date is not null and start_date <= '#{Date.today}' and end_date is not null and end_date >= '#{Date.today}'").take
if course.present? && !CourseMember.exists?(course_id: course.id, user_id: current_user.id)
# 为了不影响后续操作,用create而不是create!
From 300996b0d7d89006797a66b18376e3c34900cca7 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 20 Aug 2019 14:49:42 +0800
Subject: [PATCH 23/60] tiaoz
---
app/controllers/courses_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index d97c26127..591494141 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -152,7 +152,7 @@ class CoursesController < ApplicationController
end
rescue => e
uid_logger_error(e.message)
- tip_exception("课堂创建失败!")
+ tip_exception(e.message)
raise ActiveRecord::Rollback
end
end
From 38e1a27cad2c2077de762c42fa4de1d214d36e36 Mon Sep 17 00:00:00 2001
From: jingquan huang
Date: Tue, 20 Aug 2019 14:51:39 +0800
Subject: [PATCH 24/60] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E5=AF=86=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/tasks/user.rake | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/tasks/user.rake b/lib/tasks/user.rake
index 7e2cd2c57..144876009 100644
--- a/lib/tasks/user.rake
+++ b/lib/tasks/user.rake
@@ -43,12 +43,18 @@ namespace :sync do
is_test: true
}
user = User.create!(edit_params)
- puts "aa"
+ user.password = "edu12345678"
+ user.save!
UserExtension.create!(user_id: user.id, school_id: 117)
puts i
end
end
+ task :password => :environment do
+
+ end
+
+
# 随机生成字符
def generate_identifier(container, num)
code = DCODES.sample(num).join
From ce44b6f051cc4fe01c30f70961c00fe99721dd1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Tue, 20 Aug 2019 15:20:23 +0800
Subject: [PATCH 25/60] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/paths/PathDetail/DetailCardsEditAndEdit.js | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js
index 08419ede7..478575564 100644
--- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js
+++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js
@@ -82,11 +82,12 @@ class DetailCardsEditAndEdit extends Component{
//打开选择实训弹框初始化tag标签和列表
changeTag(id,search){
this.setState({
+ ChooseShixunListshixun_list:[],
+ page:1,
hometypepvisible:true
})
let pathId=this.props.pathid;
- let {page}=this.state;
- let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+page
+ let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
if(search!="" && search!=undefined){
url+="&search="+search;
}
@@ -523,7 +524,7 @@ class DetailCardsEditAndEdit extends Component{
`
}
-
@@ -552,7 +553,7 @@ class DetailCardsEditAndEdit extends Component{
})
}
-
+
}
取消
确定
From 0365516e759fa07f3b7e512de4e1546f93176c0f Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Tue, 20 Aug 2019 15:26:22 +0800
Subject: [PATCH 26/60] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=20=E5=85=B3=E8=81=94?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/busyWork/CommonWorkAnswer.js | 4 ++
.../courses/busyWork/CommonWorkDetailIndex.js | 45 +++++++++++++++++--
.../courses/busyWork/CommonWorkList.js | 23 +++++++---
.../courses/busyWork/CommonWorkQuestion.js | 6 ++-
.../courses/busyWork/CommonWorkSetting.js | 17 ++++---
5 files changed, 79 insertions(+), 16 deletions(-)
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkAnswer.js b/public/react/src/modules/courses/busyWork/CommonWorkAnswer.js
index d7614459c..ccaa3c04b 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkAnswer.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkAnswer.js
@@ -56,7 +56,11 @@ class CommonWorkAnswer extends Component{
}
componentDidMount() {
this.fetchData()
+ try {
+ this.props.triggerRef(this);
+ }catch (e) {
+ }
on('commonwork_fetch_all', this.fetchAllListener)
}
componentWillUnmount() {
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
index 4d82f4182..8c77aaab2 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
@@ -17,7 +17,7 @@ import PublishRightnow from './PublishRightnow'
import '../css/Courses.css'
import CBreadcrumb from '../common/CBreadcrumb'
import DownloadMessageysl from "../../modals/DownloadMessageysl";
-
+import ConnectProject from './ConnectProject'
import { Spin } from 'antd'
//引入对应跳转的组件
@@ -158,6 +158,30 @@ class CommonWorkDetailIndex extends Component{
}
bindRef = ref => { this.child = ref };
+ // 关联项目
+ openConnectionProject = (work) => {
+ this.refs['connectProject'].openConnectionProject(work)
+ }
+ connectSuccess = () => {
+ this.child.fetchData && this.child.fetchData()
+ }
+
+ cancelConnectionProject = (work) => {
+ let workId=this.props.match.params.workId;
+ let courseId=this.props.match.params.coursesId;
+
+ const url = `/homework_commons/${work.homework_id}/student_works/cancel_relate_project.json`
+ axios.get(url).then((response)=> {
+ if (response.data.status == 0) {
+ this.child.fetchData && this.child.fetchData()
+
+ this.props.showNotification('取消关联成功')
+ }
+ }).catch((error)=>{
+ console.log(error)
+ })
+ }
+ // 关联项目 END
render() {
let {course_name, homework_name, homework_status, noTab
@@ -180,7 +204,8 @@ class CommonWorkDetailIndex extends Component{
const childModuleName = this.state.moduleName
const commonHandler = {
- initWorkDetailCommonState: this.initWorkDetailCommonState
+ initWorkDetailCommonState: this.initWorkDetailCommonState,
+ triggerRef: this.bindRef
}
const isAdmin = this.props.isAdmin()
@@ -191,7 +216,7 @@ class CommonWorkDetailIndex extends Component{
let params = {}
if (isListModule) {
// TODO
- if(this.child!=undefined) {
+ if(this.child && this.child._getRequestParams) {
params = this.child._getRequestParams() !== undefined ? this.child._getRequestParams() : {};
}
}
@@ -341,6 +366,20 @@ class CommonWorkDetailIndex extends Component{
{/*
项目在线质量检测*/}
{isAdmin &&
this.props.toEditPage(this.props.match.params, workId)}>编辑作业}
+ { //
+ work_statuses && work_statuses.indexOf('关联项目') != -1 &&
+
+
+ this.openConnectionProject({ homework_id: workId })}>关联项目
+ this.props.toCreateProject()}>创建项目
+
+ }
+
+ { //
+ work_statuses && work_statuses.indexOf('取消关联') != -1 &&
+
this.cancelConnectionProject( {homework_id: workId} )}>取消关联
+ }
+
{work_statuses && work_statuses.indexOf('提交作品') != -1 &&
{ this.props.toWorkPostPage(this.props.match.params)}}
>提交作品}
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js
index 10bbca9f3..528aa1d9e 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkList.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js
@@ -38,10 +38,10 @@ function renderScore(score, content) {
function getScoreTip(score, dom) {
return score == '--' ? '未评分' : score == '**' ? '未公开' : dom
}
-function buildColumns(that, student_works) {
+function buildColumns(that, student_works, studentData) {
let gotWorkGroup = false;
let gotProjectInfo = false;
- if (student_works) {
+ if (student_works && student_works.length) {
student_works.forEach(item => {
if (item.work_group) {
gotWorkGroup = true
@@ -50,6 +50,13 @@ function buildColumns(that, student_works) {
gotProjectInfo = true;
}
})
+ } else if (studentData && studentData[0]) {
+ if (studentData[0].work_group) {
+ gotWorkGroup = true
+ }
+ if (studentData[0].project_info) {
+ gotProjectInfo = true;
+ }
}
let courseId= that.props.match.params.coursesId;
let workId= that.props.match.params.workId;
@@ -431,6 +438,9 @@ class CommonWorkList extends Component{
group_id:arg_course_group,
}
}
+ fetchData = () => {
+ this.fetchList()
+ }
fetchList = () => {
let workId=this.props.match.params.workId;
let courseId=this.props.match.params.coursesId;
@@ -542,7 +552,7 @@ class CommonWorkList extends Component{
late_penalty, absence_penalty, appeal_penalty
,end_immediately ,publish_immediately
- , homework_id, visible
+ , homework_id, visible, work_group, project_info
} =this.state;
@@ -566,7 +576,6 @@ class CommonWorkList extends Component{
return { label: `${item.name}(${item.count})`, value: item.id }
})
- const columns = buildColumns(this, student_works)
const isAdmin = this.props.isAdmin()
const isStudent = this.props.isStudent()
@@ -579,9 +588,11 @@ class CommonWorkList extends Component{
}else{
StudentData=isStudent ? [{ id, user_name, user_login, student_id, group_name, work_status, update_time, teacher_score, teaching_asistant_score, student_score,
ultimate_score, work_score, student_comment_count, appeal_all_count, appeal_deal_count,
- late_penalty, absence_penalty, appeal_penalty,
- work_group: '', isMine: true }] : []
+ late_penalty, absence_penalty, appeal_penalty, project_info,
+ work_group, isMine: true }] : []
}
+ const columns = buildColumns(this, student_works, StudentData)
+
let params = this._getRequestParams()
let exportUrl = `/api/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`;
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`;
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js
index 49f1e5158..f400cd9a2 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js
@@ -55,7 +55,11 @@ class CommonWorkQuestion extends Component{
}
componentDidMount() {
this.fetchData()
-
+ try {
+ this.props.triggerRef(this);
+ }catch (e) {
+
+ }
on('commonwork_fetch_all', this.fetchAllListener)
}
componentWillUnmount() {
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js
index aeda66ae1..4683e4e88 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js
@@ -77,7 +77,7 @@ class CommonWorkSetting extends Component{
}
}
- getsettings=()=>{
+ fetchData=()=>{
let workId=this.props.match.params.workId;
const isAdmin = this.props.isAdmin()
const url = `/homework_commons/${workId}/settings.json`
@@ -160,14 +160,19 @@ class CommonWorkSetting extends Component{
componentDidMount(){
- this.getsettings();
+ this.fetchData();
+ try {
+ this.props.triggerRef(this);
+ }catch (e) {
+
+ }
on('commonwork_fetch_all', this.fetchAllListener)
}
componentWillUnmount() {
off('commonwork_fetch_all', this.fetchAllListener)
}
fetchAllListener = () => {
- this.getsettings()
+ this.fetchData()
}
@@ -477,7 +482,7 @@ class CommonWorkSetting extends Component{
// checkBoxValues:[],
// checkAllValue:false
// })
- // this.getsettings();
+ // this.fetchData();
// }
// }).catch((error)=>{
@@ -988,11 +993,11 @@ class CommonWorkSetting extends Component{
Saves={Saves}
course_groups={course_groups}
/> */}
-
-
+
+
+ {this.props.courses===undefined?"":detailInfoList.is_creator===false?this.state.courseslist.map((item,key)=>{
+ return(
+
+
+
+
+
+ )}):""
+ }
+
+
- 第{this.state.MenuItemskey}次开课
+ 第{this.state.MenuItemskey}次开课
diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
index c576a3515..edac5ca01 100644
--- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
+++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
@@ -461,7 +461,7 @@ class PathDetailIndex extends Component{
-