diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 206cf0c1b..4ef64da90 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -15,7 +15,7 @@ class StudentWorkController < ApplicationController format.html format.xls { send_data(homework_to_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present", - :filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@homework.name}#{l(:excel_homework_list)}(#{l(:excel_not_rated)}).xls") + :filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@homework.name}#{l(:excel_homework_list)}.xls") } end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 571886e17..d05926979 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2270,4 +2270,25 @@ module ApplicationHelper tag_list = attachment_tag_list all_attachments tag_list end + + #获取匿评相关连接代码 + def homework_anonymous_comment homework + if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业 + if homework.student_works.count >= 2 #作业份数大于2 + case homework.homework_detail_manual.comment_status + when 1 + link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit' + when 2 + link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit' + when 3 + link = "匿评结束".html_safe + end + else + link = "启动匿评".html_safe + end + else + link = "启动匿评".html_safe + end + link + end end diff --git a/app/helpers/homework_common_helper.rb b/app/helpers/homework_common_helper.rb index 4b9a44c07..f90e14610 100644 --- a/app/helpers/homework_common_helper.rb +++ b/app/helpers/homework_common_helper.rb @@ -1,26 +1,5 @@ # encoding: utf-8 module HomeworkCommonHelper - #获取匿评相关连接代码 - def homework_anonymous_comment homework - if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业 - if homework.student_works.count >= 2 #作业份数大于2 - case homework.homework_detail_manual.comment_status - when 1 - link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit' - when 2 - link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit' - when 3 - link = "匿评结束".html_safe - end - else - link = "启动匿评".html_safe - end - else - link = "启动匿评".html_safe - end - link - end - def student_new_homework homework work = cur_user_works_for_homework homework if work.nil? diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 2e96635fe..b904e3b68 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -22,8 +22,8 @@
项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题
- [展开] +作业提交还剩:
+ <% if betweentime(@homework.end_time) < 0 %> + + <%= l(:label_commit_limit)%> + + <% else %> + +