yslnewtiku
cxt 5 years ago
commit 4ba165816c

@ -455,12 +455,14 @@ module ExportHelper
course_name = course.students.find_by(user_id: w.user_id).try(:course_group_name)
w_5 = course_name.present? ? course_name : "--"
#0 未提交, 1 按时提交, 2 延迟提交
if w.work_status == 0
w_6 = "未提交"
elsif w.work_status == 1
w_6 = "按时提交"
elsif w.work_status == 2
w_6 = "延迟提交"
if w.compelete_status == 0
w_6 = "未开启"
elsif w.compelete_status == 1
w_6 = "未通关"
elsif w.compelete_status == 2
w_6 = "按时通关"
elsif w.compelete_status == 3
w_6 = "迟交通关"
else
w_6 = "--"
end

@ -24,109 +24,105 @@ 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
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
end
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 status.blank?
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
@ -225,7 +221,7 @@ module HomeworkCommonsHelper
# 作品状态
def practice_homework_status homework, member
[{id: 0, name: "提交", count: homework.compelete_status_count(member, 0)},
[{id: 0, name: "开启", count: homework.compelete_status_count(member, 0)},
{id: 1, name: "未通关", count: homework.compelete_status_count(member, 1)},
{id: 2, name: "按时通关", count: homework.compelete_status_count(member, 2)},
{id: 3, name: "迟交通关", count: homework.compelete_status_count(member, 3)}]

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

@ -344,7 +344,7 @@ class Listofworksstudentone extends Component {
// ),
// },
{
title: '当前完成关卡',
title: '最新完成关卡',
dataIndex: 'curcomlevel',
key: 'curcomlevel',
align: "center",
@ -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"
@ -738,7 +738,7 @@ class Listofworksstudentone extends Component {
// ),
// },
{
title: '当前完成关卡',
title: '最新完成关卡',
dataIndex: 'curcomlevel',
key: 'curcomlevel',
align: "center",
@ -886,10 +886,12 @@ class Listofworksstudentone extends Component {
key: 'operating',
align: "center",
className: 'font-14',
width: '40px',
render: (text, record) => (
<span>
<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"
@ -1089,7 +1091,7 @@ class Listofworksstudentone extends Component {
// ),
// },
{
title: '当前完成关卡',
title: '最新完成关卡',
dataIndex: 'curcomlevel',
key: 'curcomlevel',
align: "center",
@ -1286,9 +1288,11 @@ class Listofworksstudentone extends Component {
display: 'block',
align: 'center',
className: 'font-14',
width: '40px',
render: (text, record) => (
record.submitstate === "未提交" ?
<a style={{textAlign: "center"}} className="color-blue"
record.submitstate === "未开启" ?
<a style={{textAlign: "center",width: '40px'}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
onClick={() => this.Viewstudenttraininginformationt(record)}>评阅</a> :
<span>
@ -1450,7 +1454,7 @@ class Listofworksstudentone extends Component {
)
},
{
title: '当前完成关卡',
title: '最新完成关卡',
dataIndex: 'curcomlevel',
key: 'curcomlevel',
align: "center",
@ -1647,9 +1651,10 @@ class Listofworksstudentone extends Component {
display: 'block',
align: 'center',
className: 'font-14',
width: '40px',
render: (text, record) => (
record.submitstate === "未提交" ?
<a style={{textAlign: "center"}} className="color-blue"
record.submitstate === "未开启" ?
<a style={{textAlign: "center",width: '40px'}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
onClick={() => this.Viewstudenttraininginformationt(record)}>评阅</a> :
<span>
@ -1891,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") {
@ -2069,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,
@ -2113,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,
@ -2274,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,
@ -2427,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") {
@ -2636,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,
@ -3472,22 +3477,22 @@ class Listofworksstudentone extends Component {
}
if(homewrok===false){
for(var i=0;i<columnsstu.length;i++){
if (columnsstu[i].title === "当前完成关卡"){//item.id==122
if (columnsstu[i].title === "最新完成关卡"){//item.id==122
columnsstu.splice(i,1)
}
}
for(var i=0;i<columnsstu2.length;i++){
if (columnsstu2[i].title === "当前完成关卡"){//item.id==122
if (columnsstu2[i].title === "最新完成关卡"){//item.id==122
columnsstu2.splice(i,1)
}
}
for(var i=0;i<columns.length;i++){
if (columns[i].title === "当前完成关卡"){//item.id==122
if (columns[i].title === "最新完成关卡"){//item.id==122
columns.splice(i,1)
}
}
for(var i=0;i<columnss.length;i++){
if (columnss[i].title === "当前完成关卡"){//item.id==122
if (columnss[i].title === "最新完成关卡"){//item.id==122
columnss.splice(i,1)
}
}

Loading…
Cancel
Save