bug修复
This commit is contained in:
parent
d0010977dd
commit
b17305f848
|
|
@ -31,7 +31,7 @@ class ExerciseController < ApplicationController
|
|||
exercises = exercises.where("exercise_name like '%#{@search}%'")
|
||||
end
|
||||
@exercises = paginateHelper exercises,15 #分页
|
||||
@left_nav_type = 8
|
||||
@left_nav_type = 4
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
|
|
@ -172,7 +172,7 @@ class ExerciseController < ApplicationController
|
|||
@exercise = Exercise.find(params[:id])
|
||||
exercise_questions = @exercise.exercise_questions
|
||||
@exercise_questions = paginateHelper exercise_questions, 5
|
||||
@left_nav_type = 8
|
||||
@left_nav_type = 4
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_courses'}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,6 +12,15 @@ module CoursesHelper
|
|||
#AllPeople = StudentRoles+TeacherRoles
|
||||
## return people count
|
||||
|
||||
def student_course_homework_score course, user
|
||||
homework_ids = course.homework_commons.where("homework_type in (1, 4) and publish_time < '#{Time.now}'").map(&:id)
|
||||
score = 0
|
||||
user.student_works.where(:homework_common_id => homework_ids).each do |work|
|
||||
score = score + work.work_score if work.work_score
|
||||
end
|
||||
format("%.1f",score)
|
||||
end
|
||||
|
||||
# 学生的发布资源数
|
||||
def student_course_resource_num course, user
|
||||
num = course.attachments.where(:author_id => user.id).count
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<%= link_to '实训作业'.html_safe, shixuns_homework_common_index_path(:course => @course.id),:class => "color-grey", :remote => true %>
|
||||
</li>
|
||||
<li style="text-align:center;">
|
||||
<a class="color-grey" href="javascript:void(0)">试 卷</a>
|
||||
<%= link_to '试 卷'.html_safe, new_exercise_path(:course_id => @course.id),:class => "color-grey" %>
|
||||
</li>
|
||||
<li style="text-align:center;">
|
||||
<a class="color-grey" onclick="course_files_upload();" style="cursor: pointer">资 源</a>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
<td><%= link_to user.show_real_name, user_path(user), :class => 'edu-txt-w140 task-hide mt5 alink-name', :target => '_blank' %></td>
|
||||
<td><span class="edu-txt-w140 task-hide mt5"><%= user.user_extensions ? user.user_extensions.student_id : '' %></span></td>
|
||||
<td><%= member.course_group_id == 0 ? '未分班' : member.course_group.name %></td>
|
||||
<td><%#= student_course_resource_num @course, user %></td><!--作业成绩-->
|
||||
<td><%= student_course_homework_score @course, user %></td><!--作业成绩-->
|
||||
<td><%= student_course_resource_num @course, user %></td>
|
||||
<td><%= student_course_message_num @course, user %></td>
|
||||
<td><%= student_course_reply_num @course, user %></td>
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@
|
|||
</div>
|
||||
<% if @exercise.question_random == 1 %>
|
||||
<% question_list = @exercise.exercise_questions.shuffle %>
|
||||
<% else %>
|
||||
<% question_list = @exercise.exercise_questions %>
|
||||
<% end %>
|
||||
|
||||
<div class="clearfix ml15 mt10 mb15">
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@
|
|||
<%#= link_to( "+", new_board_message_path(:board_id => course_board.id), :class => 'fr mr15 font-18 link-color-grey', :title => "#{l(:label_message_new)}") if User.current.logged? %>
|
||||
</li>
|
||||
<% count = User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count %>
|
||||
<li class="clearfix" id="sy_08">
|
||||
<li class="clearfix" id="sy_04">
|
||||
<a href="<%= exercise_index_path(:course_id => @course.id) %>" class="fl ml15 ">试卷</a>
|
||||
<span class="edu-cir-grey fl ml10 mt15"><%= count %></span>
|
||||
<%#= link_to( "+", new_exercise_path(:course_id => @course.id), :class => 'fr mr15 font-18 link-color-grey', :title =>"新建试卷") if is_teacher %>
|
||||
|
|
|
|||
Loading…
Reference in New Issue