<%=render :partial => 'homework_repository', :locals => {:homeworks => homeworks} %>
diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb
index 2cd1f5b21..5eaf61569 100644
--- a/app/views/users/user_homeworks.html.erb
+++ b/app/views/users/user_homeworks.html.erb
@@ -41,7 +41,10 @@
我的题库
-
+
+ 申请题库
+
+
-
diff --git a/db/migrate/20160427061847_add_column_to_student_works.rb b/db/migrate/20160427061847_add_column_to_student_works.rb
new file mode 100644
index 000000000..1b18ebab6
--- /dev/null
+++ b/db/migrate/20160427061847_add_column_to_student_works.rb
@@ -0,0 +1,27 @@
+class AddColumnToStudentWorks < ActiveRecord::Migration
+ def change
+ add_column :student_works, :work_score, :float
+ count = StudentWork.all.count / 30 + 2
+ transaction do
+ for i in 1 ... count do i
+ StudentWork.page(i).per(30).each do |sw|
+ if sw.homework_common && sw.homework_common.teacher_priority == 0
+ unless sw.final_score.nil?
+ score = sw.final_score - sw.absence_penalty - sw.late_penalty
+ sw.update_column('work_score', score < 0 ? 0 : score)
+ end
+ elsif sw.homework_common && sw.homework_common.teacher_priority == 1
+ unless sw.final_score.nil?
+ if sw.teacher_score
+ sw.update_column('work_score', sw.teacher_score)
+ else
+ score = sw.final_score - sw.absence_penalty - sw.late_penalty
+ sw.update_column('work_score', score < 0 ? 0 : score)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 0b871cc6f..70fb756fb 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 => 20160421011543) do
+ActiveRecord::Schema.define(:version => 20160427075457) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -334,17 +334,6 @@ ActiveRecord::Schema.define(:version => 20160421011543) do
t.boolean "diff_all"
end
- create_table "code_tests", :force => true do |t|
- t.integer "homework_id"
- t.integer "wait_time", :default => 0
- t.integer "language"
- t.integer "status"
- t.integer "time_used", :default => 0
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "student_work_id", :default => 0
- end
-
create_table "comments", :force => true do |t|
t.string "commented_type", :limit => 30, :default => "", :null => false
t.integer "commented_id", :default => 0, :null => false
@@ -1691,7 +1680,6 @@ ActiveRecord::Schema.define(:version => 20160421011543) do
t.integer "status", :default => 9
t.text "results"
t.text "src"
- t.integer "uwait_time", :default => 0
end
create_table "student_works", :force => true do |t|
@@ -1710,8 +1698,9 @@ ActiveRecord::Schema.define(:version => 20160421011543) do
t.integer "absence_penalty", :default => 0
t.float "system_score", :default => 0.0
t.boolean "is_test", :default => false
- t.integer "simi_id", :default => 0
- t.integer "simi_value", :default => 0
+ t.integer "simi_id"
+ t.integer "simi_value"
+ t.float "work_score"
end
add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"
@@ -1944,6 +1933,25 @@ ActiveRecord::Schema.define(:version => 20160421011543) do
add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade"
add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count"
+ create_table "user_wechats", :force => true do |t|
+ t.integer "subscribe"
+ t.string "openid"
+ t.string "nickname"
+ t.integer "sex"
+ t.string "language"
+ t.string "city"
+ t.string "province"
+ t.string "country"
+ t.string "headimgurl"
+ t.string "subscribe_time"
+ t.string "unionid"
+ t.string "remark"
+ t.integer "groupid"
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "users", :force => true do |t|
t.string "login", :default => "", :null => false
t.string "hashed_password", :limit => 40, :default => "", :null => false
@@ -2020,6 +2028,14 @@ ActiveRecord::Schema.define(:version => 20160421011543) do
t.datetime "updated_at", :null => false
end
+ create_table "wechat_logs", :force => true do |t|
+ t.string "openid", :null => false
+ t.text "request_raw"
+ t.text "response_raw"
+ t.text "session_raw"
+ t.datetime "created_at", :null => false
+ end
+
create_table "wiki_content_versions", :force => true do |t|
t.integer "wiki_content_id", :null => false
t.integer "page_id", :null => false
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index eece88a23..1e24c34f4 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -707,7 +707,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
.homepagePostReplyDes {float:left; width:642px; margin-left:15px;}
.homepagePostReplyPublisher {font-size:12px; color:#888888; margin-bottom:5px;}
-.homepagePostReplyContent {font-size:12px; color:#484848; margin:3px 5px 12px 5px;font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: 微软雅黑, 宋体;}
+.homepagePostReplyContent {font-size:12px; color:#484848; margin:3px 5px 12px 5px;font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family:"微软雅黑","宋体";}
.table_maxWidth table {max-width: 642px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
@@ -717,7 +717,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
a.postGrey {color:#484848;}
a.postGrey:hover {color:#000000;}
a.gz_btn{display:block; background:url(../images/pic_uersall.png) -318px -25px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;margin-top: 2px;margin-right: 15px;}
-a:hover.gz_btn{ color:#ff5722;}
+a:hover .gz_btn{color:#ff5722;}
.homepagePostReplyjournal{margin-left: 15px; float: left;}
.lh18 {line-height: 18px;}
/*该高度会写入配置文件*/
@@ -1472,9 +1472,10 @@ a.choose-active {background-color:#269ac9; color:#ffffff;}
/*20160301新题库样式*/
.subject-list-banner {width:685px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
.subject-list-banner li {height:40px; line-height:40px; vertical-align:middle;}
-.subject-list-name {width:260px; padding-left:10px; padding-right:10px;}
+.subject-list-name {width:190px; padding-left:10px; padding-right:10px;}
.subject-list-publisher {width:80px; text-align:center;}
.subject-list-date {width:70px; text-align:center;}
+.subject-list-option {width:70px; text-align:center;}
.subject-list-row {width:685px; height:40px; color:#7a7a7a; font-size:12px;}
.subject-list-row li {height:40px; line-height:40px; vertical-align:middle;}
.subject-list-search {border:1px solid #dddddd; height:32px; width:250px;}
@@ -1484,6 +1485,8 @@ a.choose-active {background-color:#269ac9; color:#ffffff;}
.subject-list-type {width:50px; text-align:center;}
.subject-list-count {width:60px; text-align:center;}
.subject-list-from {width:145px; text-align:center;}
+.subject-name-middle {display:inline-block; line-height:40px; vertical-align:middle;}
+.subject-name-hidden {max-width:150px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
/*视频播放默认图标*/
.mediaIco{margin: 30px 0 30px 20px;width: 200px;}
@@ -1543,4 +1546,4 @@ ul.wlist li{float: left;}
ul.wlist li a{ border:1px solid #15bccf; padding: 1px 4px 1px 4px; margin-left:3px;}
ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
/*.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}*/
-.wlist_select a{background-color: #64bdd9;cursor: default;}
\ No newline at end of file
+.wlist_select a{background-color: #64bdd9;cursor: default;}
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index f3403aa78..ac6425b94 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -172,6 +172,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.w600{ width:600px !important;}
.w606{ width:606px }
.w705{ width:705px;}
+.w680{ width: 680px;}
.w770{ width:770px;}
.h20{height: 20px;}
.h22{ height:22px;}