Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

schedule_job
cxt 5 years ago
commit 8f38893fa6

@ -17,7 +17,7 @@ class SubjectsController < ApplicationController
include CustomSortable include CustomSortable
def index def index
subjects = Weapps::SubjectQuery.call(current_laboratory, params) subjects = Weapps::SubjectQuery.call(current_laboratory, params, "web")
@subject_count = subjects.map(&:id).size @subject_count = subjects.map(&:id).size
@subjects = paginate subjects.includes(:shixuns, :repertoire) @subjects = paginate subjects.includes(:shixuns, :repertoire)
end end

@ -4,7 +4,7 @@ class Weapps::SubjectsController < Weapps::BaseController
# 首页 # 首页
def index def index
subjects = Weapps::SubjectQuery.call(current_laboratory, params) subjects = Weapps::SubjectQuery.call(current_laboratory, params, "wechat")
@subject_count = subjects.map(&:id).size @subject_count = subjects.map(&:id).size
@subjects = paginate subjects @subjects = paginate subjects
end end

@ -2,13 +2,20 @@ class Weapps::SubjectQuery < ApplicationQuery
include CustomSortable include CustomSortable
attr_reader :params attr_reader :params
def initialize(current_laboratory, params) def initialize(current_laboratory, params, device)
@current_laboratory = current_laboratory @current_laboratory = current_laboratory
@params = params @params = params
@device = device
end end
def call 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? if params[:sub_discipline_id].present?

@ -1244,19 +1244,19 @@ class Studentshavecompletedthelist extends Component {
(//助教是否有权限 (//助教是否有权限
this.props.assistant_auth&&this.props.assistant_auth===true? this.props.assistant_auth&&this.props.assistant_auth===true?
<a style={{textAlign: "center"}} className="color-blue" <a style={{textAlign: "center"}} className="color-blue"
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a> target="_blank" onClick={() => this.Adjustment(record.user_id)}>{record.has_comment===true?"已评阅":"评阅"}</a>
: :
(//是否截止 (//是否截止
this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3?
<a style={{textAlign: "center"}} className="color-blue" <a style={{textAlign: "center"}} className="color-blue"
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a> target="_blank" onClick={() => this.Adjustment(record.user_id)}>{record.has_comment===true?"已评阅":"评阅"}</a>
: :
<span style={{textAlign: "center", color: '#999999'}}>--</span> <span style={{textAlign: "center", color: '#999999'}}>--</span>
) )
) )
: :
<a style={{textAlign: "center"}} className="color-blue" <a style={{textAlign: "center"}} className="color-blue"
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a> target="_blank" onClick={() => this.Adjustment(record.user_id)}>{record.has_comment===true?"已评阅":"评阅"}</a>
) )
:record.submitstate === "已提交"? :record.submitstate === "已提交"?
(//是否助教 (//是否助教
@ -1581,8 +1581,9 @@ class Studentshavecompletedthelist extends Component {
efficiencyscore: exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score, 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, 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, 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, commit_method:exercise_users[i].commit_method,
has_comment:exercise_users[i].has_comment
}) })
} else { } else {
datalist.push({ datalist.push({
@ -1599,8 +1600,9 @@ class Studentshavecompletedthelist extends Component {
efficiencyscore: exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score, 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, 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, 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 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, 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, 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, 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, commit_method:exercise_users[i].commit_method,
has_comment:exercise_users[i].has_comment
}) })
noclassroom = exercise_users[i].user_group_name; 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, 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, 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, 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, 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 { } else {
datalist.push({ 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, 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, 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, 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, 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++; indexi++;
} }

Loading…
Cancel
Save