From 9b4c275869f0eb3809067c712ee399acf20da867 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Apr 2016 11:27:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=8A=A8=E6=80=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=BF=BD=E5=8A=A0=E9=99=84=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 1 + app/helpers/application_helper.rb | 8 ++++++-- app/views/organizations/_org_course_homework.html.erb | 9 +++++++-- app/views/student_work/_programing_work_show.html.erb | 5 +++++ app/views/student_work/_revise_attachment.html.erb | 4 ++-- app/views/student_work/_show.html.erb | 5 ++++- app/views/student_work/_student_work_list.html.erb | 6 +++--- app/views/users/_course_homework.html.erb | 7 ++++++- app/views/users/_user_homework_detail.html.erb | 6 ++++++ 9 files changed, 40 insertions(+), 11 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 0d1fb9462..24fbed982 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -355,6 +355,7 @@ class StudentWorkController < ApplicationController end @score = @b_sort == "desc" ? "asc" : "desc" + @is_focus = params[:is_focus] ? params[:is_focus].to_i : 0 # 消息传过来的ID @message_student_work_id = params[:student_work_id] respond_to do |format| diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 366cea06b..50b117da2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2990,8 +2990,12 @@ def homework_common_index_url_in_org(course_id) Setting.protocol + "://" + Setting.host_name + "/homework_common?course=" + course_id.to_s end -def student_work_index_url_in_org(homework_id) - Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s +def student_work_index_url_in_org(homework_id, is_focus = '') + if is_focus != '' + Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&is_focus=" + is_focus.to_s + else + Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + end end def course_url_in_org(course_id) diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 025bb48af..4ac2ebcbf 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -66,11 +66,16 @@ <% end %> <% end %> + <% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
- <% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %> <%= user_for_homework_common activity,is_teacher %>
- + <% work = cur_user_works_for_homework activity %> + <% if activity.end_time < Date.today && !is_teacher && !work.nil? %> +
+ <%=link_to "追加附件", student_work_index_url_in_org(activity.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %> +
+ <% end %> <% if activity.homework_type == 2 && is_teacher%>
<%= link_to "模拟答题", Setting.protocol + "://" + Setting.host_name + "/users/new_user_commit_homework?homework_id="+activity.id.to_s + "&is_test=true", class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %> diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 997d28f6d..75cd392d1 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -120,6 +120,11 @@