diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index cfe6141ee..c1676fbe9 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -154,7 +154,19 @@ class ShixunsController < ApplicationController
## 获取顶部菜单
def menus
- @repertoires = Repertoire.includes(sub_repertoires: [:tag_repertoires]).order("updated_at asc")
+ where_sql = ShixunTagRepertoire.where("shixun_tag_repertoires.tag_repertoire_id = tag_repertoires.id")
+
+ # 云上实验室过滤
+ unless current_laboratory.main_site?
+ where_sql = where_sql.joins('JOIN laboratory_shixuns ls ON ls.shixun_id = shixun_tag_repertoires.shixun_id')
+ end
+ where_sql = where_sql.select('1').to_sql
+ tags = TagRepertoire.where("EXISTS(#{where_sql})").distinct.includes(sub_repertoire: :repertoire)
+
+ @tags_map = tags.group_by(&:sub_repertoire)
+ @sub_reps_map = @tags_map.keys.group_by(&:repertoire)
+
+ # @repertoires = Repertoire.includes(sub_repertoires: [:tag_repertoires]).order("updated_at asc")
# respond_with @repertoires
render_json
diff --git a/app/models/trustie_hackathon.rb b/app/models/trustie_hackathon.rb
index 65275099d..3a45687ce 100644
--- a/app/models/trustie_hackathon.rb
+++ b/app/models/trustie_hackathon.rb
@@ -1,5 +1,5 @@
class TrustieHackathon < ApplicationRecord
- validates_length_of :description, maximum: 500
+ #validates_length_of :description, maximum: 10000
has_many :trustie_hacks, :dependent => :destroy
end
diff --git a/app/views/shixuns/menus.json.jbuilder b/app/views/shixuns/menus.json.jbuilder
index 379f13e52..c5021e88c 100644
--- a/app/views/shixuns/menus.json.jbuilder
+++ b/app/views/shixuns/menus.json.jbuilder
@@ -13,20 +13,36 @@
# ]
# }]
-json.array! @repertoires do |rep|
- json.id rep.id
- json.name rep.name
- json.sub_repertoires do
- json.array! rep.sub_repertoires do |sub|
- json.id sub.id
- json.name sub.name
- json.tags do
- json.array! sub.tag_repertoires do |tag|
- json.id tag.id
- json.name tag.name
- end
- end
- end
- end
+# json.array! @repertoires do |rep|
+# json.id rep.id
+# json.name rep.name
+# json.sub_repertoires do
+# json.array! rep.sub_repertoires do |sub|
+# json.id sub.id
+# json.name sub.name
+# json.tags do
+# json.array! sub.tag_repertoires do |tag|
+# json.id tag.id
+# json.name tag.name
+# end
+# end
+# end
+# end
+# end
+
+json.array! @sub_reps_map.keys do |rep|
+ json.extract! rep, :id, :name
+
+ json.sub_repertoires do
+ json.array! @sub_reps_map[rep] do |sub_rep|
+ json.extract! sub_rep, :id, :name
+
+ json.tags do
+ json.array! @tags_map[sub_rep] do |tag|
+ json.extract! tag, :id, :name
+ end
+ end
+ end
+ end
end
diff --git a/public/react/src/modules/courses/common/button/CheckAllGroup.js b/public/react/src/modules/courses/common/button/CheckAllGroup.js
index b19b684f7..21f7e6683 100644
--- a/public/react/src/modules/courses/common/button/CheckAllGroup.js
+++ b/public/react/src/modules/courses/common/button/CheckAllGroup.js
@@ -20,7 +20,7 @@ class CheckAllGroup extends Component{
this.props.onChange && this.props.onChange([], true);
}
onChange = (checkedValues) => {
- if (checkedValues.length > 0 && checkedValues.length != this.props.options.length) {
+ if (checkedValues.length > 0) {
this.setState({
'checkAll': false,
checkedValues
@@ -48,7 +48,7 @@ class CheckAllGroup extends Component{
`}
{label}
-
+
{
diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
index 5b2150457..2fb31ad40 100644
--- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
+++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
@@ -2153,24 +2153,28 @@ class Studentshavecompletedthelist extends Component {
}
this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
- } else if (checkedValues.length === data.length) {
- if (this.state.loadingstate === false) {
- this.setState({
- loadingstate: true,
- course_groupyslstwo: undefined,
- unlimiteds: 0,
- page:1
- })
- } else {
- this.setState({
- course_groupyslstwo: undefined,
- unlimiteds: 0,
- page:1,
- })
- }
-
- this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
- } else {
+ }
+ // else if (checkedValues.length === data.length) {
+ // if (this.state.loadingstate === false) {
+ // this.setState({
+ // loadingstate: true,
+ // course_groupyslstwo: undefined,
+ // unlimiteds: 0,
+ // page:1
+ // })
+ // }
+ //
+ // else {
+ // this.setState({
+ // course_groupyslstwo: undefined,
+ // unlimiteds: 0,
+ // page:1,
+ // })
+ // }
+ //
+ // this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
+ // }
+ else {
// //console.log(checkedValues);
this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
if (this.state.loadingstate === false) {
@@ -2232,24 +2236,26 @@ class Studentshavecompletedthelist extends Component {
}
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
- } else if (checkedValues.length === data.length) {
- if (this.state.loadingstate === false) {
- this.setState({
- unlimited: 0,
- course_groupyslsthree: undefined,
- loadingstate: true,
- page:1
- })
- } else {
- this.setState({
- unlimited: 0,
- course_groupyslsthree: undefined,
- page:1
- })
- }
-
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
- } else {
+ }
+ // else if (checkedValues.length === data.length) {
+ // if (this.state.loadingstate === false) {
+ // this.setState({
+ // unlimited: 0,
+ // course_groupyslsthree: undefined,
+ // loadingstate: true,
+ // page:1
+ // })
+ // } else {
+ // this.setState({
+ // unlimited: 0,
+ // course_groupyslsthree: undefined,
+ // page:1
+ // })
+ // }
+ //
+ // this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
+ // }
+ else {
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
@@ -2312,24 +2318,26 @@ class Studentshavecompletedthelist extends Component {
}
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
- } else if (checkedValues.length === data.length) {
- if (this.state.loadingstate === false) {
- this.setState({
- course_groupysls: undefined,
- unlimitedtwo: 0,
- loadingstate: true,
- page:1,
- })
- } else {
- this.setState({
- course_groupysls: undefined,
- unlimitedtwo: 0,
- page:1,
- })
- }
-
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
- } else {
+ }
+ // else if (checkedValues.length === data.length) {
+ // if (this.state.loadingstate === false) {
+ // this.setState({
+ // course_groupysls: undefined,
+ // unlimitedtwo: 0,
+ // loadingstate: true,
+ // page:1,
+ // })
+ // } else {
+ // this.setState({
+ // course_groupysls: undefined,
+ // unlimitedtwo: 0,
+ // page:1,
+ // })
+ // }
+ //
+ // this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
+ // }
+ else {
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
@@ -2693,7 +2701,7 @@ class Studentshavecompletedthelist extends Component {
作品状态:
+ onClick={() => this.notlimiteds()}>全部
this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}>
{
@@ -2724,7 +2732,7 @@ class Studentshavecompletedthelist extends Component {
你的评阅:
+ onClick={() => this.notlimited()}>全部
this.checkeboxs(e, course_groupyslstwodata && course_groupyslstwodata)}>
@@ -2755,7 +2763,7 @@ class Studentshavecompletedthelist extends Component {
作品状态:
+ onClick={() => this.notlimiteds()}>全部
this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}>
{
@@ -2781,7 +2789,7 @@ class Studentshavecompletedthelist extends Component {
+ onClick={() => this.funtaskstatustwos()}>全部
|
教师评阅:
-
+
this.funteachercomment(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.length)} style={{ paddingTop: '4px'}}>
{taskslistdata.search_assistants && taskslistdata.search_assistants.teacher_comment && taskslistdata.search_assistants.teacher_comment.map((item,key)=>{
@@ -1172,7 +1176,7 @@ class GraduationTaskssettinglist extends Component{
作品状态:
-
+
this.funtaskstatus(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.task_status.length)} style={{ paddingTop: '4px'}}>
@@ -1194,7 +1198,7 @@ class GraduationTaskssettinglist extends Component{
{taskslistdata.search_assistants&&taskslistdata.search_assistants.course_group_info.length!=0?
分班情况:
-
+
this.groupgroup(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.course_group_info.length)} style={{width: '1000px', paddingTop: '4px'}}>
@@ -1220,7 +1224,7 @@ class GraduationTaskssettinglist extends Component{
交叉评阅:
-
+
{taskslistdata.search_assistants&&taskslistdata.search_assistants.cross_comment.map((item,key)=>{
@@ -1331,7 +1335,7 @@ class GraduationTaskssettinglist extends Component{
教师评阅:
-
+
this.funteachercomment(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.length)} style={{ paddingTop: '4px'}}>
@@ -1364,7 +1368,7 @@ class GraduationTaskssettinglist extends Component{
作品状态:
-
+
this.funtaskstatus(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.task_status.length)} style={{ paddingTop: '4px'}}>
@@ -1387,7 +1391,7 @@ class GraduationTaskssettinglist extends Component{
分班情况:
-
+
this.groupgroup(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.course_group_info.length)} style={{ paddingTop: '4px'}}>
@@ -1409,7 +1413,7 @@ class GraduationTaskssettinglist extends Component{
交叉评阅:
-
+
{taskslistdata.search_assistants&&taskslistdata.search_assistants.cross_comment.map((item,key)=>{
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index a0d641aa5..c2d78f83e 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -2793,15 +2793,7 @@ class Listofworksstudentone extends Component {
page: 1,
})
this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
- } else if (checkedValues.length === data.length) {
- this.setState({
- unlimited: 0,
- course_groupyslstwo: [],
- loadingstate: true,
- page: 1,
- })
- this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
- } else {
+ }else {
// console.log(checkedValues);
this.setState({
course_groupyslstwo: checkedValues,
@@ -2812,6 +2804,16 @@ class Listofworksstudentone extends Component {
this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
}
+ // else if (checkedValues.length === data.length) {
+ // // this.setState({
+ // // unlimited: 0,
+ // // course_groupyslstwo: [],
+ // // loadingstate: true,
+ // // page: 1,
+ // // })
+ // // this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
+ // }
+
}
//作品状态2
funtaskstatustwot = (checkedValues, data) => {
@@ -2827,16 +2829,7 @@ class Listofworksstudentone extends Component {
page: 1,
})
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
- } else if (checkedValues.length === data.length) {
- this.setState({
- unlimitedtwo: 1,
- course_groupysls: undefined,
- checkedValuesineinfo: [],
- loadingstate: true,
- page: 1,
- })
- this.Startsortingt(this.state.orders, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
- } else {
+ }else {
this.setState({
checkedValuesineinfo: checkedValues,
course_groupysls: checkedValues,
@@ -2849,6 +2842,18 @@ class Listofworksstudentone extends Component {
}
+ // else if (checkedValues.length === data.length) {
+ // this.setState({
+ // unlimitedtwo: 1,
+ // course_groupysls: undefined,
+ // checkedValuesineinfo: [],
+ // loadingstate: true,
+ // page: 1,
+ // })
+ // this.Startsortingt(this.state.orders, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
+ // }
+
+
}
//搜索学生 文字输入
inputSearchValuest = (e) => {
@@ -3559,7 +3564,7 @@ class Listofworksstudentone extends Component {
作品状态:
+ onClick={() => this.notlimiteds()}>全部
this.funtaskstatust(e, task_status && task_status)}
style={{paddingTop: '4px'}}>
@@ -3591,7 +3596,7 @@ class Listofworksstudentone extends Component {
分班情况:
+ onClick={() => this.notlimitedst()}>全部
this.funtaskstatustwot(e, course_group_info && course_group_info)}
style={{paddingTop: '4px', width: '1017px'}}>
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
index a89022ee6..01f7055ce 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
@@ -919,7 +919,7 @@ class ShixunStudentWork extends Component {
|