diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb
index c5cae99c4..b6fdf8ea9 100644
--- a/app/controllers/subjects_controller.rb
+++ b/app/controllers/subjects_controller.rb
@@ -17,7 +17,7 @@ class SubjectsController < ApplicationController
include CustomSortable
def index
- subjects = Weapps::SubjectQuery.call(current_laboratory, params)
+ subjects = Weapps::SubjectQuery.call(current_laboratory, params, "web")
@subject_count = subjects.map(&:id).size
@subjects = paginate subjects.includes(:shixuns, :repertoire)
end
diff --git a/app/controllers/weapps/subjects_controller.rb b/app/controllers/weapps/subjects_controller.rb
index e5c3eb316..e1e50cc40 100644
--- a/app/controllers/weapps/subjects_controller.rb
+++ b/app/controllers/weapps/subjects_controller.rb
@@ -4,7 +4,7 @@ class Weapps::SubjectsController < Weapps::BaseController
# 首页
def index
- subjects = Weapps::SubjectQuery.call(current_laboratory, params)
+ subjects = Weapps::SubjectQuery.call(current_laboratory, params, "wechat")
@subject_count = subjects.map(&:id).size
@subjects = paginate subjects
end
diff --git a/app/queries/weapps/subject_query.rb b/app/queries/weapps/subject_query.rb
index 180176ce2..ca0c437a9 100644
--- a/app/queries/weapps/subject_query.rb
+++ b/app/queries/weapps/subject_query.rb
@@ -2,13 +2,20 @@ class Weapps::SubjectQuery < ApplicationQuery
include CustomSortable
attr_reader :params
- def initialize(current_laboratory, params)
+ def initialize(current_laboratory, params, device)
@current_laboratory = current_laboratory
@params = params
+ @device = device
end
def call
- subjects = @current_laboratory.subjects.unhidden.publiced.show_moblied
+ Rails.logger.info("##### @device: #{@device}")
+ subjects =
+ if @device == "wechat"
+ @current_laboratory.subjects.unhidden.publiced.show_moblied
+ else
+ @current_laboratory.subjects.unhidden.publiced
+ end
# 课程体系的过滤
if params[:sub_discipline_id].present?
diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
index 070ceeed2..b8880c6f2 100644
--- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
+++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
@@ -1244,19 +1244,19 @@ class Studentshavecompletedthelist extends Component {
(//助教是否有权限
this.props.assistant_auth&&this.props.assistant_auth===true?
this.Adjustment(record.user_id)}>评阅
+ target="_blank" onClick={() => this.Adjustment(record.user_id)}>{record.has_comment===true?"已评阅":"评阅"}
:
(//是否截止
this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3?
this.Adjustment(record.user_id)}>评阅
+ target="_blank" onClick={() => this.Adjustment(record.user_id)}>{record.has_comment===true?"已评阅":"评阅"}
:
--
)
)
:
this.Adjustment(record.user_id)}>评阅
+ target="_blank" onClick={() => this.Adjustment(record.user_id)}>{record.has_comment===true?"已评阅":"评阅"}
)
:record.submitstate === "已提交"?
(//是否助教
@@ -1581,8 +1581,9 @@ class Studentshavecompletedthelist extends Component {
efficiencyscore: exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score,
objective_score: exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score,
subjective_score:exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score,
- operating: "评阅",
+ operating:exercise_users[i].has_comment===true?"已评阅":"评阅",
commit_method:exercise_users[i].commit_method,
+ has_comment:exercise_users[i].has_comment
})
} else {
datalist.push({
@@ -1599,8 +1600,9 @@ class Studentshavecompletedthelist extends Component {
efficiencyscore: exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score,
objective_score: exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score,
subjective_score:exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score,
- operating: "--",
- commit_method:exercise_users[i].commit_method
+ operating:exercise_users[i].has_comment===true?"已评阅":"--",
+ commit_method:exercise_users[i].commit_method,
+ has_comment:exercise_users[i].has_comment
})
}
@@ -1670,8 +1672,9 @@ class Studentshavecompletedthelist extends Component {
efficiencyscore: exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score,
objective_score: exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score,
subjective_score:exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score,
- operating: "查看",
+ operating:exercise_users[i].has_comment===true?"已评阅":"查看",
commit_method:exercise_users[i].commit_method,
+ has_comment:exercise_users[i].has_comment
})
noclassroom = exercise_users[i].user_group_name;
}
@@ -1817,9 +1820,10 @@ class Studentshavecompletedthelist extends Component {
efficiencyscore: exercise_users[i].score === undefined ? "--" : exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score,
objective_score: exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score,
subjective_score:exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score,
- finalscore: "评阅",
+ finalscore:exercise_users[i].has_comment===true?"已评阅":"评阅",
user_id: exercise_users[i].user_id,
- commit_method:exercise_users[i].commit_method
+ commit_method:exercise_users[i].commit_method,
+ has_comment:exercise_users[i].has_comment
})
} else {
datalist.push({
@@ -1836,9 +1840,10 @@ class Studentshavecompletedthelist extends Component {
efficiencyscore: exercise_users[i].score === undefined ? "--" : exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score,
objective_score: exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score,
subjective_score:exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score,
- finalscore: "--",
+ finalscore:exercise_users[i].has_comment===true?"已评阅":"--",
user_id: exercise_users[i].user_id,
- commit_method:exercise_users[i].commit_method
+ commit_method:exercise_users[i].commit_method,
+ has_comment:exercise_users[i].has_comment
})
indexi++;
}