作品列表相关功能补充
This commit is contained in:
parent
d04f149083
commit
ed8b14bce1
|
|
@ -252,6 +252,32 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
# 判断作业有多少人提交了
|
||||
#
|
||||
def had_commit_studentwork_count homework_common
|
||||
if homework_common.homework_type == 3
|
||||
homework_common.student_works.count
|
||||
else
|
||||
StudentWork.where("work_status !=? and homework_common_id=?",0, homework_common.id).count
|
||||
end
|
||||
end
|
||||
|
||||
# 未提交作品数统计
|
||||
def had_uncommit_studentwork_count homework_common
|
||||
if homework_common.homework_type == 3
|
||||
homework_common.course.student.count - homework_common.student_works.count
|
||||
else
|
||||
StudentWork.where(:homework_common_id => homework_common.id, :work_status => 0).count
|
||||
end
|
||||
end
|
||||
|
||||
# 未评阅
|
||||
def had_unevaluate_count homework_common
|
||||
count = StudentWorksScore.find_by_sql("SELECT distinct student_work_id as count FROM student_works_scores sws, student_works sw, homework_commons hc where hc.id =#{homework_common.id} and sw.homework_common_id=hc.id and sws.student_work_id = sw.id and sws.user_id=#{User.current.id};").first.try(:count).to_i
|
||||
student_count = homework_common.course.student.count
|
||||
return student_count - count
|
||||
end
|
||||
|
||||
# 公共分页
|
||||
def paginator_list objs, objs_count, limit, is_remote
|
||||
@is_remote = is_remote
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
<div class="edu-con-top clearfix" >
|
||||
<p class="fl task-form-60 mt3 ml15">
|
||||
<a href="<%= homework_common_index_path(:course => @course.id) %>" class="edu-filter-cir-grey mr5 active" data-remote="true">全部</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 0, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">挂起</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 1, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">提交中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 2, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">补交中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 3, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">匿评中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 4, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">申诉中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 5, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">评阅中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 6, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">已结束</a>
|
||||
</p>
|
||||
<div id="search_div" class="edu-position fr task-form-30 mr15">
|
||||
<%= render :partial => 'homework_search_form', :locals => {:course => @course} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if homework_commons.count != 0 %>
|
||||
<% homework_commons.each_with_index do |homework_common, index|%>
|
||||
<div class=" clearfix edu-class-con-list">
|
||||
|
|
@ -24,6 +8,14 @@
|
|||
<p class="color-grey font-12">
|
||||
<span class=" "># <%= index + 1 %></span>
|
||||
<span class=" ml30">创建于<%=time_from_now homework_common.created_at %></span>
|
||||
<% if [1,2,4,5,6].include?(homework_common.homework_detail_manual.try(:comment_status)) %>
|
||||
<span class=" ml30"><a class="link-color-grey mr5"><%= had_commit_studentwork_count homework_common %></a>已交</span>
|
||||
<span class=" ml30"><a class="link-color-grey mr5"><%= had_uncommit_studentwork_count homework_common %></a>未交</span>
|
||||
<% if @is_teacher %>
|
||||
<span class=" ml30"><a class="link-color-grey mr5"><%= had_unevaluate_count homework_common %></a>未评</span>
|
||||
<% end %>
|
||||
<!--<span class=" ml30 color-orange">10 天 5 小时 12 分</span>-->
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<% if @is_teacher %>
|
||||
|
|
|
|||
|
|
@ -3,11 +3,25 @@
|
|||
<div class="edu-con-top clearfix">
|
||||
<p class="ml15 color-grey fl">作业列表</p>
|
||||
<a href="#" class="task-btn task-btn-blue fr mr20">新建</a>
|
||||
<a href="#" class="edu-btn fr mr10">题库选用</a>
|
||||
<a href="#" class="edu-btn fr mr10">导出成绩</a>
|
||||
<%= link_to("题库选用", user_import_homeworks_user_path(User.current.id, :select_course => defined?(@course)), :class => "edu-btn fr mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") %>
|
||||
<a href="<%= export_course_member_excel_course_path(@course) %>" class="edu-btn fr mr10">导出成绩</a>
|
||||
</div>
|
||||
<div class="edu-class-innner-conbox">
|
||||
<div id="homework_index_list">
|
||||
<div class="edu-con-top clearfix" >
|
||||
<p class="fl task-form-60 mt3 ml15">
|
||||
<a href="<%= homework_common_index_path(:course => @course.id) %>" class="edu-filter-cir-grey mr5 active" data-remote="true">全部</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 0, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">挂起</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 1, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">提交中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 2, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">补交中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 3, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">匿评中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 4, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">申诉中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 5, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">评阅中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 6, :search => @search) %>" class="edu-filter-cir-grey mr5" data-remote="true">已结束</a>
|
||||
</p>
|
||||
<div id="search_div" class="edu-position fr task-form-30 mr15">
|
||||
<%= render :partial => 'homework_search_form', :locals => {:course => @course} %>
|
||||
</div>
|
||||
</div> <div id="homework_index_list">
|
||||
<%= render :partial => 'homework_common/homework_index_list', :locals => {:homework_commons => @homeworks,:course_id => @course.id} %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue