<% projects = activity.student_work_projects.where("is_leader = 1") %>
-
+ <% if homework_common.student_works.count != 0 %>
+ <% sw = homework_common.student_works.reorder("created_at desc").first %>
+
+ <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
+
+ <% if homework_common.student_works.count != 0 %>
+ <% sw_id = "("+homework_common.student_works.map{|sw| sw.id}.join(",")+")" %>
+ <% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
+ <% unless student_work_scores.empty? %>
+ <% last_score = student_work_scores.first %>
+
+ <%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品
+
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %>
diff --git a/db/schema.rb b/db/schema.rb
index 8dbd9813c..3728e8da0 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,8 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 20151102090519) do
+ActiveRecord::Schema.define(:version => 20151231023610) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -67,6 +66,41 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
t.datetime "updated_at", :null => false
end
+ create_table "at_messages", :force => true do |t|
+ t.integer "user_id"
+ t.integer "at_message_id"
+ t.string "at_message_type"
+ t.boolean "viewed", :default => false
+ t.string "container_type"
+ t.integer "container_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "sender_id"
+ end
+
+ add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id"
+
+ create_table "attachment_histories", :force => true do |t|
+ t.integer "container_id"
+ t.string "container_type"
+ t.string "filename", :default => ""
+ t.string "disk_filename", :default => ""
+ t.integer "filesize", :default => 0
+ t.string "content_type", :default => ""
+ t.string "digest", :limit => 40, :default => ""
+ t.integer "downloads", :default => 0
+ t.integer "author_id"
+ t.datetime "created_on"
+ t.string "description"
+ t.string "disk_directory"
+ t.integer "attachtype"
+ t.integer "is_public"
+ t.integer "copy_from"
+ t.integer "quotes"
+ t.integer "version"
+ t.integer "attachment_id"
+ end
+
create_table "attachments", :force => true do |t|
t.integer "container_id"
t.string "container_type", :limit => 30
@@ -384,6 +418,20 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
t.integer "container_id", :default => 0
end
+ create_table "course_contributor_scores", :force => true do |t|
+ t.integer "course_id"
+ t.integer "user_id"
+ t.integer "message_num"
+ t.integer "message_reply_num"
+ t.integer "news_reply_num"
+ t.integer "resource_num"
+ t.integer "journal_num"
+ t.integer "journal_reply_num"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "total_score"
+ end
+
create_table "course_groups", :force => true do |t|
t.string "name"
t.integer "course_id"
@@ -427,8 +475,8 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
t.string "code"
t.integer "time"
t.string "extra"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "location"
t.string "term"
t.string "string"
@@ -438,14 +486,16 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
t.string "class_period"
t.integer "school_id"
t.text "description"
- t.integer "status", :default => 1
- t.integer "attachmenttype", :default => 2
+ t.integer "status", :default => 1
+ t.integer "attachmenttype", :default => 2
t.integer "lft"
t.integer "rgt"
- t.integer "is_public", :limit => 1, :default => 1
- t.integer "inherit_members", :limit => 1, :default => 1
- t.integer "open_student", :default => 0
- t.integer "outline", :default => 0
+ t.integer "is_public", :limit => 1, :default => 1
+ t.integer "inherit_members", :limit => 1, :default => 1
+ t.integer "open_student", :default => 0
+ t.integer "outline", :default => 0
+ t.integer "publish_resource", :default => 0
+ t.integer "is_delete", :default => 0
t.integer "end_time"
t.string "end_term"
end
@@ -532,23 +582,32 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
add_index "documents", ["project_id"], :name => "documents_project_id"
- create_table "dts", :force => true do |t|
- t.string "IPLineCode"
- t.string "Description"
- t.string "Num"
- t.string "Variable"
- t.string "TraceInfo"
- t.string "Method"
+ create_table "dts", :primary_key => "Num", :force => true do |t|
+ t.string "Defect", :limit => 50
+ t.string "Category", :limit => 50
t.string "File"
- t.string "IPLine"
- t.string "Review"
- t.string "Category"
- t.string "Defect"
- t.string "PreConditions"
- t.string "StartLine"
+ t.string "Method"
+ t.string "Module", :limit => 20
+ t.string "Variable", :limit => 50
+ t.integer "StartLine"
+ t.integer "IPLine"
+ t.string "IPLineCode", :limit => 200
+ t.string "Judge", :limit => 15
+ t.integer "Review", :limit => 1
+ t.string "Description"
+ t.text "PreConditions", :limit => 2147483647
+ t.text "TraceInfo", :limit => 2147483647
+ t.text "Code", :limit => 2147483647
t.integer "project_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "id", :null => false
+ end
+
+ create_table "editor_of_documents", :force => true do |t|
+ t.integer "editor_id"
+ t.integer "org_document_comment_id"
+ t.datetime "created_at"
end
create_table "enabled_modules", :force => true do |t|
@@ -573,6 +632,66 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
+ create_table "exercise_answers", :force => true do |t|
+ t.integer "user_id"
+ t.integer "exercise_question_id"
+ t.integer "exercise_choice_id"
+ t.text "answer_text"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "exercise_choices", :force => true do |t|
+ t.integer "exercise_question_id"
+ t.text "choice_text"
+ t.integer "choice_position"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "exercise_questions", :force => true do |t|
+ t.text "question_title"
+ t.integer "question_type"
+ t.integer "question_number"
+ t.integer "exercise_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "question_score"
+ end
+
+ create_table "exercise_standard_answers", :force => true do |t|
+ t.integer "exercise_question_id"
+ t.integer "exercise_choice_id"
+ t.text "answer_text"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "exercise_users", :force => true do |t|
+ t.integer "user_id"
+ t.integer "exercise_id"
+ t.integer "score"
+ t.datetime "start_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.datetime "end_at"
+ t.integer "status"
+ end
+
+ create_table "exercises", :force => true do |t|
+ t.text "exercise_name"
+ t.text "exercise_description"
+ t.integer "course_id"
+ t.integer "exercise_status"
+ t.integer "user_id"
+ t.integer "time"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.datetime "publish_time"
+ t.datetime "end_time"
+ t.integer "show_result"
+ end
+
create_table "first_pages", :force => true do |t|
t.string "web_title"
t.string "title"
@@ -662,6 +781,19 @@ ActiveRecord::Schema.define(:version => 20151102090519) 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_groups", :force => true do |t|
+ t.integer "homework_common_id"
+ t.integer "min_num"
+ t.integer "max_num"
+ t.integer "base_on_project"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id"
+
create_table "homework_detail_manuals", :force => true do |t|
t.float "ta_proportion"
t.integer "comment_status"
@@ -818,16 +950,6 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
- create_table "journal_details_copy", :force => true do |t|
- t.integer "journal_id", :default => 0, :null => false
- t.string "property", :limit => 30, :default => "", :null => false
- t.string "prop_key", :limit => 30, :default => "", :null => false
- t.text "old_value"
- t.text "value"
- end
-
- add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id"
-
create_table "journal_replies", :id => false, :force => true do |t|
t.integer "journal_id"
t.integer "user_id"
@@ -947,6 +1069,7 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
t.boolean "locked", :default => false
t.integer "sticky", :default => 0
t.integer "reply_id"
+ t.integer "quotes"
end
add_index "messages", ["author_id"], :name => "index_messages_on_author_id"
@@ -964,6 +1087,7 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false
t.integer "course_id"
+ t.integer "sticky", :default => 0
end
add_index "news", ["author_id"], :name => "index_news_on_author_id"
@@ -1049,10 +1173,46 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
t.integer "project_id"
end
+ create_table "org_activities", :force => true do |t|
+ t.integer "user_id"
+ t.integer "org_act_id"
+ t.string "org_act_type"
+ t.integer "container_id"
+ t.string "container_type"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "org_courses", :force => true do |t|
+ t.integer "organization_id"
+ t.integer "course_id"
+ t.datetime "created_at"
+ end
+
+ create_table "org_document_comments", :force => true do |t|
+ t.text "title"
+ t.text "content"
+ t.integer "organization_id"
+ t.integer "creator_id"
+ t.integer "parent_id"
+ t.integer "reply_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.boolean "locked", :default => false
+ t.integer "sticky", :default => 0
+ t.integer "org_subfield_id"
+ end
+
+ create_table "org_member_roles", :force => true do |t|
+ t.integer "org_member_id"
+ t.integer "role_id"
+ end
+
create_table "org_members", :force => true do |t|
- t.integer "user_id"
- t.integer "organization_id"
- t.string "role"
+ t.integer "user_id"
+ t.integer "organization_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "org_projects", :force => true do |t|
@@ -1212,27 +1372,30 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
end
create_table "projects", :force => true do |t|
- t.string "name", :default => "", :null => false
+ t.string "name", :default => "", :null => false
t.text "description"
- t.string "homepage", :default => ""
- t.boolean "is_public", :default => true, :null => false
+ t.string "homepage", :default => ""
+ t.boolean "is_public", :default => true, :null => false
t.integer "parent_id"
t.datetime "created_on"
t.datetime "updated_on"
t.string "identifier"
- t.integer "status", :default => 1, :null => false
+ t.integer "status", :default => 1, :null => false
t.integer "lft"
t.integer "rgt"
- t.boolean "inherit_members", :default => false, :null => false
+ t.boolean "inherit_members", :default => false, :null => false
t.integer "project_type"
- t.boolean "hidden_repo", :default => false, :null => false
- t.integer "attachmenttype", :default => 1
+ t.boolean "hidden_repo", :default => false, :null => false
+ t.integer "attachmenttype", :default => 1
t.integer "user_id"
- t.integer "dts_test", :default => 0
+ t.integer "dts_test", :default => 0
t.string "enterprise_name"
t.integer "organization_id"
t.integer "project_new_type"
t.integer "gpid"
+ t.integer "forked_from_project_id"
+ t.integer "forked_count"
+ t.integer "commits_count", :default => 0
end
add_index "projects", ["lft"], :name => "index_projects_on_lft"
@@ -1397,6 +1560,21 @@ ActiveRecord::Schema.define(:version => 20151102090519) do
t.integer "project_id"
end
+ create_table "student_work_projects", :force => true do |t|
+ t.integer "homework_common_id"
+ t.integer "student_work_id"
+ t.integer "project_id"
+ t.integer "user_id"
+ t.integer "is_leader"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id"
+ add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id"
+ add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id"
+ add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id"
+
create_table "student_work_tests", :force => true do |t|
t.integer "student_work_id"
t.datetime "created_at", :null => false
@@ -1424,6 +1602,8 @@ ActiveRecord::Schema.define(:version => 20151102090519) 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"
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 2e8133172..1b94a0c50 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -1220,6 +1220,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;}
.mr150 {margin-right:150px;}
.relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;}
+.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}
/*上传资源弹窗*/
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
@@ -1259,3 +1260,5 @@ div.disable_link {background-color: #c1c1c1 !important;}
.fileTagWrap{ width:710px;}
.boxShadow {box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
+
+.fn {font-weight:normal}
diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css
index b37a38da0..2279f0fe5 100644
--- a/public/stylesheets/org.css
+++ b/public/stylesheets/org.css
@@ -103,4 +103,8 @@ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
.sectionContent span {width:175px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:18px; vertical-align:middle;}.popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px;
background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.org_login_list a {color:#269ac9;}
-div.flash {margin-top :0px !important}
\ No newline at end of file
+div.flash {margin-top :0px !important}
+
+.w80{ width:80px;}
+.relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;}
+.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}
\ No newline at end of file