Merge branches 'dev_aliyun' and 'dev_ysmnewshixun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_ysmnewshixun

chromesetting
杨树明 5 years ago
commit 29c9087d72

@ -24,109 +24,103 @@ module HomeworkCommonsHelper
time = course.end_date.strftime("%Y-%m-%d")
time_status = 6
else
if homework_common.end_time && homework_common.end_time < Time.now && homework_common.allow_late &&
(homework_common.late_time.nil? || homework_common.late_time > Time.now)
status << "补交中"
time = "补交剩余时间:" + how_much_time(homework_common.late_time)
time_status = 2
else
ho_detail_manual = homework_common.homework_detail_manual
if ho_detail_manual
# 作业状态大于“提交”状态时,不用考虑分班权限
if ho_detail_manual.comment_status > 1
case ho_detail_manual.comment_status
when 2
unless homework_common.allow_late
status << "已截止"
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
time_status = 5
end
when 3
if ho_detail_manual.evaluation_end && ho_detail_manual.evaluation_end > Time.now
status << "匿评中"
time = "提交剩余时间:" + how_much_time(ho_detail_manual.evaluation_end)
time_status = 3
end
when 4
if ho_detail_manual.appeal_time && ho_detail_manual.appeal_time > Time.now
status << "申诉中"
time = "申诉剩余时间:" + how_much_time(ho_detail_manual.appeal_time)
time_status = 4
end
when 5, 6
ho_detail_manual = homework_common.homework_detail_manual
if ho_detail_manual
# 作业状态大于“提交”状态时,不用考虑分班权限
if ho_detail_manual.comment_status > 1
case ho_detail_manual.comment_status
when 3
if ho_detail_manual.evaluation_end && ho_detail_manual.evaluation_end > Time.now
status << "匿评中"
time = "匿评剩余时间:" + how_much_time(ho_detail_manual.evaluation_end)
time_status = 3
end
when 4
if ho_detail_manual.appeal_time && ho_detail_manual.appeal_time > Time.now
status << "申诉中"
time = "申诉剩余时间:" + how_much_time(ho_detail_manual.appeal_time)
time_status = 4
end
else
if homework_common.end_time && homework_common.end_time < Time.now && homework_common.allow_late &&
(homework_common.late_time.nil? || homework_common.late_time > Time.now)
status << "补交中"
time = "补交剩余时间:" + how_much_time(homework_common.late_time)
time_status = 2
else
status << "已截止"
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
time_status = 5
end
else
# member = course.course_members.find_by(user_id: user.id, is_active: 1)
# teacher_course_groups = member.try(:teacher_course_groups)
# identity = user.course_identity(course)
end
else
# member = course.course_members.find_by(user_id: user.id, is_active: 1)
# teacher_course_groups = member.try(:teacher_course_groups)
# identity = user.course_identity(course)
# 作业统一设置、游客身份、超级管理员、分班权限不限的老师身份
if homework_common.unified_setting || identity > Course::STUDENT || identity == Course::ADMIN ||
(identity < Course::STUDENT && teacher_course_groups.blank?)
case ho_detail_manual.comment_status
when 0
status << "未发布"
time = homework_common.publish_time.present? ? "将于 #{format_time(homework_common.publish_time)} 发布" : "创建于#{time_from_now(homework_common.created_at)}"
time_status = 0
when 1
if homework_common.end_time && homework_common.end_time >= Time.now
status << "提交中"
time = "提交剩余时间:" + how_much_time(homework_common.end_time)
time_status = 1
elsif homework_common.end_time && homework_common.end_time < Time.now
if homework_common.allow_late && (homework_common.late_time.nil? || homework_common.late_time >= Time.now)
time = "补交剩余时间:" + how_much_time(homework_common.late_time)
time_status = 2
else
status << "已截止"
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
time_status = 5
end
# 作业统一设置、游客身份、超级管理员、分班权限不限的老师身份
if homework_common.unified_setting || identity > Course::STUDENT || identity == Course::ADMIN ||
(identity < Course::STUDENT && teacher_course_groups.blank?)
case ho_detail_manual.comment_status
when 0
status << "未发布"
time = homework_common.publish_time.present? ? "将于 #{format_time(homework_common.publish_time)} 发布" : "创建于#{time_from_now(homework_common.created_at)}"
time_status = 0
when 1
if homework_common.end_time && homework_common.end_time >= Time.now
status << "提交中"
time = "提交剩余时间:" + how_much_time(homework_common.end_time)
time_status = 1
elsif homework_common.end_time && homework_common.end_time < Time.now
if homework_common.allow_late && (homework_common.late_time.nil? || homework_common.late_time >= Time.now)
time = "补交剩余时间:" + how_much_time(homework_common.late_time)
time_status = 2
else
status << "已截止"
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
time_status = 5
end
end
end
else
# 未分班的学生始终显示“未发布”(按理不会来到这个判断)
if member.role == "STUDENT" && member.course_group_id == 0
status << "未发布"
time = ""
time_status = 0
else
# 未分班的学生始终显示“未发布”(按理不会来到这个判断)
if member.role == "STUDENT" && member.course_group_id == 0
if member.role == "STUDENT"
setting = homework_common.homework_group_settings.find_by(course_group_id: member.course_group_id)
min_publish_time = setting.try(:publish_time)
max_end_time = setting.try(:end_time)
else
# 多个分班权限的取最小publish_time最大end_time
min_publish_time = homework_common.homework_group_settings.where.not(publish_time: nil).
where(course_group_id: teacher_course_groups.pluck(:course_group_id)).pluck(:publish_time).min
max_end_time = homework_common.homework_group_settings.where.not(end_time: nil).
where(course_group_id: teacher_course_groups.pluck(:course_group_id)).pluck(:end_time).max
end
if min_publish_time.nil?
status << "未发布"
time = ""
time = "创建于#{time_from_now(homework_common.created_at)}"
time_status = 0
elsif min_publish_time > Time.now
status << "未发布"
time = "将于 #{format_time(min_publish_time)} 发布"
time_status = 0
elsif max_end_time.present? && max_end_time > Time.now #6.14 -hs 添加present?
status << "提交中"
time = "提交剩余时间:" + how_much_time(max_end_time)
time_status = 1
else
if member.role == "STUDENT"
setting = homework_common.homework_group_settings.find_by(course_group_id: member.course_group_id)
min_publish_time = setting.try(:publish_time)
max_end_time = setting.try(:end_time)
else
# 多个分班权限的取最小publish_time最大end_time
min_publish_time = homework_common.homework_group_settings.where.not(publish_time: nil).
where(course_group_id: teacher_course_groups.pluck(:course_group_id)).pluck(:publish_time).min
max_end_time = homework_common.homework_group_settings.where.not(end_time: nil).
where(course_group_id: teacher_course_groups.pluck(:course_group_id)).pluck(:end_time).max
end
if min_publish_time.nil?
status << "未发布"
time = "创建于#{time_from_now(homework_common.created_at)}"
time_status = 0
elsif min_publish_time > Time.now
status << "未发布"
time = "将于 #{format_time(min_publish_time)} 发布"
time_status = 0
elsif max_end_time.present? && max_end_time > Time.now #6.14 -hs 添加present?
status << "提交中"
time = "提交剩余时间:" + how_much_time(max_end_time)
time_status = 1
else
status << "已截止"
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
time_status = 5
end
status << "已截止"
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
time_status = 5
end
end
status << "未开启补交" if !homework_common.allow_late && time_status == 1
end
status << "未开启补交" if !homework_common.allow_late && time_status == 1
end
end
end

@ -326,8 +326,8 @@ module.exports = {
comments: false
},
compress: {
drop_debugger: false,
drop_console: false
drop_debugger: true,
drop_console: true
}
}
}),

@ -496,7 +496,7 @@ class Listofworksstudentone extends Component {
render: (text, record) => (
<span style={{width: '40px'}}>
{
record.submitstate === "未提交" ? <span style={{color: '#9A9A9A'}}>--</span>
record.submitstate === "未开启" ? <span style={{color: '#9A9A9A'}}>--</span>
:
<a style={{textAlign: "center"}}
className="color-blue"
@ -891,7 +891,7 @@ class Listofworksstudentone extends Component {
render: (text, record) => (
<span style={{width: '40px'}}>
{
record.submitstate === "未提交" ? <span style={{color: '#9A9A9A'}}>--</span>
record.submitstate === "未开启" ? <span style={{color: '#9A9A9A'}}>--</span>
:
<a style={{textAlign: "center"}}
className="color-blue"
@ -1291,7 +1291,7 @@ class Listofworksstudentone extends Component {
width: '40px',
render: (text, record) => (
record.submitstate === "未提交" ?
record.submitstate === "未开启" ?
<a style={{textAlign: "center",width: '40px'}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
onClick={() => this.Viewstudenttraininginformationt(record)}>评阅</a> :
@ -1653,7 +1653,7 @@ class Listofworksstudentone extends Component {
className: 'font-14',
width: '40px',
render: (text, record) => (
record.submitstate === "未提交" ?
record.submitstate === "未开启" ?
<a style={{textAlign: "center",width: '40px'}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
onClick={() => this.Viewstudenttraininginformationt(record)}>评阅</a> :
@ -1896,7 +1896,7 @@ class Listofworksstudentone extends Component {
// search:搜索关键字
// order:排序方式更新时间update_time当前成绩work_score学号student_id
// b_order:desc倒序 asc顺序
// work_status:0:未提交 1:按时完成, 2:延时完成,“”不限
// work_status:0:未开启 1:按时完成, 2:延时完成,“”不限
// course_group:分班情况 [232, 231] []:不限(空数组)
var order = "asc";
if (ordervlue === "updated_at") {
@ -2074,7 +2074,7 @@ class Listofworksstudentone extends Component {
stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name,
cost_time: teacherdata.cost_time,
submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
submitstate: teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -2118,7 +2118,7 @@ class Listofworksstudentone extends Component {
stduynumber: student_works[i].student_id,
classroom: student_works[i].group_name,
cost_time: student_works[i].cost_time,
submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关",
submitstate: student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -2279,7 +2279,7 @@ class Listofworksstudentone extends Component {
stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name,
cost_time: teacherdata.cost_time,
submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
submitstate: teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -2432,7 +2432,7 @@ class Listofworksstudentone extends Component {
// search:搜索关键字
// order:排序方式更新时间update_time当前成绩work_score学号student_id
// b_order:desc倒序 asc顺序
// work_status:0:未提交 1:按时完成, 2:延时完成,“”不限
// work_status:0:未开启 1:按时完成, 2:延时完成,“”不限
// course_group:分班情况 [232, 231] []:不限(空数组)
var order = "asc";
if (ordervlue === "updated_at") {
@ -2641,7 +2641,7 @@ class Listofworksstudentone extends Component {
stduynumber: student_works[i].student_id,
classroom: student_works[i].group_name,
cost_time: student_works[i].cost_time,
submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关",
submitstate: student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,

Loading…
Cancel
Save