Merge branch 'yuanke' into develop

This commit is contained in:
cxt 2016-07-15 15:56:37 +08:00
commit dbc8f87346
3 changed files with 2093 additions and 2285 deletions

View File

@ -968,7 +968,7 @@ class CoursesController < ApplicationController
@homework = HomeworkCommon.find params[:homework] @homework = HomeworkCommon.find params[:homework]
#order("#{@order} #{@b_sort}" #order("#{@order} #{@b_sort}"
@student_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("simi_value desc"),@name @student_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("simi_value desc").has_committed,@name
@works_hash = {} @works_hash = {}

View File

@ -271,7 +271,7 @@ class StudentWorkController < ApplicationController
all_studentwork = find_all_student_work_by_homeid() all_studentwork = find_all_student_work_by_homeid()
@work_count = all_studentwork.count @work_count = all_studentwork.has_committed.count
end end
#代码查重 status: 0完成 -2不需要查重 -1查重失败不支持该语言 #代码查重 status: 0完成 -2不需要查重 -1查重失败不支持该语言
@ -282,7 +282,7 @@ class StudentWorkController < ApplicationController
@homework = HomeworkCommon.find params[:homework] @homework = HomeworkCommon.find params[:homework]
all_studentwork = find_all_student_work_by_homeid() all_studentwork = find_all_student_work_by_homeid().has_committed
if all_studentwork == nil if all_studentwork == nil
resultObj[:status] = -2 resultObj[:status] = -2

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160709015740) do ActiveRecord::Schema.define(:version => 20160414055511) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -57,29 +57,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.integer "user_id", :null => false t.integer "user_id", :null => false
end end
create_table "apply_add_schools", :force => true do |t|
t.string "name"
t.string "province"
t.string "city"
t.string "address"
t.string "remarks"
t.integer "school_id"
t.integer "status", :default => 0
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "apply_homeworks", :force => true do |t|
t.integer "status"
t.integer "user_id"
t.integer "homework_common_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id"
add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id"
create_table "apply_project_masters", :force => true do |t| create_table "apply_project_masters", :force => true do |t|
t.integer "user_id" t.integer "user_id"
t.string "apply_type" t.string "apply_type"
@ -89,18 +66,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "apply_resources", :force => true do |t|
t.integer "status"
t.integer "user_id"
t.integer "attachment_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "container_id"
t.string "container_type"
t.text "content"
t.integer "apply_user_id"
end
create_table "at_messages", :force => true do |t| create_table "at_messages", :force => true do |t|
t.integer "user_id" t.integer "user_id"
t.integer "at_message_id" t.integer "at_message_id"
@ -369,17 +334,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.boolean "diff_all" t.boolean "diff_all"
end 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| create_table "comments", :force => true do |t|
t.string "commented_type", :limit => 30, :default => "", :null => false t.string "commented_type", :limit => 30, :default => "", :null => false
t.integer "commented_id", :default => 0, :null => false t.integer "commented_id", :default => 0, :null => false
@ -474,15 +428,15 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
create_table "course_contributor_scores", :force => true do |t| create_table "course_contributor_scores", :force => true do |t|
t.integer "course_id" t.integer "course_id"
t.integer "user_id" t.integer "user_id"
t.integer "message_num", :default => 0 t.integer "message_num"
t.integer "message_reply_num", :default => 0 t.integer "message_reply_num"
t.integer "news_reply_num", :default => 0 t.integer "news_reply_num"
t.integer "resource_num", :default => 0 t.integer "resource_num"
t.integer "journal_num", :default => 0 t.integer "journal_num"
t.integer "journal_reply_num", :default => 0 t.integer "journal_reply_num"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "total_score", :default => 0 t.integer "total_score"
t.integer "homework_journal_num", :default => 0 t.integer "homework_journal_num", :default => 0
t.integer "news_num", :default => 0 t.integer "news_num", :default => 0
end end
@ -509,10 +463,8 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.integer "viewed" t.integer "viewed"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.text "content" t.string "content"
t.integer "status" t.integer "status"
t.integer "apply_user_id"
t.integer "apply_result"
end end
add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type"
@ -562,14 +514,8 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.integer "excellent_option", :default => 0 t.integer "excellent_option", :default => 0
t.integer "is_copy", :default => 0 t.integer "is_copy", :default => 0
t.integer "visits", :default => 0 t.integer "visits", :default => 0
t.string "invite_code"
t.string "qrcode"
t.integer "syllabus_id"
end end
add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true
add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id"
create_table "custom_fields", :force => true do |t| create_table "custom_fields", :force => true do |t|
t.string "type", :limit => 30, :default => "", :null => false t.string "type", :limit => 30, :default => "", :null => false
t.string "name", :limit => 30, :default => "", :null => false t.string "name", :limit => 30, :default => "", :null => false
@ -1295,7 +1241,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.boolean "locked", :default => false t.boolean "locked", :default => false
t.integer "sticky", :default => 0 t.integer "sticky", :default => 0
t.integer "org_subfield_id" t.integer "org_subfield_id"
t.integer "status", :default => 0
end end
create_table "org_member_roles", :force => true do |t| create_table "org_member_roles", :force => true do |t|
@ -1359,7 +1304,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.boolean "allow_guest_download", :default => true t.boolean "allow_guest_download", :default => true
t.integer "visits", :default => 0 t.integer "visits", :default => 0
t.integer "show_mode", :default => 0 t.integer "show_mode", :default => 0
t.integer "allow_teacher", :default => 0
end end
create_table "phone_app_versions", :force => true do |t| create_table "phone_app_versions", :force => true do |t|
@ -1520,7 +1464,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.integer "journals_count", :default => 0 t.integer "journals_count", :default => 0
t.integer "boards_reply_count", :default => 0 t.integer "boards_reply_count", :default => 0
t.integer "visits", :default => 0 t.integer "visits", :default => 0
t.integer "hot", :default => 0
end end
add_index "projects", ["lft"], :name => "index_projects_on_lft" add_index "projects", ["lft"], :name => "index_projects_on_lft"
@ -1534,19 +1477,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true
add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id"
create_table "quality_analyses", :force => true do |t|
t.integer "project_id"
t.string "author_login"
t.string "rep_identifier"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "sonar_version", :default => 0
t.string "path"
t.string "branch"
t.string "language"
t.string "sonar_name"
end
create_table "queries", :force => true do |t| create_table "queries", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.string "name", :default => "", :null => false t.string "name", :default => "", :null => false
@ -1591,18 +1521,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.string "topic_resource" t.string "topic_resource"
end end
create_table "rep_statics", :force => true do |t|
t.integer "project_id"
t.integer "commits_num"
t.string "uname"
t.string "email"
t.integer "add"
t.integer "del"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "changeset"
end
create_table "repositories", :force => true do |t| create_table "repositories", :force => true do |t|
t.integer "project_id", :default => 0, :null => false t.integer "project_id", :default => 0, :null => false
t.string "url", :default => "", :null => false t.string "url", :default => "", :null => false
@ -1649,7 +1567,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.string "logo_link" t.string "logo_link"
t.string "pinyin" t.string "pinyin"
t.integer "school_type", :default => 0
end end
create_table "secdomains", :force => true do |t| create_table "secdomains", :force => true do |t|
@ -1711,15 +1628,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "shield_wechat_messages", :force => true do |t|
t.integer "container_id"
t.string "container_type"
t.integer "shield_id"
t.string "shield_type"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "softapplications", :force => true do |t| create_table "softapplications", :force => true do |t|
t.string "name" t.string "name"
t.text "description" t.text "description"
@ -1738,28 +1646,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.integer "project_id" t.integer "project_id"
end end
create_table "sonar_errors", :force => true do |t|
t.integer "project_id"
t.string "jenkins_job_name"
t.text "output"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "ssos", :force => true do |t|
t.integer "user_id"
t.string "openid"
t.string "name"
t.string "password"
t.string "email"
t.integer "sex"
t.string "school"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id"
create_table "student_work_projects", :force => true do |t| create_table "student_work_projects", :force => true do |t|
t.integer "homework_common_id" t.integer "homework_common_id"
t.integer "student_work_id" t.integer "student_work_id"
@ -1802,8 +1688,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.boolean "is_test", :default => false t.boolean "is_test", :default => false
t.integer "simi_id" t.integer "simi_id"
t.integer "simi_value" t.integer "simi_value"
t.float "work_score"
t.integer "work_status", :default => 0
end end
add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"
@ -1835,31 +1719,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id"
add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id"
create_table "sub_document_comments", :force => true do |t|
t.text "content"
t.text "title"
t.integer "sub_domain_id"
t.integer "creator_id"
t.integer "parent_id"
t.integer "reply_id"
t.integer "locked"
t.integer "sticky"
t.integer "org_subfield_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "sub_domains", :force => true do |t|
t.integer "org_subfield_id"
t.integer "priority", :default => 0
t.string "name"
t.string "field_type"
t.integer "hide", :default => 0
t.integer "status", :default => 0
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "subfield_subdomain_dirs", :force => true do |t| create_table "subfield_subdomain_dirs", :force => true do |t|
t.integer "org_subfield_id" t.integer "org_subfield_id"
t.string "name" t.string "name"
@ -1867,26 +1726,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "syllabuses", :force => true do |t|
t.string "title"
t.text "description"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "eng_name"
t.integer "syllabus_type"
t.integer "credit"
t.integer "hours"
t.integer "theory_hours"
t.integer "practice_hours"
t.string "applicable_major"
t.string "pre_course"
t.integer "visits", :default => 0
t.integer "des_status", :default => 0
end
add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id"
create_table "system_messages", :force => true do |t| create_table "system_messages", :force => true do |t|
t.integer "user_id" t.integer "user_id"
t.string "content" t.string "content"
@ -2081,25 +1920,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade"
add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" 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| create_table "users", :force => true do |t|
t.string "login", :default => "", :null => false t.string "login", :default => "", :null => false
t.string "hashed_password", :limit => 40, :default => "", :null => false t.string "hashed_password", :limit => 40, :default => "", :null => false
@ -2119,8 +1939,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.string "salt", :limit => 64 t.string "salt", :limit => 64
t.integer "gid" t.integer "gid"
t.integer "visits", :default => 0 t.integer "visits", :default => 0
t.integer "excellent_teacher", :default => 0
t.integer "excellent_student", :default => 0
end end
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
@ -2178,16 +1996,6 @@ ActiveRecord::Schema.define(:version => 20160709015740) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end 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
add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid"
create_table "wiki_content_versions", :force => true do |t| create_table "wiki_content_versions", :force => true do |t|
t.integer "wiki_content_id", :null => false t.integer "wiki_content_id", :null => false
t.integer "page_id", :null => false t.integer "page_id", :null => false