1、学生作业 --> 作品

2、学生交了作品之后显示修改作品
This commit is contained in:
sw 2015-04-17 10:36:32 +08:00
parent b040981c22
commit a8b1ca10b3
7 changed files with 20 additions and 16 deletions

View File

@ -314,7 +314,7 @@ class HomeworkAttachController < ApplicationController
def edit
bid = @homework.bid
if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0) && (User.current.admin? || User.current.member_of_course?(bid.courses.first))
if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 || bid.comment_status == 2) && (User.current.admin? || User.current.member_of_course?(bid.courses.first))
get_homework_member @homework
else
render_403 :message => :notice_not_authorized
@ -347,7 +347,7 @@ class HomeworkAttachController < ApplicationController
def destroy
bid = @homework.bid
if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0) && (User.current.admin? || User.current == @homework.user)
if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 || bid.comment_status == 0) && (User.current.admin? || User.current == @homework.user)
if @homework.destroy
#respond_to do |format|
# format.html { redirect_to course_for_bid_url @homework.bid }

View File

@ -2036,12 +2036,12 @@ module ApplicationHelper
def anonymous_comment_link(bid, course)
link = case bid.comment_status
when 0
confirm_info = "开启匿评后学生将不能对作进行提交、修改、删除等操作\n"
confirm_info = "开启匿评后学生将不能对作进行提交、修改、删除等操作\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定开启匿评?'
link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => confirm_info, disable_with: '加载中...'
when 1
confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作列表\n"
confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作列表\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定关闭匿评?'
link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => confirm_info
@ -2057,7 +2057,7 @@ module ApplicationHelper
@student_size ||= searchStudent(course).size
@homework_size = bid.homeworks.size
percent = @homework_size.to_f / (@student_size == 0 ? 1 : @student_size)
confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作,占#{number_to_percentage(percent * 100, precision: 1)}\n"
confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作,占#{number_to_percentage(percent * 100, precision: 1)}\n"
when 1
@homework_evaluations = 0
bid.homeworks.map { |homework| @homework_evaluations += homework.homework_evaluations.count}
@ -2074,7 +2074,7 @@ module ApplicationHelper
bid.homeworks.map { |homework| @has_evaluations += homework.rates(:quality).where("seems_rateable_rates.rater_id not in #{teachers}").count}
percent = @has_evaluations.to_f / (@homework_evaluations == 0 ? 1 : @homework_evaluations)
confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作业,已评价#{@has_evaluations}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n"
confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作品,已评价#{@has_evaluations}份作品,占#{number_to_percentage(percent * 100, precision: 1)}\n"
end
confirm_info
end

View File

@ -762,7 +762,11 @@ module CoursesHelper
if user_homework && user_homework.empty?
link_to l(:label_commit_homework), new_exercise_book_path(bid),:class => 'fr mr10 work_edit'
else
"<span class='fr mr10 pr_join_span '>作业已交</span>".html_safe
if bid.comment_status == 1 && bid.open_anonymous_evaluation == 1
"<span class='fr mr10 pr_join_span ' title='已开启匿评不能修改作品'>#{l(:label_edit_homework)}</span>".html_safe
else
link_to l(:label_edit_homework), edit_homework_attach_path(user_homework.first.id),:class => 'fr mr10 work_edit'
end
end
end

View File

@ -70,7 +70,7 @@
<div class="upload_box_" >
<h2 class="upload_box_tit">下载文件包太大,分成多个下载包</h2>
<ul class="upload_box_ul" >
<li><span class="upload_box_span" >1.</span> <a href="javascript:void(0)">前20名学生的作</a><span class="c_grey">&nbsp;&nbsp;共200M</span> </li>
<li><span class="upload_box_span" >1.</span> <a href="javascript:void(0)">前20名学生的作</a><span class="c_grey">&nbsp;&nbsp;共200M</span> </li>
</ul>
<div class="cl"></div>
</div>

View File

@ -15,7 +15,7 @@
</li>
<li class="wname">
<% if homework.name == nil || homework.name == "" %>
<% homework_filename = homework.user.name + "提交的作" %>
<% homework_filename = homework.user.name + "提交的作" %>
<% else %>
<% homework_filename = homework.name %>
<% end %>
@ -55,7 +55,7 @@
<!-- 是学生 -->
<% if is_my_homework %>
<!-- 我的作品,在未开启匿评和未使用匿评,显示为编辑和删除 -->
<% if bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 %>
<% if bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 || bid.comment_status == 2 %>
<li class="wmine">
<%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
<% if homework.user == User.current || User.current.admin? %>
@ -69,7 +69,7 @@
<% end %>
</li>
<% else %>
<li class="wmine" title="只有开启匿评之前才能修改和删除作业哦!">
<li class="wmine" title="已开启匿评的作业不能进行修改和删除">
<a style="color:#8e8e8e;"><%= l(:button_edit) %></a>
<% if homework.user == User.current || User.current.admin? %>
<!-- 作业创建者显示删除作业 -->

View File

@ -47,9 +47,9 @@
<%= link_to User.current.login, user_path(User.current), :title => User.current.login%>
</span>
</li>
<li class="c_red" style="margin:25px 0 0 20px;"> 您还没交作业,请创建作业!</li>
<li class="c_red" style="margin:25px 0 0 20px;"> 您还没交作品,请创建作品</li>
<li class="wping">
<%= link_to "提交作", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
<%= link_to "提交作", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
</li>
</ul>
<div class="cl"></div>

View File

@ -497,14 +497,14 @@ zh:
label_teacher_list: 教师列表
label_student_list: 学生列表
label_limit_time: 截止日期
label_commit_homework: 提交作业
label_commit_homework: 提交作品
label_edit_homework: 修改作品
label_course_homework: 对应课程
label_course_doing: 进行中
label_course_done: 已结束
label_homework_response: 作业咨询
label_bidding_homework: 提交作
label_bidding_homework: 提交作
label_add_homework: 添加作业
label_edit_homework: 修改作业
label_delete_homework: 删除作业
label_new_homework: 创建作业