Merge branch 'yuanke' into develop
Conflicts: app/controllers/student_work_controller.rb config/locales/zh.yml db/schema.rb
This commit is contained in:
commit
b3fdc45a04
|
@ -5,7 +5,7 @@ class StudentWorkController < ApplicationController
|
|||
include ApplicationHelper
|
||||
require 'bigdecimal'
|
||||
require "base64"
|
||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex,:code_repeattest,:work_canrepeat,:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,:search_course_students]
|
||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex,:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,:search_course_students]
|
||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment]
|
||||
before_filter :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work]
|
||||
before_filter :author_of_work, :only => [:edit, :update, :destroy]
|
||||
|
@ -81,8 +81,6 @@ class StudentWorkController < ApplicationController
|
|||
#根据传入的tIndex确定是第几次测试
|
||||
#之后如果觉得很卡 可以改成将结果传回JS再以参数形式传回来
|
||||
def program_test_ex
|
||||
tStarttime = Time.now
|
||||
|
||||
is_test = params[:is_test] == 'true'
|
||||
resultObj = {status: 0, results: [], error_msg: '', time: Time.now.strftime('%Y-%m-%d %T'),tseq:1,tcount:1,testid:1} #保存每测试一次返回的结果
|
||||
|
||||
|
@ -100,17 +98,8 @@ class StudentWorkController < ApplicationController
|
|||
test = @homework.homework_tests[index - 1]
|
||||
|
||||
#请求测试
|
||||
begin
|
||||
result = test_realtime_ex(test, params[:src])
|
||||
rescue Timeout::Error
|
||||
tEndtime = Time.now
|
||||
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
|
||||
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
|
||||
result = test_realtime_ex(test, params[:src])
|
||||
|
||||
#status 0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
|
||||
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>-3,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
|
||||
|
||||
end
|
||||
if result["status"].to_i != -2
|
||||
#result["results"].first['output'] = result["results"].first['output'].gsub(" ","□")
|
||||
#result["results"].first['result'] = result["results"].first['result'].gsub(" ","□")
|
||||
|
@ -125,19 +114,11 @@ class StudentWorkController < ApplicationController
|
|||
resultObj[:results] = result["results"].first #本次测试结果
|
||||
resultObj[:error_msg] = result["error_msg"] #编译错误时的信息
|
||||
|
||||
#该状态用于存入CodeTests
|
||||
tmpstatus = -1
|
||||
if result["status"].to_i == -2 #编译错误
|
||||
resultObj[:results] = result["error_msg"]
|
||||
resultObj[:status] = -2
|
||||
tmpstatus = -2
|
||||
elsif result["results"][0]["status"].to_i == 2
|
||||
resultObj[:status] = 2
|
||||
tmpstatus = 2
|
||||
end
|
||||
|
||||
if result["status"] == 0
|
||||
tmpstatus = 0
|
||||
end
|
||||
|
||||
unless student_work.save
|
||||
|
@ -153,14 +134,6 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
#每次从数据库取出上次的结果加上本次的结果再存入数据库
|
||||
if result["status"].to_i != -2
|
||||
result["results"].first['user_wait'] = tUsedtime
|
||||
|
||||
if result["results"][0]["status"].to_i == 2
|
||||
result["status"] = 2
|
||||
end
|
||||
end
|
||||
|
||||
status = result["status"]
|
||||
if index == 1
|
||||
student_work_test = student_work.student_work_tests.build(status: status,
|
||||
|
@ -189,19 +162,6 @@ class StudentWorkController < ApplicationController
|
|||
resultObj[:index] = student_work.student_work_tests.count
|
||||
end
|
||||
|
||||
#将每次用户等待时间都存起来以便管理界面显示用
|
||||
tEndtime = Time.now
|
||||
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
|
||||
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
|
||||
|
||||
time_used = 0
|
||||
if result["status"].to_i != -2
|
||||
#至少一毫秒
|
||||
time_used = result["results"].first['time_used'] == 0 ? 1:result["results"].first['time_used']
|
||||
end
|
||||
#0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
|
||||
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>time_used,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
|
||||
|
||||
#渲染返回结果
|
||||
render :json => resultObj
|
||||
end
|
||||
|
@ -209,114 +169,6 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#找出该作业的所有提交作业
|
||||
def find_all_student_work_by_homeid()
|
||||
all_studentwork = StudentWork.where("homework_common_id =#{@homework.id} and is_test = 0 ")
|
||||
|
||||
all_studentwork
|
||||
end
|
||||
|
||||
def request_code_repeattest(src)
|
||||
url = "#{Redmine::Configuration['jplag_server']}api/realtime_test.json"
|
||||
|
||||
factor = []
|
||||
src.each do |test|
|
||||
factor << {work_id: test.id, des: test.description,created_at:test.created_at.to_i}
|
||||
end
|
||||
|
||||
solutions = {
|
||||
homeid:@homework.id,
|
||||
language:@homework.homework_detail_programing.language,
|
||||
factor: factor
|
||||
}
|
||||
uri = URI(url)
|
||||
body = solutions.to_json
|
||||
|
||||
logger.debug "send body"
|
||||
logger.debug body
|
||||
|
||||
res = Net::HTTP.new(uri.host, uri.port).start do |client|
|
||||
request = Net::HTTP::Post.new(uri.path)
|
||||
request.body = body
|
||||
request["Content-Type"] = "application/json"
|
||||
client.request(request)
|
||||
end
|
||||
|
||||
JSON.parse(res.body)
|
||||
end
|
||||
|
||||
#点击代码查重按钮
|
||||
def work_canrepeat
|
||||
@homework_id = params[:homework]
|
||||
@course_id = params[:course_id]
|
||||
|
||||
all_studentwork = find_all_student_work_by_homeid()
|
||||
|
||||
@work_count = all_studentwork.count
|
||||
end
|
||||
|
||||
#代码查重 status: 0完成 -2不需要查重 -1查重失败不支持该语言
|
||||
def code_repeattest
|
||||
tStarttime = Time.now
|
||||
logger.debug "code_repeattest start is #{tStarttime}}"
|
||||
resultObj = {status: -2}
|
||||
|
||||
@homework = HomeworkCommon.find params[:homework]
|
||||
|
||||
all_studentwork = find_all_student_work_by_homeid()
|
||||
|
||||
if all_studentwork == nil
|
||||
resultObj[:status] = -2
|
||||
elsif all_studentwork.count <= 1
|
||||
resultObj[:status] = -2
|
||||
else
|
||||
|
||||
#@homework.homework_detail_programing.language、id、description
|
||||
logger.debug "time1 is #{Time.now.usec} "
|
||||
result = request_code_repeattest(all_studentwork)
|
||||
logger.debug "time2 is #{Time.now.usec} "
|
||||
|
||||
resultObj[:status] = result['status'].to_i
|
||||
# resultObj[:results] = result['results']
|
||||
|
||||
#Time.now, simi_id = simiworkid , simi_value = simivalue
|
||||
if resultObj[:status] == 0
|
||||
@homework.simi_time = Time.now
|
||||
resultObj[:comparetime] = @homework.simi_time
|
||||
@homework.update_column('simi_time', @homework.simi_time)
|
||||
|
||||
logger.debug "time3 is #{Time.now.usec} "
|
||||
result['results'].each do |key,value|
|
||||
@student_work = StudentWork.where("id =?", key.to_i).first
|
||||
@student_work.update_column('simi_id', value['simiworkid'].to_i)
|
||||
@student_work.update_column('simi_value', value['simivalue'].to_i)
|
||||
# sqlstr = "update student_works set simi_id=#{value['simiworkid']},simi_value=#{value['simivalue']} where id=#{key.to_i} "
|
||||
# dbh.execute(sqlstr)
|
||||
end
|
||||
logger.debug "time4 is #{Time.now.usec} "
|
||||
end
|
||||
end
|
||||
tEndtime = Time.now
|
||||
logger.debug "code_repeattest end is #{tEndtime}}"
|
||||
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000000+(tEndtime.usec - tStarttime.usec)
|
||||
logger.debug "code_repeattest userd utime is #{tUsedtime}"
|
||||
render :json => resultObj
|
||||
end
|
||||
|
||||
#上次代码查重时间
|
||||
def last_codecomparetime
|
||||
resultObj = {status: 0}
|
||||
@homework = HomeworkCommon.find params[:homework]
|
||||
|
||||
#转换一下
|
||||
if @homework.simi_time != nil
|
||||
resultObj[:comparetime] = Time.parse(@homework.simi_time.to_s).strftime("%Y-%m-%d %H:%M:%S")
|
||||
else
|
||||
resultObj[:comparetime] = 0
|
||||
end
|
||||
|
||||
render :json => resultObj
|
||||
end
|
||||
|
||||
def index
|
||||
# 作业消息状态更新
|
||||
|
@ -499,8 +351,8 @@ class StudentWorkController < ApplicationController
|
|||
render_403
|
||||
return
|
||||
end
|
||||
@student_work_count = (search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name).count end
|
||||
|
||||
end
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
@is_focus = params[:is_focus] ? params[:is_focus].to_i : 0
|
||||
# 消息传过来的ID
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "(#{count})" : "" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span><span>赞</span></p>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -2143,4 +2143,3 @@ zh:
|
|||
label_new_notice_template: 您的课程有新通知了
|
||||
#edit yk
|
||||
label_code_work_tests: 代码测试列表
|
||||
|
||||
|
|
433
db/schema.rb
433
db/schema.rb
|
@ -1733,437 +1733,7 @@ ActiveRecord::Schema.define(:version => 20160419074016) do
|
|||
t.integer "absence_penalty", :default => 0
|
||||
t.float "system_score", :default => 0.0
|
||||
t.boolean "is_test", :default => false
|
||||
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"
|
||||
|
||||
create_table "student_works_evaluation_distributions", :force => true do |t|
|
||||
t.integer "student_work_id"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "student_works_scores", :force => true do |t|
|
||||
t.integer "student_work_id"
|
||||
t.integer "user_id"
|
||||
t.integer "score"
|
||||
t.text "comment"
|
||||
t.integer "reviewer_role"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "students_for_courses", :force => true do |t|
|
||||
t.integer "student_id"
|
||||
t.integer "course_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
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"
|
||||
|
||||
create_table "subfield_subdomain_dirs", :force => true do |t|
|
||||
t.integer "org_subfield_id"
|
||||
t.string "name"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "system_messages", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.string "content"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.text "description"
|
||||
t.string "subject"
|
||||
end
|
||||
|
||||
create_table "taggings", :force => true do |t|
|
||||
t.integer "tag_id"
|
||||
t.integer "taggable_id"
|
||||
t.string "taggable_type"
|
||||
t.integer "tagger_id"
|
||||
t.string "tagger_type"
|
||||
t.string "context", :limit => 128
|
||||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
|
||||
add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
|
||||
add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type"
|
||||
|
||||
create_table "tags", :force => true do |t|
|
||||
t.string "name"
|
||||
end
|
||||
|
||||
create_table "teachers", :force => true do |t|
|
||||
t.string "tea_name"
|
||||
t.string "location"
|
||||
t.integer "couurse_time"
|
||||
t.integer "course_code"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "extra"
|
||||
end
|
||||
|
||||
create_table "time_entries", :force => true do |t|
|
||||
t.integer "project_id", :null => false
|
||||
t.integer "user_id", :null => false
|
||||
t.integer "issue_id"
|
||||
t.float "hours", :null => false
|
||||
t.string "comments"
|
||||
t.integer "activity_id", :null => false
|
||||
t.date "spent_on", :null => false
|
||||
t.integer "tyear", :null => false
|
||||
t.integer "tmonth", :null => false
|
||||
t.integer "tweek", :null => false
|
||||
t.datetime "created_on", :null => false
|
||||
t.datetime "updated_on", :null => false
|
||||
end
|
||||
|
||||
add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id"
|
||||
add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on"
|
||||
add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id"
|
||||
add_index "time_entries", ["project_id"], :name => "time_entries_project_id"
|
||||
add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id"
|
||||
|
||||
create_table "tokens", :force => true do |t|
|
||||
t.integer "user_id", :default => 0, :null => false
|
||||
t.string "action", :limit => 30, :default => "", :null => false
|
||||
t.string "value", :limit => 40, :default => "", :null => false
|
||||
t.datetime "created_on", :null => false
|
||||
end
|
||||
|
||||
add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id"
|
||||
add_index "tokens", ["value"], :name => "tokens_value", :unique => true
|
||||
|
||||
create_table "trackers", :force => true do |t|
|
||||
t.string "name", :limit => 30, :default => "", :null => false
|
||||
t.boolean "is_in_chlog", :default => false, :null => false
|
||||
t.integer "position", :default => 1
|
||||
t.boolean "is_in_roadmap", :default => true, :null => false
|
||||
t.integer "fields_bits", :default => 0
|
||||
end
|
||||
|
||||
create_table "user_actions", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.string "action_type"
|
||||
t.integer "action_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "user_activities", :force => true do |t|
|
||||
t.string "act_type"
|
||||
t.integer "act_id"
|
||||
t.string "container_type"
|
||||
t.integer "container_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "user_id"
|
||||
end
|
||||
|
||||
add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index"
|
||||
|
||||
create_table "user_extensions", :force => true do |t|
|
||||
t.integer "user_id", :null => false
|
||||
t.date "birthday"
|
||||
t.string "brief_introduction"
|
||||
t.integer "gender"
|
||||
t.string "location"
|
||||
t.string "occupation"
|
||||
t.integer "work_experience"
|
||||
t.integer "zip_code"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "technical_title"
|
||||
t.integer "identity"
|
||||
t.string "student_id"
|
||||
t.string "teacher_realname"
|
||||
t.string "student_realname"
|
||||
t.string "location_city"
|
||||
t.integer "school_id"
|
||||
t.string "description", :default => ""
|
||||
end
|
||||
|
||||
create_table "user_feedback_messages", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "journals_for_message_id"
|
||||
t.string "journals_for_message_type"
|
||||
t.integer "viewed"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id"
|
||||
add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at"
|
||||
|
||||
create_table "user_grades", :force => true do |t|
|
||||
t.integer "user_id", :null => false
|
||||
t.integer "project_id", :null => false
|
||||
t.float "grade", :default => 0.0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade"
|
||||
add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id"
|
||||
add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id"
|
||||
|
||||
create_table "user_levels", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "level"
|
||||
end
|
||||
|
||||
create_table "user_preferences", :force => true do |t|
|
||||
t.integer "user_id", :default => 0, :null => false
|
||||
t.text "others"
|
||||
t.boolean "hide_mail", :default => false
|
||||
t.string "time_zone"
|
||||
end
|
||||
|
||||
add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id"
|
||||
|
||||
create_table "user_score_details", :force => true do |t|
|
||||
t.integer "current_user_id"
|
||||
t.integer "target_user_id"
|
||||
t.string "score_type"
|
||||
t.string "score_action"
|
||||
t.integer "user_id"
|
||||
t.integer "old_score"
|
||||
t.integer "new_score"
|
||||
t.integer "current_user_level"
|
||||
t.integer "target_user_level"
|
||||
t.integer "score_changeable_obj_id"
|
||||
t.string "score_changeable_obj_type"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "user_scores", :force => true do |t|
|
||||
t.integer "user_id", :null => false
|
||||
t.integer "collaboration"
|
||||
t.integer "influence"
|
||||
t.integer "skill"
|
||||
t.integer "active"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "user_statuses", :force => true do |t|
|
||||
t.integer "changesets_count"
|
||||
t.integer "watchers_count"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.float "grade", :default => 0.0
|
||||
end
|
||||
|
||||
add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count"
|
||||
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
|
||||
t.string "firstname", :limit => 30, :default => "", :null => false
|
||||
t.string "lastname", :default => "", :null => false
|
||||
t.string "mail", :limit => 60, :default => "", :null => false
|
||||
t.boolean "admin", :default => false, :null => false
|
||||
t.integer "status", :default => 1, :null => false
|
||||
t.datetime "last_login_on"
|
||||
t.string "language", :limit => 5, :default => ""
|
||||
t.integer "auth_source_id"
|
||||
t.datetime "created_on"
|
||||
t.datetime "updated_on"
|
||||
t.string "type"
|
||||
t.string "identity_url"
|
||||
t.string "mail_notification", :default => "", :null => false
|
||||
t.string "salt", :limit => 64
|
||||
t.integer "gid"
|
||||
t.integer "visits", :default => 0
|
||||
end
|
||||
|
||||
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
|
||||
add_index "users", ["id", "type"], :name => "index_users_on_id_and_type"
|
||||
add_index "users", ["type"], :name => "index_users_on_type"
|
||||
|
||||
create_table "versions", :force => true do |t|
|
||||
t.integer "project_id", :default => 0, :null => false
|
||||
t.string "name", :default => "", :null => false
|
||||
t.string "description", :default => ""
|
||||
t.date "effective_date"
|
||||
t.datetime "created_on"
|
||||
t.datetime "updated_on"
|
||||
t.string "wiki_page_title"
|
||||
t.string "status", :default => "open"
|
||||
t.string "sharing", :default => "none", :null => false
|
||||
end
|
||||
|
||||
add_index "versions", ["project_id"], :name => "versions_project_id"
|
||||
add_index "versions", ["sharing"], :name => "index_versions_on_sharing"
|
||||
|
||||
create_table "visitors", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "master_id"
|
||||
t.datetime "updated_on"
|
||||
t.datetime "created_on"
|
||||
end
|
||||
|
||||
add_index "visitors", ["master_id"], :name => "index_visitors_master_id"
|
||||
add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on"
|
||||
add_index "visitors", ["user_id"], :name => "index_visitors_user_id"
|
||||
|
||||
create_table "watchers", :force => true do |t|
|
||||
t.string "watchable_type", :default => "", :null => false
|
||||
t.integer "watchable_id", :default => 0, :null => false
|
||||
t.integer "user_id"
|
||||
end
|
||||
|
||||
add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type"
|
||||
add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id"
|
||||
add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type"
|
||||
|
||||
create_table "web_footer_companies", :force => true do |t|
|
||||
t.string "name"
|
||||
t.string "logo_size"
|
||||
t.string "url"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "web_footer_oranizers", :force => true do |t|
|
||||
t.string "name"
|
||||
t.text "description"
|
||||
t.datetime "created_at", :null => false
|
||||
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
|
||||
t.integer "author_id"
|
||||
t.binary "data", :limit => 2147483647
|
||||
t.string "compression", :limit => 6, :default => ""
|
||||
t.string "comments", :default => ""
|
||||
t.datetime "updated_on", :null => false
|
||||
t.integer "version", :null => false
|
||||
end
|
||||
|
||||
add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on"
|
||||
add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid"
|
||||
|
||||
create_table "wiki_contents", :force => true do |t|
|
||||
t.integer "page_id", :null => false
|
||||
t.integer "author_id"
|
||||
t.text "text", :limit => 2147483647
|
||||
t.string "comments", :default => ""
|
||||
t.datetime "updated_on", :null => false
|
||||
t.integer "version", :null => false
|
||||
end
|
||||
|
||||
add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id"
|
||||
add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id"
|
||||
|
||||
create_table "wiki_pages", :force => true do |t|
|
||||
t.integer "wiki_id", :null => false
|
||||
t.string "title", :null => false
|
||||
t.datetime "created_on", :null => false
|
||||
t.boolean "protected", :default => false, :null => false
|
||||
t.integer "parent_id"
|
||||
end
|
||||
|
||||
add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id"
|
||||
add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title"
|
||||
add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id"
|
||||
|
||||
create_table "wiki_redirects", :force => true do |t|
|
||||
t.integer "wiki_id", :null => false
|
||||
t.string "title"
|
||||
t.string "redirects_to"
|
||||
t.datetime "created_on", :null => false
|
||||
end
|
||||
|
||||
add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title"
|
||||
add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id"
|
||||
|
||||
create_table "wikis", :force => true do |t|
|
||||
t.integer "project_id", :null => false
|
||||
t.string "start_page", :null => false
|
||||
t.integer "status", :default => 1, :null => false
|
||||
end
|
||||
|
||||
add_index "wikis", ["project_id"], :name => "wikis_project_id"
|
||||
|
||||
create_table "workflows", :force => true do |t|
|
||||
t.integer "tracker_id", :default => 0, :null => false
|
||||
t.integer "old_status_id", :default => 0, :null => false
|
||||
t.integer "new_status_id", :default => 0, :null => false
|
||||
t.integer "role_id", :default => 0, :null => false
|
||||
t.boolean "assignee", :default => false, :null => false
|
||||
t.boolean "author", :default => false, :null => false
|
||||
t.string "type", :limit => 30
|
||||
t.string "field_name", :limit => 30
|
||||
t.string "rule", :limit => 30
|
||||
end
|
||||
|
||||
add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id"
|
||||
add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id"
|
||||
add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status"
|
||||
add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id"
|
||||
|
||||
create_table "works_categories", :force => true do |t|
|
||||
t.string "category"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "zip_packs", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "homework_id"
|
||||
t.string "file_digest"
|
||||
t.string "file_path"
|
||||
t.integer "pack_times", :default => 1
|
||||
t.integer "pack_size", :default => 0
|
||||
t.text "file_digests"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
end
|
||||
=======
|
||||
# encoding: UTF-8
|
||||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
|
@ -3877,8 +3447,7 @@ ActiveRecord::Schema.define(:version => 20160421011543) do
|
|||
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
|
||||
end
|
||||
t.integer "simi_value", :default => 0 end
|
||||
|
||||
add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"
|
||||
|
||||
|
|
Loading…
Reference in New Issue