diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 603f7febb..c8b5a20b0 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -212,7 +212,7 @@
<% contributor_course_scor(@course.id).each do |contributor_score| %>
<% unless contributor_score.total_score ==0 %>
<%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(contributor_score.user) %>
- <%=link_to contributor_score.user, user_path(contributor_score.user), :title => contributor_score.user %>
+ <%=link_to contributor_score.user.show_name, user_path(contributor_score.user), :title => contributor_score.user.show_name %>
<%= contributor_score.total_score.to_i %>
@@ -244,9 +244,9 @@
课程英雄榜
<% hero_homework_scores.each do |student_score| %>
- <% unless student_score.score.nil? %>
+ <% if student_score.score != 0 %>
- <%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %>
-
<%=link_to student_score.user, user_path(student_score.user), :title => student_score.user %>
+ <%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %>
<%= student_score.score.to_i %>
<% end %>
diff --git a/db/migrate/20151130031446_add_index_to_homework_commons.rb b/db/migrate/20151130031446_add_index_to_homework_commons.rb
new file mode 100644
index 000000000..f0a0b86d5
--- /dev/null
+++ b/db/migrate/20151130031446_add_index_to_homework_commons.rb
@@ -0,0 +1,5 @@
+class AddIndexToHomeworkCommons < ActiveRecord::Migration
+ def change
+ add_index :homework_commons, [:course_id, :id]
+ end
+end
diff --git a/db/migrate/20151130033906_add_index_to_student_works.rb b/db/migrate/20151130033906_add_index_to_student_works.rb
new file mode 100644
index 000000000..2f990f5a7
--- /dev/null
+++ b/db/migrate/20151130033906_add_index_to_student_works.rb
@@ -0,0 +1,5 @@
+class AddIndexToStudentWorks < ActiveRecord::Migration
+ def change
+ add_index :student_works, [:homework_common_id, :user_id]
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 87342bf9c..70b64ec7b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20151127011351) do
+ActiveRecord::Schema.define(:version => 20151130033906) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -736,6 +736,8 @@ ActiveRecord::Schema.define(:version => 20151127011351) do
t.integer "anonymous_comment", :default => 0
end
+ add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id"
+
create_table "homework_detail_manuals", :force => true do |t|
t.float "ta_proportion"
t.integer "comment_status"
@@ -961,6 +963,7 @@ ActiveRecord::Schema.define(:version => 20151127011351) do
t.integer "course_group_id", :default => 0
end
+ add_index "members", ["course_id"], :name => "index_members_on_course_id"
add_index "members", ["project_id"], :name => "index_members_on_project_id"
add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true
add_index "members", ["user_id"], :name => "index_members_on_user_id"
@@ -1506,6 +1509,8 @@ ActiveRecord::Schema.define(:version => 20151127011351) do
t.boolean "is_test", :default => false
end
+ add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"
+
create_table "student_works_evaluation_distributions", :force => true do |t|
t.integer "student_work_id"
t.integer "user_id"