@@ -177,7 +153,7 @@
- <%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
+ <%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_at)).to_s %>
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index 476471897..143c32dbe 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -140,9 +140,7 @@
<%break if Time.new.strftime("%Y").to_i - year_now >= 2%>
<% all_new_hot_course += find_all_new_hot_course(course_count-all_new_hot_course.count, @school_id, year_now, course_term)%>
<% end%>
- <% cache all_new_hot_course.max().created_at do %>
- <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %>
- <% end %>
+ <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %>
<% else %>
@@ -175,9 +173,7 @@
<%break if Time.new.strftime("%Y").to_i - year_now >= 2%>
<% all_new_hot_course += find_all_new_hot_course(9-(all_new_hot_course.count + cur_school_course.count), @school_id, year_now, course_term)%>
<% end%>
- <% cache all_new_hot_course.max().created_at do %>
- <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %>
- <% end %>
+ <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %>
<% end %>
@@ -195,7 +191,6 @@
<%= link_to "更多>>", forums_path %>
<% topics = find_new_forum_topics(10) %>
- <%# cache topics.maximum(:created_at) do%>
- <%# end %>
-<%= render partial: 'link_to_another' %>
\ No newline at end of file
+<%= render partial: 'link_to_another' %>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index 869df52a6..c03b0de76 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -68,7 +68,6 @@
-<% cache :expire_in => 2.hours do%>
<%= l(:lable_hot_projects)%>
<% if User.current.logged? %>
@@ -113,7 +112,6 @@
-<% end %>
-<%= render partial: 'link_to_another' %>
\ No newline at end of file
+<%= render partial: 'link_to_another' %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 73a97c035..7d926bd34 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -12,7 +12,10 @@ zh:
notice_account_wrong_password: 密码错误
name_can_be_empty: 可以不填写真实姓名[保密所需]
notice_successful_create: 创建成功
+ notice_failed_create: 创建失败
notice_successful_update: 更新成功
+ notice_successful_edit: 修改成功
+ notice_failed_edit: 修改失败
notice_successful_delete: 删除成功
notice_failed_delete: 删除失败
notice_successful_connection: 连接成功
@@ -881,7 +884,6 @@ zh:
button_copy_and_follow: 复制并转到新问题
button_annotate: 追溯
- button_edit: 编辑
button_configure: 配置
button_quote: 引用
button_duplicate: 副本
@@ -1224,7 +1226,7 @@ zh:
no_attachmens_allowed: 提交作业不能为空
button_bidding_homework: 参加竞标 #huang
- field_homework_type: 提交形式 #bai
+ field_homework_type: "" #bai
label_homework_respond: 作业情况
label_bid_me: 我要应标
@@ -1544,6 +1546,7 @@ zh:
label_course_new_homework: 新建作业
label_course_homework_list: 作业列表
label_course_homework_new: 发布作业
+ label_course_homework_edit: 修改作业
label_course_news_new: 发布通知
label_fork_homework_new: 选为作业
#wang
@@ -1800,7 +1803,9 @@ zh:
excel_mail: 电子邮箱
excel_homework_name: 作品名
excel_t_score: 教师评分
+ excel_ta_score: 教辅评分
excel_n_score: 匿名评分
+ excel_f_score: 成绩
excel_commit_time: 提交时间
excel_homework_score: 作业积分
excel_class: "班级:"
diff --git a/config/routes.rb b/config/routes.rb
index 9a8e71156..bd4464458 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -26,9 +26,6 @@
# Example: :via => :get ====> :via => :get
RedmineApp::Application.routes.draw do
-
- #match '/discuss_demos/new',:to => 'discuss_demo#create',:via =>[:post]
- #match '/discuss_demo/show',:to => 'discuss_demo#show'
mount Mobile::API => '/api'
resources :homework_users
@@ -80,6 +77,28 @@ RedmineApp::Application.routes.draw do
end
end
+ resources :homework_common, :except => [:show]do
+ member do
+ get 'start_anonymous_comment'
+ get 'stop_anonymous_comment'
+ get 'alert_anonymous_comment'
+ end
+ collection do
+
+ end
+ end
+
+ resources :student_work do
+ member do
+ post 'add_score'
+ get 'praise_student_work'
+ end
+ collection do
+ post 'add_score_reply'
+ get 'destroy_score_reply'
+ end
+ end
+
resources :contest_notification
resources :open_source_projects do
@@ -110,6 +129,7 @@ RedmineApp::Application.routes.draw do
match 'courselist'
match 'zip'
match 'mailer'
+ match 'view_office'
end
##new added by linchun #以发布应用的形式参与竞赛
resources :softapplications do
@@ -123,13 +143,6 @@ RedmineApp::Application.routes.draw do
end
end
- #resources :notificationcomments do
- #
- #end
-
- #resources :contestnotifications, :only => [:index, :show, :edit, :update, :destroy]
- # match '/contestnotifications/:id/notificationcomments', :to => 'notificationcomments#create', :via => :post
- # match '/contestnotifications/:id/notificationcomments/:notificationcomment_id', :to => 'notificationcomments#destroy', :via => :delete
## new added by linchun #新竞赛相关
resources :contests, only: [:index] do
resources :contestnotifications do
@@ -172,13 +185,6 @@ RedmineApp::Application.routes.draw do
match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put]
match '/contestnotifications/preview', :to => 'previews#contestnotification', :as => 'preview_contestnotifications', :via => [:get, :post, :put]
- #resource :previews, only: [] do
- # collection do
- # match 'news', :via => [:get, :post, :put]
- # match 'issue', :via => [:get, :post, :put]
- # end
- #end
-
resources :stores do
collection do
match 'search', :via => [:get, :post]
@@ -251,7 +257,7 @@ RedmineApp::Application.routes.draw do
post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
# boards end
- delete 'bids/homework', :to => 'bids#homework_destroy'
+ # delete 'bids/homework', :to => 'bids#homework_destroy'
# Misc issue routes. TODO: move into resources
match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
@@ -283,7 +289,6 @@ RedmineApp::Application.routes.draw do
match 'user_projects', :to => 'users#user_projects', :via => :get
match 'user_activities', :to => 'users#user_activities', :via => :get, :as => "user_activities"
match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback"
- match 'watch_calls', :to => 'users#watch_bids', :via => [:get , :post]
match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info'
match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang
match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang
@@ -317,7 +322,6 @@ RedmineApp::Application.routes.draw do
end
match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback"
match 'users/:id/user_projects', :to => 'users#user_projects', :via => :get
- #match 'user/:id/watch_calls', :controller => 'users', :action => 'watch_bids', :via => [:get , :post]
#end
match 'my/account', :via => [:get, :post]
@@ -357,14 +361,6 @@ RedmineApp::Application.routes.draw do
post 'appliedproject/applied', :to => 'applied_project#applied_join_project', :as => 'appliedproject'
delete 'appliedproject/applied', :to => 'applied_project#unapplied_join_project'
- resources :bids, :only=>[:edit,:update,:show] do
- member do
- match 'homework_ajax_modal'
- get 'start_anonymous_comment', as: 'start_anonymous_comment'
- get 'stop_anonymous_comment', as: 'stop_anonymous_comment'
- get 'alert_anonymous_comment'
- end
- end
resources :projects do
member do
match 'change_project_type', :via => [:get, :post]
@@ -380,9 +376,6 @@ RedmineApp::Application.routes.draw do
get 'invite_members_by_mail', :action=> 'invite_members_by_mail'
get 'send_mail_to_member', :action => 'send_mail_to_member'
match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" #add by huang
- get 'homework', :action => 'homework', :as => 'homework'
- get 'new_homework', :action => 'new_homework', :as => 'new_homework'
- #get 'news', :action => 'news', :as => 'news'
#end
post 'modules'
post 'archive'
@@ -400,19 +393,7 @@ RedmineApp::Application.routes.draw do
match '/member', :to => 'projects#member', :as => 'member', :via => :get
match '/file', :to => 'projects#file', :as => 'file', :via => :get
match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get
- # match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get
- match '/homework', :to => 'projects#homework', :as => 'homework', :via => :get
-
- # match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get
- # match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get
- # match '/', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
- # get 'projects/:project_id/show', :to => 'projects#show', :as => 'project_show'
- # get 'projects/:project_id/repository', :to => 'repositories#show', :as => 'project_repository'
-
- # match '/show', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
match '/watcherlist', :to=>'projects#watcherlist', :as => 'watcherlist', :via => :get #add by huang
- # matche '/news', :controller => 'news', :action => 'index', :as => 'news', :via => :get
- #end
resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
collection do
@@ -683,8 +664,6 @@ RedmineApp::Application.routes.draw do
member do
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
get 'search_member', :action => 'search_member'
- get 'homework', :action => 'homework', :as => 'homework'
- get 'new_homework', :action => 'new_homework', :as => 'new_homework'
get 'file', :action => 'file', :as => 'file'
get 'feedback', :action => 'feedback', :as => 'course_feedback'
get 'member', :controller => 'courses', :action => 'member', :as => 'member'
@@ -756,7 +735,6 @@ RedmineApp::Application.routes.draw do
match 'delete_avatar', :to => 'avatar#delete_image',:via => :post
# Endof Tao's code
get 'robots.txt', :to => 'welcome#robots'
- #match 'welcome/course', :to => 'welcome#course'
##############测试留言功能 fq
post 'words/new', :to => 'words#new'
post 'words/create', :to => 'words#create'
@@ -767,70 +745,21 @@ RedmineApp::Application.routes.draw do
get 'words/more', :to => 'words#more'
get 'words/back', :to=> 'words#back'
get 'words/destroyJournal', :to => 'words#destroyJournal'
- ############## fq
- post 'calls/create', :to => 'bids#create'
- delete 'calls/destroy', :to => 'bids#destroy'
- match 'calls/new', :to => 'bids#new', :via => [:get , :post]
- get 'calls/more', :to => 'bids#more'
- get 'calls/back', :to=> 'bids#back'
- match 'calls/new_bid', :to => 'bids#new_bid'
- match 'contest/new_contest', :to => 'bids#new_contest' #huang
- match 'calls/:id/show_project', :to => 'bids#show_project', :as => 'project_for_bid'
- match 'calls/:id/show_course', :to => 'bids#show_courseEx', :as => 'course_for_bid' # nwb added
- match 'calls/:id/new_exercise_book', :to => 'homework_attach#new', :as => 'new_exercise_book'
- match 'calls/:id/add', :to => 'bids#add'
- match 'calls/:id/delete', :to => 'bids#delete'
- match 'calls/:id/add_homework', :to => 'bids#add_homework', :via => :post
- match 'calls/:id/new_submit_homework', :to => 'bids#new_submit_homework', :via => :get, :as => 'new_submit_homework'
match 'words/add_project_respond', :to => 'words#add_project_respond'
match 'words/:id/leave_project_message', :to => 'words#leave_project_message'
-
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
- match 'calls/create_bid', :to => 'bids#create_bid'
- match 'contest/create_contest', :to => 'bids#create_contest' #huang
- match 'calls/create_homework', :to => 'bids#create_homework'
- match 'calls/:id/homework_respond', :to => 'bids#homework_respond'
- match 'calls/:id/homework_statistics', :to => 'bids#homework_statistics'
- match 'calls/:id/fork', :to => 'bids#fork', :as => 'fork'
- match 'calls/:id/create_fork', :to => 'bids#create_fork'
-
- match 'calls/:id/show_course', :to => 'bids#show_course', :as => 'show_course'
- match 'calls/:id/show_bid_project', :to => 'bids#show_bid_project', :as => 'show_bid_project'
- match 'calls/:id/show_bid_user', :to => 'bids#show_bid_user', :as => 'show_bid_user'
-
match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share
post 'join_in/join', :to => 'courses#join', :as => 'join'
delete 'join_in/join', :to => 'courses#unjoin'
post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group'
delete 'join_in/join_group', :to => 'courses#unjoin_group'
- post 'calls/:id/join_in_contest', :to => 'bids#join_in_contest', :as => 'join_in_contest'
- delete 'calls/:id/join_in_contest', :to => 'bids#unjoin_in_contest'
- match 'calls/:id/show_participator', :to => 'bids#show_participator' # bai
- match 'calls/:id/update_contest', :to => 'bids#update_contest' # bai
- match 'calls/:id/settings', :to => 'bids#settings' # bai
delete 'attachment/:id', :to => 'attachments#delete_homework'
match 'new_join', :to => 'courses#new_join', :as => 'try_join'
match 'new_join_group', :to => 'courses#new_join_group', :as => 'try_join_group'
- match 'new_join_in_contest', :to => 'bids#new_join', :as => 'try_join_in_contest'
+ # match 'new_join_in_contest', :to => 'bids#new_join', :as => 'try_join_in_contest'
match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post
- match 'calls/:id/manage',:to => 'bids#manage',:via => [:get,:post]
-
-
- #added by william
- # match 'calls/:id/set_results',:controller => 'bids', :action => 'set_results',:via => [:get,:post],:as => 'set_results'
- # match 'calls/:id/set_prizes',:controller => 'bids',:action => 'set_prizes',:as => 'set_prizes'
- match 'calls/:id/set_reward',:to => 'bids#set_reward',:as => 'set_reward'
-
- # added by young
- match 'calls', :to => 'bids#index'
-
- match 'calls/:id', :to => 'bids#show', :as => 'respond'
- # modified by longjun
- # bids#contests is not exist
- # match 'contest', :to => 'bids#contests', :as => 'contest' #modified @20140403
- # end longjun
########################
##added by wen##########
@@ -838,7 +767,6 @@ RedmineApp::Application.routes.draw do
get 'welcome/search', to: 'welcome#search'
get 'school/index', to: 'school#index'
get 'school/:school_id', to: 'welcome#course', :as => 'school_course_list'
- #get 'course/:school_id', to: 'welcome#course'
post 'school/get_options/:province', :to => 'school#get_options'
get 'school/get_options/:province', :to => 'school#get_options'
diff --git a/db/migrate/20150519012744_create_homework_commons.rb b/db/migrate/20150519012744_create_homework_commons.rb
new file mode 100644
index 000000000..eaf39bfa0
--- /dev/null
+++ b/db/migrate/20150519012744_create_homework_commons.rb
@@ -0,0 +1,20 @@
+class CreateHomeworkCommons < ActiveRecord::Migration
+ def up
+ create_table :homework_commons do |t|
+ t.string :name
+ t.integer :user_id
+ t.text :description
+ t.date :publish_time
+ t.date :end_time
+ t.integer :homework_type, default: 1
+ t.string :late_penalty
+ t.integer :course_id
+
+ t.timestamps
+ end
+ end
+
+ def down
+ drop_table :homework_commons
+ end
+end
diff --git a/db/migrate/20150519014600_create_homework_detail_manuals.rb b/db/migrate/20150519014600_create_homework_detail_manuals.rb
new file mode 100644
index 000000000..29548cab2
--- /dev/null
+++ b/db/migrate/20150519014600_create_homework_detail_manuals.rb
@@ -0,0 +1,19 @@
+class CreateHomeworkDetailManuals < ActiveRecord::Migration
+ def up
+ create_table :homework_detail_manuals do |t|
+ t.float :ta_proportion
+ t.integer :comment_status
+ t.date :evaluation_start
+ t.date :evaluation_end
+ t.integer :evaluation_num
+ t.integer :absence_penalty, default: 1
+ t.integer :homework_common_id
+
+ t.timestamps
+ end
+ end
+
+ def down
+ drop_table :homework_detail_manuals
+ end
+end
diff --git a/db/migrate/20150519014639_create_homework_detail_programings.rb b/db/migrate/20150519014639_create_homework_detail_programings.rb
new file mode 100644
index 000000000..707da164c
--- /dev/null
+++ b/db/migrate/20150519014639_create_homework_detail_programings.rb
@@ -0,0 +1,15 @@
+class CreateHomeworkDetailProgramings < ActiveRecord::Migration
+ def up
+ create_table :homework_detail_programings do |t|
+ t.string :language
+ t.text :standard_code, :limit => 4294967295
+ t.integer :homework_common_id
+
+ t.timestamps
+ end
+ end
+
+ def down
+ drop_table :homework_detail_programings
+ end
+end
diff --git a/db/migrate/20150519020031_create_homework_tests.rb b/db/migrate/20150519020031_create_homework_tests.rb
new file mode 100644
index 000000000..8106c51f5
--- /dev/null
+++ b/db/migrate/20150519020031_create_homework_tests.rb
@@ -0,0 +1,15 @@
+class CreateHomeworkTests < ActiveRecord::Migration
+ def up
+ create_table :homework_tests do |t|
+ t.text :input
+ t.text :output
+ t.integer :homework_common_id
+
+ t.timestamps
+ end
+ end
+
+ def down
+ drop_table :homework_tests
+ end
+end
diff --git a/db/migrate/20150519022200_create_student_works.rb b/db/migrate/20150519022200_create_student_works.rb
new file mode 100644
index 000000000..4ae0449e0
--- /dev/null
+++ b/db/migrate/20150519022200_create_student_works.rb
@@ -0,0 +1,21 @@
+class CreateStudentWorks < ActiveRecord::Migration
+ def up
+ create_table :student_works do |t|
+ t.string :name
+ t.text :description
+ t.integer :homework_common_id
+ t.integer :user_id
+ t.float :final_score
+ t.float :teacher_score
+ t.float :student_score
+ t.float :teaching_asistant_score
+ t.integer :project_id, default: 0
+
+ t.timestamps
+ end
+ end
+
+ def down
+ drop_table :student_works
+ end
+end
diff --git a/db/migrate/20150519023821_create_student_works_evaluation_distributions.rb b/db/migrate/20150519023821_create_student_works_evaluation_distributions.rb
new file mode 100644
index 000000000..a46b9f0f1
--- /dev/null
+++ b/db/migrate/20150519023821_create_student_works_evaluation_distributions.rb
@@ -0,0 +1,14 @@
+class CreateStudentWorksEvaluationDistributions < ActiveRecord::Migration
+ def up
+ create_table :student_works_evaluation_distributions do |t|
+ t.integer :student_work_id
+ t.integer :user_id
+
+ t.timestamps
+ end
+ end
+
+ def down
+ drop_table :student_works_evaluation_distributions
+ end
+end
diff --git a/db/migrate/20150519030544_create_student_works_scores.rb b/db/migrate/20150519030544_create_student_works_scores.rb
new file mode 100644
index 000000000..0c4721276
--- /dev/null
+++ b/db/migrate/20150519030544_create_student_works_scores.rb
@@ -0,0 +1,16 @@
+class CreateStudentWorksScores < ActiveRecord::Migration
+ def up
+ create_table :student_works_scores do |t|
+ t.integer :student_work_id
+ t.integer :user_id
+ t.integer :score
+ t.text :comment
+ t.integer :reviewer_role
+ t.timestamps
+ end
+ end
+
+ def down
+ drop_table :student_works_scores
+ end
+end
diff --git a/db/migrate/20150601032112_about_homework.rb b/db/migrate/20150601032112_about_homework.rb
new file mode 100644
index 000000000..fe3ca1c12
--- /dev/null
+++ b/db/migrate/20150601032112_about_homework.rb
@@ -0,0 +1,126 @@
+#encoding=UTF-8
+class AboutHomework < ActiveRecord::Migration
+ def up
+ Bid.where("reward_type = 3").each do |bid|
+ transaction do
+ if bid.courses.first
+ # 作品基础属性
+ homework = HomeworkCommon.new
+ homework.name = bid.name
+ homework.description = bid.description
+ homework.user_id = bid.author_id
+ homework.end_time = bid.deadline
+ homework.publish_time = bid.deadline
+ bid.open_anonymous_evaluation == 1 ? homework.homework_type = 1 : homework.homework_type = 0
+ homework.late_penalty = 0
+ homework.course_id = bid.courses.first.id
+ homework.created_at = bid.created_on
+ homework.updated_at = bid.updated_on
+ homework.save
+
+ #个人动态
+ bid.acts.each do |act|
+ act.act_type = homework.class.to_s
+ act.act_id = homework.id
+ act.save
+ end
+
+ #作业附件
+ bid.attachments.each do |attach|
+ attach.container = homework
+ attach.save
+ end
+
+ # 匿评作业相关属性
+ homework_detail_manual = HomeworkDetailManual.new
+ homework_detail_manual.ta_proportion = 0.6
+ homework_detail_manual.comment_status = bid.comment_status + 1
+ homework_detail_manual.evaluation_start = bid.created_on
+ homework_detail_manual.evaluation_end = bid.created_on
+ homework_detail_manual.evaluation_num = bid.evaluation_num
+ homework_detail_manual.absence_penalty = 0
+ homework_detail_manual.homework_common = homework
+ homework_detail_manual.save
+
+ #作品列表
+ bid.homeworks.each do |homework_attach|
+ student_work = StudentWork.new
+ student_work.name = homework_attach.name
+ student_work.description = homework_attach.description
+ student_work.user_id = homework_attach.user_id
+ student_work.project_id = homework_attach.project_id
+ student_work.homework_common = homework
+ student_work.save
+
+ #作品文件
+ homework_attach.attachments.each do |attach|
+ attach.container = student_work
+ attach.save
+ end
+
+ #作品匿评列表
+ homework_attach.homework_evaluations.each do |homework_evaluation|
+ student_work_evaluation = StudentWorksEvaluationDistribution.new
+ student_work_evaluation.user_id = homework_evaluation.user_id
+ student_work_evaluation.student_work = student_work
+ student_work_evaluation.save
+ end
+
+ #评分评论相关
+ stars_reates = homework_attach.rates(:quality)
+ if stars_reates
+ stars_reates.each do |reate|
+ student_work_score = StudentWorksScore.new
+ student_work_score.user_id = reate.rater_id
+ student_work_score.score = reate.stars * 20
+ student_work_score.student_work = student_work
+ rater = User.find reate.rater_id
+ if rater
+ member = rater.members.where("course_id = ?",bid.courses.first.id).first
+ if member
+ role = member.roles.first.name
+ case role
+ when "Teacher"
+ student_work_score.reviewer_role = 1
+ when "Manager"
+ student_work_score.reviewer_role = 1
+ when "TeachingAsistant"
+ student_work_score.reviewer_role = 2
+ when "Student"
+ student_work_score.reviewer_role = 3
+ end
+ else
+ student_work_score.reviewer_role = 3
+ end
+ else
+ student_work_score.reviewer_role = 3
+ end
+
+ jour = homework_attach.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{reate.rater_id}").order("created_on DESC").first
+ if jour
+ student_work_score.comment = jour.notes
+ student_work_score.save
+ #老师反馈附件
+ homework_attach.attachments.each do |attach|
+ attach.container = student_work_score
+ attach.save
+ end
+ else
+ student_work_score.save
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+
+ def down
+ HomeworkCommon.destroy_all
+ HomeworkDetailManual.destroy_all
+ StudentWork.destroy_all
+ StudentWorksScore.destroy_all
+ StudentWorksEvaluationDistribution.destroy_all
+ end
+end
diff --git a/db/migrate/20150602021020_add_score_to_work.rb b/db/migrate/20150602021020_add_score_to_work.rb
new file mode 100644
index 000000000..446a5a4f7
--- /dev/null
+++ b/db/migrate/20150602021020_add_score_to_work.rb
@@ -0,0 +1,60 @@
+class AddScoreToWork < ActiveRecord::Migration
+ require 'bigdecimal'
+
+ def up
+ count = StudentWork.all.count / 10 + 1
+ transaction do
+ for i in 1 ... count do i
+ StudentWork.page(i).per(10).each do |work|
+ teacher_score = work.student_works_scores.where(:reviewer_role => 1).order("created_at desc")
+ unless teacher_score.empty?
+ work.teacher_score = teacher_score.first.score
+ end
+
+ teaching_asistant_score = work.student_works_scores.where(:reviewer_role => 2)
+ unless teaching_asistant_score.empty?
+ work.teaching_asistant_score = teaching_asistant_score.average(:score).try(:round, 2).to_f
+ end
+
+ student_socre = work.student_works_scores.where(:reviewer_role => 3)
+ unless student_socre.empty?
+ work.student_score = student_socre.average(:score).try(:round, 2).to_f
+ end
+
+ if work.teacher_score.nil?
+ if work.teaching_asistant_score.nil? #教辅评分为空,最终评分为学生匿评
+ work.final_score = work.student_score
+ elsif work.student_score.nil? #学生匿评评分为空,最终评分为教辅评分
+ work.final_score = work.teaching_asistant_score
+ else #都不为空,按比例来
+ final_ta_score = BigDecimal.new("#{work.teaching_asistant_score}") * BigDecimal.new("0.6")
+ final_s_score = BigDecimal.new("#{work.student_score}") * BigDecimal.new('0.4')
+ final_score = final_ta_score + final_s_score
+ work.final_score = format("%.2f",final_score.to_f)
+ end
+ else #教师评分不为空,最终评分为教师评分
+ work.final_score = work.teacher_score
+ end
+ work.save
+ end
+ end
+ end
+
+
+ end
+
+ def down
+ count = StudentWork.all.count / 10 + 1
+ transaction do
+ for i in 1 ... count do i
+ StudentWork.page(i).per(10).each do |work|
+ work.teacher_score = nil
+ work.teaching_asistant_score = nil
+ work.student_score = nil
+ work.final_score = nil
+ work.save
+ end
+ end
+ end
+ end
+end
diff --git a/db/migrate/20150602055730_remove_bid_activity.rb b/db/migrate/20150602055730_remove_bid_activity.rb
new file mode 100644
index 000000000..759091118
--- /dev/null
+++ b/db/migrate/20150602055730_remove_bid_activity.rb
@@ -0,0 +1,7 @@
+class RemoveBidActivity < ActiveRecord::Migration
+ def change
+ Activity.where(:act_type => "Bid").each do |act|
+ act.destroy
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index f8d638a5f..42c743588 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,1469 +1,1548 @@
-# 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
-# incrementally modify your database, and then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your
-# database schema. If you need to create the application database on another
-# system, you should be using db:schema:load, not running all the migrations
-# from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 20150514133640) do
-
- create_table "activities", :force => true do |t|
- t.integer "act_id", :null => false
- t.string "act_type", :null => false
- t.integer "user_id", :null => false
- end
-
- add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type"
- add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
- add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
-
- create_table "api_keys", :force => true do |t|
- t.string "access_token"
- t.datetime "expires_at"
- t.integer "user_id"
- t.boolean "active", :default => true
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token"
- add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id"
-
- create_table "applied_projects", :force => true do |t|
- t.integer "project_id", :null => false
- t.integer "user_id", :null => false
- end
-
- create_table "apply_project_masters", :force => true do |t|
- t.integer "user_id"
- t.string "apply_type"
- t.integer "apply_id"
- t.integer "status"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "attachments", :force => true do |t|
- t.integer "container_id"
- t.string "container_type", :limit => 30
- t.string "filename", :default => "", :null => false
- t.string "disk_filename", :default => "", :null => false
- t.integer "filesize", :default => 0, :null => false
- t.string "content_type", :default => ""
- t.string "digest", :limit => 40, :default => "", :null => false
- t.integer "downloads", :default => 0, :null => false
- t.integer "author_id", :default => 0, :null => false
- t.datetime "created_on"
- t.string "description"
- t.string "disk_directory"
- t.integer "attachtype", :default => 1
- t.integer "is_public", :default => 1
- t.integer "copy_from"
- t.integer "quotes"
- end
-
- add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id"
- add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type"
- add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on"
-
- create_table "attachmentstypes", :force => true do |t|
- t.integer "typeId", :null => false
- t.string "typeName", :limit => 50
- end
-
- create_table "auth_sources", :force => true do |t|
- t.string "type", :limit => 30, :default => "", :null => false
- t.string "name", :limit => 60, :default => "", :null => false
- t.string "host", :limit => 60
- t.integer "port"
- t.string "account"
- t.string "account_password", :default => ""
- t.string "base_dn"
- t.string "attr_login", :limit => 30
- t.string "attr_firstname", :limit => 30
- t.string "attr_lastname", :limit => 30
- t.string "attr_mail", :limit => 30
- t.boolean "onthefly_register", :default => false, :null => false
- t.boolean "tls", :default => false, :null => false
- t.string "filter"
- t.integer "timeout"
- end
-
- add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type"
-
- create_table "biding_projects", :force => true do |t|
- t.integer "project_id"
- t.integer "bid_id"
- t.integer "user_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- end
-
- create_table "bids", :force => true do |t|
- t.string "name"
- t.string "budget", :null => false
- t.integer "author_id"
- t.date "deadline"
- t.text "description"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- t.integer "commit"
- t.integer "reward_type"
- t.integer "homework_type"
- t.integer "parent_id"
- t.string "password"
- t.integer "is_evaluation"
- t.integer "proportion", :default => 60
- t.integer "comment_status", :default => 0
- t.integer "evaluation_num", :default => 3
- t.integer "open_anonymous_evaluation", :default => 1
- end
-
- create_table "boards", :force => true do |t|
- t.integer "project_id", :null => false
- t.string "name", :default => "", :null => false
- t.string "description"
- t.integer "position", :default => 1
- t.integer "topics_count", :default => 0, :null => false
- t.integer "messages_count", :default => 0, :null => false
- t.integer "last_message_id"
- t.integer "parent_id"
- t.integer "course_id"
- end
-
- add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
- add_index "boards", ["project_id"], :name => "boards_project_id"
-
- create_table "bug_to_osps", :force => true do |t|
- t.integer "osp_id"
- t.integer "relative_memo_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "changes", :force => true do |t|
- t.integer "changeset_id", :null => false
- t.string "action", :limit => 1, :default => "", :null => false
- t.text "path", :null => false
- t.text "from_path"
- t.string "from_revision"
- t.string "revision"
- t.string "branch"
- end
-
- add_index "changes", ["changeset_id"], :name => "changesets_changeset_id"
-
- create_table "changeset_parents", :id => false, :force => true do |t|
- t.integer "changeset_id", :null => false
- t.integer "parent_id", :null => false
- end
-
- add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids"
- add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids"
-
- create_table "changesets", :force => true do |t|
- t.integer "repository_id", :null => false
- t.string "revision", :null => false
- t.string "committer"
- t.datetime "committed_on", :null => false
- t.text "comments"
- t.date "commit_date"
- t.string "scmid"
- t.integer "user_id"
- end
-
- add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"
- add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true
- add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid"
- add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id"
- add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id"
-
- create_table "changesets_issues", :id => false, :force => true do |t|
- t.integer "changeset_id", :null => false
- t.integer "issue_id", :null => false
- end
-
- add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true
-
- create_table "code_review_assignments", :force => true do |t|
- t.integer "issue_id"
- t.integer "change_id"
- t.integer "attachment_id"
- t.string "file_path"
- t.string "rev"
- t.string "rev_to"
- t.string "action_type"
- t.integer "changeset_id"
- end
-
- create_table "code_review_project_settings", :force => true do |t|
- t.integer "project_id"
- t.integer "tracker_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "updated_by"
- t.boolean "hide_code_review_tab", :default => false
- t.integer "auto_relation", :default => 1
- t.integer "assignment_tracker_id"
- t.text "auto_assign"
- t.integer "lock_version", :default => 0, :null => false
- t.boolean "tracker_in_review_dialog", :default => false
- end
-
- create_table "code_review_user_settings", :force => true do |t|
- t.integer "user_id", :default => 0, :null => false
- t.integer "mail_notification", :default => 0, :null => false
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
- create_table "code_reviews", :force => true do |t|
- t.integer "project_id"
- t.integer "change_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "line"
- t.integer "updated_by_id"
- t.integer "lock_version", :default => 0, :null => false
- t.integer "status_changed_from"
- t.integer "status_changed_to"
- t.integer "issue_id"
- t.string "action_type"
- t.string "file_path"
- t.string "rev"
- t.string "rev_to"
- t.integer "attachment_id"
- t.integer "file_count", :default => 0, :null => false
- t.boolean "diff_all"
- 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
- t.integer "author_id", :default => 0, :null => false
- t.text "comments"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- end
-
- add_index "comments", ["author_id"], :name => "index_comments_on_author_id"
- add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type"
-
- create_table "contest_notifications", :force => true do |t|
- t.text "title"
- t.text "content"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "contesting_projects", :force => true do |t|
- t.integer "project_id"
- t.string "contest_id"
- t.integer "user_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- end
-
- create_table "contesting_softapplications", :force => true do |t|
- t.integer "softapplication_id"
- t.integer "contest_id"
- t.integer "user_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- end
-
- create_table "contestnotifications", :force => true do |t|
- t.integer "contest_id"
- t.string "title"
- t.string "summary"
- t.text "description"
- t.integer "author_id"
- t.integer "notificationcomments_count"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "contests", :force => true do |t|
- t.string "name"
- t.string "budget", :default => ""
- t.integer "author_id"
- t.date "deadline"
- t.string "description"
- t.integer "commit"
- t.string "password"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- end
-
- create_table "course_attachments", :force => true do |t|
- t.string "filename"
- t.string "disk_filename"
- t.integer "filesize"
- t.string "content_type"
- t.string "digest"
- t.integer "downloads"
- t.string "author_id"
- t.string "integer"
- t.string "description"
- t.string "disk_directory"
- t.integer "attachtype"
- t.integer "is_public"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "container_id", :default => 0
- end
-
- create_table "course_groups", :force => true do |t|
- t.string "name"
- t.integer "course_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "course_infos", :force => true do |t|
- t.integer "course_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "course_statuses", :force => true do |t|
- t.integer "changesets_count"
- t.integer "watchers_count"
- t.integer "course_id"
- t.float "grade", :default => 0.0
- t.integer "course_ac_para", :default => 0
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "courses", :force => true do |t|
- t.integer "tea_id"
- t.string "name"
- t.integer "state"
- t.string "code"
- t.integer "time"
- t.string "extra"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "location"
- t.string "term"
- t.string "string"
- t.string "password"
- t.string "setup_time"
- t.string "endup_time"
- t.string "class_period"
- t.integer "school_id"
- t.text "description"
- 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
- end
-
- create_table "custom_fields", :force => true do |t|
- t.string "type", :limit => 30, :default => "", :null => false
- t.string "name", :limit => 30, :default => "", :null => false
- t.string "field_format", :limit => 30, :default => "", :null => false
- t.text "possible_values"
- t.string "regexp", :default => ""
- t.integer "min_length", :default => 0, :null => false
- t.integer "max_length", :default => 0, :null => false
- t.boolean "is_required", :default => false, :null => false
- t.boolean "is_for_all", :default => false, :null => false
- t.boolean "is_filter", :default => false, :null => false
- t.integer "position", :default => 1
- t.boolean "searchable", :default => false
- t.text "default_value"
- t.boolean "editable", :default => true
- t.boolean "visible", :default => true, :null => false
- t.boolean "multiple", :default => false
- end
-
- add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type"
-
- create_table "custom_fields_projects", :id => false, :force => true do |t|
- t.integer "custom_field_id", :default => 0, :null => false
- t.integer "project_id", :default => 0, :null => false
- end
-
- add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true
-
- create_table "custom_fields_trackers", :id => false, :force => true do |t|
- t.integer "custom_field_id", :default => 0, :null => false
- t.integer "tracker_id", :default => 0, :null => false
- end
-
- add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true
-
- create_table "custom_values", :force => true do |t|
- t.string "customized_type", :limit => 30, :default => "", :null => false
- t.integer "customized_id", :default => 0, :null => false
- t.integer "custom_field_id", :default => 0, :null => false
- t.text "value"
- end
-
- add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id"
- add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized"
-
- create_table "delayed_jobs", :force => true do |t|
- t.integer "priority", :default => 0, :null => false
- t.integer "attempts", :default => 0, :null => false
- t.text "handler", :null => false
- t.text "last_error"
- t.datetime "run_at"
- t.datetime "locked_at"
- t.datetime "failed_at"
- t.string "locked_by"
- t.string "queue"
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
- add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
-
- create_table "documents", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.integer "category_id", :default => 0, :null => false
- t.string "title", :limit => 60, :default => "", :null => false
- t.text "description"
- t.datetime "created_on"
- t.integer "user_id", :default => 0
- t.integer "is_public", :default => 1
- end
-
- add_index "documents", ["category_id"], :name => "index_documents_on_category_id"
- add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
- add_index "documents", ["project_id"], :name => "documents_project_id"
-
- create_table "enabled_modules", :force => true do |t|
- t.integer "project_id"
- t.string "name", :null => false
- t.integer "course_id"
- end
-
- add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id"
-
- create_table "enumerations", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.integer "position", :default => 1
- t.boolean "is_default", :default => false, :null => false
- t.string "type"
- t.boolean "active", :default => true, :null => false
- t.integer "project_id"
- t.integer "parent_id"
- t.string "position_name", :limit => 30
- end
-
- 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 "first_pages", :force => true do |t|
- t.string "web_title"
- t.string "title"
- t.text "description"
- t.string "page_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "sort_type"
- t.integer "image_width", :default => 107
- t.integer "image_height", :default => 63
- t.integer "show_course", :default => 1
- t.integer "show_contest", :default => 1
- end
-
- create_table "forge_activities", :force => true do |t|
- t.integer "user_id"
- t.integer "project_id"
- t.integer "forge_act_id"
- t.string "forge_act_type"
- t.integer "org_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id"
-
- create_table "forums", :force => true do |t|
- t.string "name", :null => false
- t.text "description"
- t.integer "topic_count", :default => 0
- t.integer "memo_count", :default => 0
- t.integer "last_memo_id", :default => 0
- t.integer "creator_id", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "sticky"
- t.integer "locked"
- end
-
- create_table "groups_users", :id => false, :force => true do |t|
- t.integer "group_id", :null => false
- t.integer "user_id", :null => false
- end
-
- add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true
-
- create_table "homework_attaches", :force => true do |t|
- t.integer "bid_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- t.string "name"
- t.text "description"
- t.integer "state"
- t.integer "project_id", :default => 0
- t.float "score", :default => 0.0
- t.integer "is_teacher_score", :default => 0
- end
-
- add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
-
- create_table "homework_evaluations", :force => true do |t|
- t.string "user_id"
- t.string "homework_attach_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "homework_for_courses", :force => true do |t|
- t.integer "course_id"
- t.integer "bid_id"
- end
-
- add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id"
- add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id"
-
- create_table "homework_users", :force => true do |t|
- t.string "homework_attach_id"
- t.string "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "issue_categories", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.string "name", :limit => 30, :default => "", :null => false
- t.integer "assigned_to_id"
- end
-
- add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id"
- add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id"
-
- create_table "issue_relations", :force => true do |t|
- t.integer "issue_from_id", :null => false
- t.integer "issue_to_id", :null => false
- t.string "relation_type", :default => "", :null => false
- t.integer "delay"
- end
-
- add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true
- add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id"
- add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id"
-
- create_table "issue_statuses", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.boolean "is_closed", :default => false, :null => false
- t.boolean "is_default", :default => false, :null => false
- t.integer "position", :default => 1
- t.integer "default_done_ratio"
- end
-
- add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed"
- add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default"
- add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position"
-
- create_table "issues", :force => true do |t|
- t.integer "tracker_id", :null => false
- t.integer "project_id", :null => false
- t.string "subject", :default => "", :null => false
- t.text "description"
- t.date "due_date"
- t.integer "category_id"
- t.integer "status_id", :null => false
- t.integer "assigned_to_id"
- t.integer "priority_id", :null => false
- t.integer "fixed_version_id"
- t.integer "author_id", :null => false
- t.integer "lock_version", :default => 0, :null => false
- t.datetime "created_on"
- t.datetime "updated_on"
- t.date "start_date"
- t.integer "done_ratio", :default => 0, :null => false
- t.float "estimated_hours"
- t.integer "parent_id"
- t.integer "root_id"
- t.integer "lft"
- t.integer "rgt"
- t.boolean "is_private", :default => false, :null => false
- t.datetime "closed_on"
- t.integer "project_issues_index"
- end
-
- add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id"
- add_index "issues", ["author_id"], :name => "index_issues_on_author_id"
- add_index "issues", ["category_id"], :name => "index_issues_on_category_id"
- add_index "issues", ["created_on"], :name => "index_issues_on_created_on"
- add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id"
- add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id"
- add_index "issues", ["project_id"], :name => "issues_project_id"
- add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt"
- add_index "issues", ["status_id"], :name => "index_issues_on_status_id"
- add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id"
-
- create_table "join_in_competitions", :force => true do |t|
- t.integer "user_id"
- t.integer "competition_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "join_in_contests", :force => true do |t|
- t.integer "user_id"
- t.integer "bid_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "journal_details", :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", ["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"
- t.integer "reply_id"
- end
-
- add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id"
- add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id"
- add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id"
-
- create_table "journals", :force => true do |t|
- t.integer "journalized_id", :default => 0, :null => false
- t.string "journalized_type", :limit => 30, :default => "", :null => false
- t.integer "user_id", :default => 0, :null => false
- t.text "notes"
- t.datetime "created_on", :null => false
- t.boolean "private_notes", :default => false, :null => false
- end
-
- add_index "journals", ["created_on"], :name => "index_journals_on_created_on"
- add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id"
- add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id"
- add_index "journals", ["user_id"], :name => "index_journals_on_user_id"
-
- create_table "journals_for_messages", :force => true do |t|
- t.integer "jour_id"
- t.string "jour_type"
- t.integer "user_id"
- t.text "notes"
- t.integer "status"
- t.integer "reply_id"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- t.string "m_parent_id"
- t.boolean "is_readed"
- t.integer "m_reply_count"
- t.integer "m_reply_id"
- t.integer "is_comprehensive_evaluation"
- end
-
- create_table "kindeditor_assets", :force => true do |t|
- t.string "asset"
- t.integer "file_size"
- t.string "file_type"
- t.integer "owner_id"
- t.string "asset_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "owner_type", :default => 0
- end
-
- create_table "member_roles", :force => true do |t|
- t.integer "member_id", :null => false
- t.integer "role_id", :null => false
- t.integer "inherited_from"
- end
-
- add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id"
- add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id"
-
- create_table "members", :force => true do |t|
- t.integer "user_id", :default => 0, :null => false
- t.integer "project_id", :default => 0
- t.datetime "created_on"
- t.boolean "mail_notification", :default => false, :null => false
- t.integer "course_id", :default => -1
- t.integer "course_group_id", :default => 0
- end
-
- 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"
-
- create_table "memos", :force => true do |t|
- t.integer "forum_id", :null => false
- t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :null => false
- t.integer "author_id", :null => false
- t.integer "replies_count", :default => 0
- t.integer "last_reply_id"
- t.boolean "lock", :default => false
- t.boolean "sticky", :default => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "viewed_count", :default => 0
- end
-
- create_table "messages", :force => true do |t|
- t.integer "board_id", :null => false
- t.integer "parent_id"
- t.string "subject", :default => "", :null => false
- t.text "content"
- t.integer "author_id"
- t.integer "replies_count", :default => 0, :null => false
- t.integer "last_reply_id"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- t.boolean "locked", :default => false
- t.integer "sticky", :default => 0
- end
-
- add_index "messages", ["author_id"], :name => "index_messages_on_author_id"
- add_index "messages", ["board_id"], :name => "messages_board_id"
- add_index "messages", ["created_on"], :name => "index_messages_on_created_on"
- add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
- add_index "messages", ["parent_id"], :name => "messages_parent_id"
-
- create_table "news", :force => true do |t|
- t.integer "project_id"
- t.string "title", :limit => 60, :default => "", :null => false
- t.string "summary", :default => ""
- t.text "description"
- t.integer "author_id", :default => 0, :null => false
- t.datetime "created_on"
- t.integer "comments_count", :default => 0, :null => false
- t.integer "course_id"
- end
-
- add_index "news", ["author_id"], :name => "index_news_on_author_id"
- add_index "news", ["created_on"], :name => "index_news_on_created_on"
- add_index "news", ["project_id"], :name => "news_project_id"
-
- create_table "no_uses", :force => true do |t|
- t.integer "user_id", :null => false
- t.string "no_use_type"
- t.integer "no_use_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "notificationcomments", :force => true do |t|
- t.string "notificationcommented_type"
- t.integer "notificationcommented_id"
- t.integer "author_id"
- t.text "notificationcomments"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "open_id_authentication_associations", :force => true do |t|
- t.integer "issued"
- t.integer "lifetime"
- t.string "handle"
- t.string "assoc_type"
- t.binary "server_url"
- t.binary "secret"
- end
-
- create_table "open_id_authentication_nonces", :force => true do |t|
- t.integer "timestamp", :null => false
- t.string "server_url"
- t.string "salt", :null => false
- end
-
- create_table "open_source_projects", :force => true do |t|
- t.string "name"
- t.text "description"
- t.integer "commit_count", :default => 0
- t.integer "code_line", :default => 0
- t.integer "users_count", :default => 0
- t.date "last_commit_time"
- t.string "url"
- t.date "date_collected"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "option_numbers", :force => true do |t|
- t.integer "user_id"
- t.integer "memo"
- t.integer "messages_for_issues"
- t.integer "issues_status"
- t.integer "replay_for_message"
- t.integer "replay_for_memo"
- t.integer "follow"
- t.integer "tread"
- t.integer "praise_by_one"
- t.integer "praise_by_two"
- t.integer "praise_by_three"
- t.integer "tread_by_one"
- t.integer "tread_by_two"
- t.integer "tread_by_three"
- t.integer "changeset"
- t.integer "document"
- t.integer "attachment"
- t.integer "issue_done_ratio"
- t.integer "post_issue"
- t.integer "score_type"
- t.integer "total_score"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "project_id"
- end
-
- create_table "organizations", :force => true do |t|
- t.string "name"
- t.string "logo_link"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "phone_app_versions", :force => true do |t|
- t.string "version"
- t.text "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "poll_answers", :force => true do |t|
- t.integer "poll_question_id"
- t.text "answer_text"
- t.integer "answer_position"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "poll_questions", :force => true do |t|
- t.string "question_title"
- t.integer "question_type"
- t.integer "is_necessary"
- t.integer "poll_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "question_number"
- end
-
- create_table "poll_users", :force => true do |t|
- t.integer "user_id"
- t.integer "poll_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "poll_votes", :force => true do |t|
- t.integer "user_id"
- t.integer "poll_question_id"
- t.integer "poll_answer_id"
- t.text "vote_text"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "polls", :force => true do |t|
- t.string "polls_name"
- t.string "polls_type"
- t.integer "polls_group_id"
- t.integer "polls_status"
- t.integer "user_id"
- t.datetime "published_at"
- t.datetime "closed_at"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.text "polls_description"
- t.integer "show_result", :default => 1
- end
-
- create_table "praise_tread_caches", :force => true do |t|
- t.integer "object_id", :null => false
- t.string "object_type"
- t.integer "praise_num"
- t.integer "tread_num"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "praise_treads", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "praise_tread_object_id"
- t.string "praise_tread_object_type"
- t.integer "praise_or_tread"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "project_infos", :force => true do |t|
- t.integer "project_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "project_scores", :force => true do |t|
- t.string "project_id"
- t.integer "score"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "issue_num", :default => 0
- t.integer "issue_journal_num", :default => 0
- t.integer "news_num", :default => 0
- t.integer "documents_num", :default => 0
- t.integer "changeset_num", :default => 0
- t.integer "board_message_num", :default => 0
- end
-
- create_table "project_statuses", :force => true do |t|
- t.integer "changesets_count"
- t.integer "watchers_count"
- t.integer "project_id"
- t.integer "project_type"
- t.float "grade", :default => 0.0
- t.integer "course_ac_para", :default => 0
- end
-
- add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade"
-
- create_table "projecting_softapplictions", :force => true do |t|
- t.integer "user_id"
- t.integer "softapplication_id"
- t.integer "project_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "projects", :force => true do |t|
- t.string "name", :default => "", :null => false
- t.text "description"
- 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 "lft"
- t.integer "rgt"
- 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.integer "user_id"
- t.integer "dts_test", :default => 0
- t.string "enterprise_name"
- t.integer "organization_id"
- t.integer "project_new_type"
- end
-
- add_index "projects", ["lft"], :name => "index_projects_on_lft"
- add_index "projects", ["rgt"], :name => "index_projects_on_rgt"
-
- create_table "projects_trackers", :id => false, :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.integer "tracker_id", :default => 0, :null => false
- end
-
- 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"
-
- create_table "queries", :force => true do |t|
- t.integer "project_id"
- t.string "name", :default => "", :null => false
- t.text "filters"
- t.integer "user_id", :default => 0, :null => false
- t.boolean "is_public", :default => false, :null => false
- t.text "column_names"
- t.text "sort_criteria"
- t.string "group_by"
- t.string "type"
- end
-
- add_index "queries", ["project_id"], :name => "index_queries_on_project_id"
- add_index "queries", ["user_id"], :name => "index_queries_on_user_id"
-
- create_table "relative_memo_to_open_source_projects", :force => true do |t|
- t.integer "osp_id"
- t.integer "relative_memo_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "relative_memos", :force => true do |t|
- t.integer "osp_id"
- t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :limit => 16777215, :null => false
- t.integer "author_id"
- t.integer "replies_count", :default => 0
- t.integer "last_reply_id"
- t.boolean "lock", :default => false
- t.boolean "sticky", :default => false
- t.boolean "is_quote", :default => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "viewed_count_crawl", :default => 0
- t.integer "viewed_count_local", :default => 0
- t.string "url"
- t.string "username"
- t.string "userhomeurl"
- t.date "date_collected"
- t.string "topic_resource"
- end
-
- create_table "repositories", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.string "url", :default => "", :null => false
- t.string "login", :limit => 60, :default => ""
- t.string "password", :default => ""
- t.string "root_url", :default => ""
- t.string "type"
- t.string "path_encoding", :limit => 64
- t.string "log_encoding", :limit => 64
- t.text "extra_info"
- t.string "identifier"
- t.boolean "is_default", :default => false
- t.boolean "hidden", :default => false
- end
-
- add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
-
- create_table "rich_rich_files", :force => true do |t|
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "rich_file_file_name"
- t.string "rich_file_content_type"
- t.integer "rich_file_file_size"
- t.datetime "rich_file_updated_at"
- t.string "owner_type"
- t.integer "owner_id"
- t.text "uri_cache"
- t.string "simplified_type", :default => "file"
- end
-
- create_table "roles", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.integer "position", :default => 1
- t.boolean "assignable", :default => true
- t.integer "builtin", :default => 0, :null => false
- t.text "permissions"
- t.string "issues_visibility", :limit => 30, :default => "default", :null => false
- end
-
- create_table "schools", :force => true do |t|
- t.string "name"
- t.string "province"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "logo_link"
- end
-
- create_table "seems_rateable_cached_ratings", :force => true do |t|
- t.integer "cacheable_id", :limit => 8
- t.string "cacheable_type"
- t.float "avg", :null => false
- t.integer "cnt", :null => false
- t.string "dimension"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "seems_rateable_rates", :force => true do |t|
- t.integer "rater_id", :limit => 8
- t.integer "rateable_id"
- t.string "rateable_type"
- t.float "stars", :null => false
- t.string "dimension"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "is_teacher_score", :default => 0
- end
-
- create_table "settings", :force => true do |t|
- t.string "name", :default => "", :null => false
- t.text "value"
- t.datetime "updated_on"
- end
-
- add_index "settings", ["name"], :name => "index_settings_on_name"
-
- create_table "shares", :force => true do |t|
- t.date "created_on"
- t.string "url"
- t.string "title"
- t.integer "share_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "project_id"
- t.integer "user_id"
- t.string "description"
- end
-
- create_table "softapplications", :force => true do |t|
- t.string "name"
- t.text "description"
- t.integer "app_type_id"
- t.string "app_type_name"
- t.string "android_min_version_available"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "contest_id"
- t.integer "softapplication_id"
- t.integer "is_public"
- t.string "application_developers"
- t.string "deposit_project_url"
- t.string "deposit_project"
- t.integer "project_id"
- 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 "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_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"
- end
-
- 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 "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
- 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 "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 "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
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20150602055730) do
+
+ create_table "activities", :force => true do |t|
+ t.integer "act_id", :null => false
+ t.string "act_type", :null => false
+ t.integer "user_id", :null => false
+ end
+
+ add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type"
+ add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
+ add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
+
+ create_table "api_keys", :force => true do |t|
+ t.string "access_token"
+ t.datetime "expires_at"
+ t.integer "user_id"
+ t.boolean "active", :default => true
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token"
+ add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id"
+
+ create_table "applied_projects", :force => true do |t|
+ t.integer "project_id", :null => false
+ t.integer "user_id", :null => false
+ end
+
+ create_table "apply_project_masters", :force => true do |t|
+ t.integer "user_id"
+ t.string "apply_type"
+ t.integer "apply_id"
+ t.integer "status"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "attachments", :force => true do |t|
+ t.integer "container_id"
+ t.string "container_type", :limit => 30
+ t.string "filename", :default => "", :null => false
+ t.string "disk_filename", :default => "", :null => false
+ t.integer "filesize", :default => 0, :null => false
+ t.string "content_type", :default => ""
+ t.string "digest", :limit => 40, :default => "", :null => false
+ t.integer "downloads", :default => 0, :null => false
+ t.integer "author_id", :default => 0, :null => false
+ t.datetime "created_on"
+ t.string "description"
+ t.string "disk_directory"
+ t.integer "attachtype", :default => 1
+ t.integer "is_public", :default => 1
+ t.integer "copy_from"
+ t.integer "quotes"
+ end
+
+ add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id"
+ add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type"
+ add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on"
+
+ create_table "attachmentstypes", :force => true do |t|
+ t.integer "typeId", :null => false
+ t.string "typeName", :limit => 50
+ end
+
+ create_table "auth_sources", :force => true do |t|
+ t.string "type", :limit => 30, :default => "", :null => false
+ t.string "name", :limit => 60, :default => "", :null => false
+ t.string "host", :limit => 60
+ t.integer "port"
+ t.string "account"
+ t.string "account_password", :default => ""
+ t.string "base_dn"
+ t.string "attr_login", :limit => 30
+ t.string "attr_firstname", :limit => 30
+ t.string "attr_lastname", :limit => 30
+ t.string "attr_mail", :limit => 30
+ t.boolean "onthefly_register", :default => false, :null => false
+ t.boolean "tls", :default => false, :null => false
+ t.string "filter"
+ t.integer "timeout"
+ end
+
+ add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type"
+
+ create_table "biding_projects", :force => true do |t|
+ t.integer "project_id"
+ t.integer "bid_id"
+ t.integer "user_id"
+ t.string "description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "reward"
+ end
+
+ create_table "bids", :force => true do |t|
+ t.string "name"
+ t.string "budget", :null => false
+ t.integer "author_id"
+ t.date "deadline"
+ t.text "description"
+ t.datetime "created_on", :null => false
+ t.datetime "updated_on", :null => false
+ t.integer "commit"
+ t.integer "reward_type"
+ t.integer "homework_type"
+ t.integer "parent_id"
+ t.string "password"
+ t.integer "is_evaluation"
+ t.integer "proportion", :default => 60
+ t.integer "comment_status", :default => 0
+ t.integer "evaluation_num", :default => 3
+ t.integer "open_anonymous_evaluation", :default => 1
+ end
+
+ create_table "boards", :force => true do |t|
+ t.integer "project_id", :null => false
+ t.string "name", :default => "", :null => false
+ t.string "description"
+ t.integer "position", :default => 1
+ t.integer "topics_count", :default => 0, :null => false
+ t.integer "messages_count", :default => 0, :null => false
+ t.integer "last_message_id"
+ t.integer "parent_id"
+ t.integer "course_id"
+ end
+
+ add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
+ add_index "boards", ["project_id"], :name => "boards_project_id"
+
+ create_table "bug_to_osps", :force => true do |t|
+ t.integer "osp_id"
+ t.integer "relative_memo_id"
+ t.string "description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "changes", :force => true do |t|
+ t.integer "changeset_id", :null => false
+ t.string "action", :limit => 1, :default => "", :null => false
+ t.text "path", :null => false
+ t.text "from_path"
+ t.string "from_revision"
+ t.string "revision"
+ t.string "branch"
+ end
+
+ add_index "changes", ["changeset_id"], :name => "changesets_changeset_id"
+
+ create_table "changeset_parents", :id => false, :force => true do |t|
+ t.integer "changeset_id", :null => false
+ t.integer "parent_id", :null => false
+ end
+
+ add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids"
+ add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids"
+
+ create_table "changesets", :force => true do |t|
+ t.integer "repository_id", :null => false
+ t.string "revision", :null => false
+ t.string "committer"
+ t.datetime "committed_on", :null => false
+ t.text "comments"
+ t.date "commit_date"
+ t.string "scmid"
+ t.integer "user_id"
+ end
+
+ add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"
+ add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true
+ add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid"
+ add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id"
+ add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id"
+
+ create_table "changesets_issues", :id => false, :force => true do |t|
+ t.integer "changeset_id", :null => false
+ t.integer "issue_id", :null => false
+ end
+
+ add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true
+
+ create_table "code_review_assignments", :force => true do |t|
+ t.integer "issue_id"
+ t.integer "change_id"
+ t.integer "attachment_id"
+ t.string "file_path"
+ t.string "rev"
+ t.string "rev_to"
+ t.string "action_type"
+ t.integer "changeset_id"
+ end
+
+ create_table "code_review_project_settings", :force => true do |t|
+ t.integer "project_id"
+ t.integer "tracker_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "updated_by"
+ t.boolean "hide_code_review_tab", :default => false
+ t.integer "auto_relation", :default => 1
+ t.integer "assignment_tracker_id"
+ t.text "auto_assign"
+ t.integer "lock_version", :default => 0, :null => false
+ t.boolean "tracker_in_review_dialog", :default => false
+ end
+
+ create_table "code_review_user_settings", :force => true do |t|
+ t.integer "user_id", :default => 0, :null => false
+ t.integer "mail_notification", :default => 0, :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "code_reviews", :force => true do |t|
+ t.integer "project_id"
+ t.integer "change_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "line"
+ t.integer "updated_by_id"
+ t.integer "lock_version", :default => 0, :null => false
+ t.integer "status_changed_from"
+ t.integer "status_changed_to"
+ t.integer "issue_id"
+ t.string "action_type"
+ t.string "file_path"
+ t.string "rev"
+ t.string "rev_to"
+ t.integer "attachment_id"
+ t.integer "file_count", :default => 0, :null => false
+ t.boolean "diff_all"
+ 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
+ t.integer "author_id", :default => 0, :null => false
+ t.text "comments"
+ t.datetime "created_on", :null => false
+ t.datetime "updated_on", :null => false
+ end
+
+ add_index "comments", ["author_id"], :name => "index_comments_on_author_id"
+ add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type"
+
+ create_table "contest_notifications", :force => true do |t|
+ t.text "title"
+ t.text "content"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "contesting_projects", :force => true do |t|
+ t.integer "project_id"
+ t.string "contest_id"
+ t.integer "user_id"
+ t.string "description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "reward"
+ end
+
+ create_table "contesting_softapplications", :force => true do |t|
+ t.integer "softapplication_id"
+ t.integer "contest_id"
+ t.integer "user_id"
+ t.string "description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "reward"
+ end
+
+ create_table "contestnotifications", :force => true do |t|
+ t.integer "contest_id"
+ t.string "title"
+ t.string "summary"
+ t.text "description"
+ t.integer "author_id"
+ t.integer "notificationcomments_count"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "contests", :force => true do |t|
+ t.string "name"
+ t.string "budget", :default => ""
+ t.integer "author_id"
+ t.date "deadline"
+ t.string "description"
+ t.integer "commit"
+ t.string "password"
+ t.datetime "created_on", :null => false
+ t.datetime "updated_on", :null => false
+ end
+
+ create_table "course_attachments", :force => true do |t|
+ t.string "filename"
+ t.string "disk_filename"
+ t.integer "filesize"
+ t.string "content_type"
+ t.string "digest"
+ t.integer "downloads"
+ t.string "author_id"
+ t.string "integer"
+ t.string "description"
+ t.string "disk_directory"
+ t.integer "attachtype"
+ t.integer "is_public"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "container_id", :default => 0
+ end
+
+ create_table "course_groups", :force => true do |t|
+ t.string "name"
+ t.integer "course_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "course_infos", :force => true do |t|
+ t.integer "course_id"
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "course_statuses", :force => true do |t|
+ t.integer "changesets_count"
+ t.integer "watchers_count"
+ t.integer "course_id"
+ t.float "grade", :default => 0.0
+ t.integer "course_ac_para", :default => 0
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "courses", :force => true do |t|
+ t.integer "tea_id"
+ t.string "name"
+ t.integer "state"
+ t.string "code"
+ t.integer "time"
+ t.string "extra"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "location"
+ t.string "term"
+ t.string "string"
+ t.string "password"
+ t.string "setup_time"
+ t.string "endup_time"
+ t.string "class_period"
+ t.integer "school_id"
+ t.text "description"
+ 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
+ end
+
+ create_table "custom_fields", :force => true do |t|
+ t.string "type", :limit => 30, :default => "", :null => false
+ t.string "name", :limit => 30, :default => "", :null => false
+ t.string "field_format", :limit => 30, :default => "", :null => false
+ t.text "possible_values"
+ t.string "regexp", :default => ""
+ t.integer "min_length", :default => 0, :null => false
+ t.integer "max_length", :default => 0, :null => false
+ t.boolean "is_required", :default => false, :null => false
+ t.boolean "is_for_all", :default => false, :null => false
+ t.boolean "is_filter", :default => false, :null => false
+ t.integer "position", :default => 1
+ t.boolean "searchable", :default => false
+ t.text "default_value"
+ t.boolean "editable", :default => true
+ t.boolean "visible", :default => true, :null => false
+ t.boolean "multiple", :default => false
+ end
+
+ add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type"
+
+ create_table "custom_fields_projects", :id => false, :force => true do |t|
+ t.integer "custom_field_id", :default => 0, :null => false
+ t.integer "project_id", :default => 0, :null => false
+ end
+
+ add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true
+
+ create_table "custom_fields_trackers", :id => false, :force => true do |t|
+ t.integer "custom_field_id", :default => 0, :null => false
+ t.integer "tracker_id", :default => 0, :null => false
+ end
+
+ add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true
+
+ create_table "custom_values", :force => true do |t|
+ t.string "customized_type", :limit => 30, :default => "", :null => false
+ t.integer "customized_id", :default => 0, :null => false
+ t.integer "custom_field_id", :default => 0, :null => false
+ t.text "value"
+ end
+
+ add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id"
+ add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized"
+
+ create_table "delayed_jobs", :force => true do |t|
+ t.integer "priority", :default => 0, :null => false
+ t.integer "attempts", :default => 0, :null => false
+ t.text "handler", :null => false
+ t.text "last_error"
+ t.datetime "run_at"
+ t.datetime "locked_at"
+ t.datetime "failed_at"
+ t.string "locked_by"
+ t.string "queue"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
+
+ create_table "discuss_demos", :force => true do |t|
+ t.string "title"
+ t.text "body"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "documents", :force => true do |t|
+ t.integer "project_id", :default => 0, :null => false
+ t.integer "category_id", :default => 0, :null => false
+ t.string "title", :limit => 60, :default => "", :null => false
+ t.text "description"
+ t.datetime "created_on"
+ t.integer "user_id", :default => 0
+ t.integer "is_public", :default => 1
+ end
+
+ add_index "documents", ["category_id"], :name => "index_documents_on_category_id"
+ add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
+ add_index "documents", ["project_id"], :name => "documents_project_id"
+
+ create_table "enabled_modules", :force => true do |t|
+ t.integer "project_id"
+ t.string "name", :null => false
+ t.integer "course_id"
+ end
+
+ add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id"
+
+ create_table "enumerations", :force => true do |t|
+ t.string "name", :limit => 30, :default => "", :null => false
+ t.integer "position", :default => 1
+ t.boolean "is_default", :default => false, :null => false
+ t.string "type"
+ t.boolean "active", :default => true, :null => false
+ t.integer "project_id"
+ t.integer "parent_id"
+ t.string "position_name", :limit => 30
+ end
+
+ 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 "first_pages", :force => true do |t|
+ t.string "web_title"
+ t.string "title"
+ t.text "description"
+ t.string "page_type"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "sort_type"
+ t.integer "image_width", :default => 107
+ t.integer "image_height", :default => 63
+ t.integer "show_course", :default => 1
+ t.integer "show_contest", :default => 1
+ end
+
+ create_table "forge_activities", :force => true do |t|
+ t.integer "user_id"
+ t.integer "project_id"
+ t.integer "forge_act_id"
+ t.string "forge_act_type"
+ t.integer "org_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id"
+
+ create_table "forums", :force => true do |t|
+ t.string "name", :null => false
+ t.text "description"
+ t.integer "topic_count", :default => 0
+ t.integer "memo_count", :default => 0
+ t.integer "last_memo_id", :default => 0
+ t.integer "creator_id", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "sticky"
+ t.integer "locked"
+ end
+
+ create_table "groups_users", :id => false, :force => true do |t|
+ t.integer "group_id", :null => false
+ t.integer "user_id", :null => false
+ end
+
+ add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true
+
+ create_table "homework_attaches", :force => true do |t|
+ t.integer "bid_id"
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "reward"
+ t.string "name"
+ t.text "description"
+ t.integer "state"
+ t.integer "project_id", :default => 0
+ t.float "score", :default => 0.0
+ t.integer "is_teacher_score", :default => 0
+ end
+
+ add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
+
+ create_table "homework_commons", :force => true do |t|
+ t.string "name"
+ t.integer "user_id"
+ t.text "description"
+ t.date "publish_time"
+ t.date "end_time"
+ t.integer "homework_type", :default => 1
+ t.string "late_penalty"
+ t.integer "course_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "homework_detail_manuals", :force => true do |t|
+ t.float "ta_proportion"
+ t.integer "comment_status"
+ t.date "evaluation_start"
+ t.date "evaluation_end"
+ t.integer "evaluation_num"
+ t.integer "absence_penalty", :default => 1
+ t.integer "homework_common_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "homework_detail_programings", :force => true do |t|
+ t.string "language"
+ t.text "standard_code", :limit => 2147483647
+ t.integer "homework_common_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "homework_evaluations", :force => true do |t|
+ t.string "user_id"
+ t.string "homework_attach_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "homework_for_courses", :force => true do |t|
+ t.integer "course_id"
+ t.integer "bid_id"
+ end
+
+ add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id"
+ add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id"
+
+ create_table "homework_tests", :force => true do |t|
+ t.text "input"
+ t.text "output"
+ t.integer "homework_common_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "homework_users", :force => true do |t|
+ t.string "homework_attach_id"
+ t.string "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "issue_categories", :force => true do |t|
+ t.integer "project_id", :default => 0, :null => false
+ t.string "name", :limit => 30, :default => "", :null => false
+ t.integer "assigned_to_id"
+ end
+
+ add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id"
+ add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id"
+
+ create_table "issue_relations", :force => true do |t|
+ t.integer "issue_from_id", :null => false
+ t.integer "issue_to_id", :null => false
+ t.string "relation_type", :default => "", :null => false
+ t.integer "delay"
+ end
+
+ add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true
+ add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id"
+ add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id"
+
+ create_table "issue_statuses", :force => true do |t|
+ t.string "name", :limit => 30, :default => "", :null => false
+ t.boolean "is_closed", :default => false, :null => false
+ t.boolean "is_default", :default => false, :null => false
+ t.integer "position", :default => 1
+ t.integer "default_done_ratio"
+ end
+
+ add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed"
+ add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default"
+ add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position"
+
+ create_table "issues", :force => true do |t|
+ t.integer "tracker_id", :null => false
+ t.integer "project_id", :null => false
+ t.string "subject", :default => "", :null => false
+ t.text "description"
+ t.date "due_date"
+ t.integer "category_id"
+ t.integer "status_id", :null => false
+ t.integer "assigned_to_id"
+ t.integer "priority_id", :null => false
+ t.integer "fixed_version_id"
+ t.integer "author_id", :null => false
+ t.integer "lock_version", :default => 0, :null => false
+ t.datetime "created_on"
+ t.datetime "updated_on"
+ t.date "start_date"
+ t.integer "done_ratio", :default => 0, :null => false
+ t.float "estimated_hours"
+ t.integer "parent_id"
+ t.integer "root_id"
+ t.integer "lft"
+ t.integer "rgt"
+ t.boolean "is_private", :default => false, :null => false
+ t.datetime "closed_on"
+ t.integer "project_issues_index"
+ end
+
+ add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id"
+ add_index "issues", ["author_id"], :name => "index_issues_on_author_id"
+ add_index "issues", ["category_id"], :name => "index_issues_on_category_id"
+ add_index "issues", ["created_on"], :name => "index_issues_on_created_on"
+ add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id"
+ add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id"
+ add_index "issues", ["project_id"], :name => "issues_project_id"
+ add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt"
+ add_index "issues", ["status_id"], :name => "index_issues_on_status_id"
+ add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id"
+
+ create_table "join_in_competitions", :force => true do |t|
+ t.integer "user_id"
+ t.integer "competition_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "join_in_contests", :force => true do |t|
+ t.integer "user_id"
+ t.integer "bid_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "journal_details", :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", ["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"
+ t.integer "reply_id"
+ end
+
+ add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id"
+ add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id"
+ add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id"
+
+ create_table "journals", :force => true do |t|
+ t.integer "journalized_id", :default => 0, :null => false
+ t.string "journalized_type", :limit => 30, :default => "", :null => false
+ t.integer "user_id", :default => 0, :null => false
+ t.text "notes"
+ t.datetime "created_on", :null => false
+ t.boolean "private_notes", :default => false, :null => false
+ end
+
+ add_index "journals", ["created_on"], :name => "index_journals_on_created_on"
+ add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id"
+ add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id"
+ add_index "journals", ["user_id"], :name => "index_journals_on_user_id"
+
+ create_table "journals_for_messages", :force => true do |t|
+ t.integer "jour_id"
+ t.string "jour_type"
+ t.integer "user_id"
+ t.text "notes"
+ t.integer "status"
+ t.integer "reply_id"
+ t.datetime "created_on", :null => false
+ t.datetime "updated_on", :null => false
+ t.string "m_parent_id"
+ t.boolean "is_readed"
+ t.integer "m_reply_count"
+ t.integer "m_reply_id"
+ t.integer "is_comprehensive_evaluation"
+ end
+
+ create_table "kindeditor_assets", :force => true do |t|
+ t.string "asset"
+ t.integer "file_size"
+ t.string "file_type"
+ t.integer "owner_id"
+ t.string "asset_type"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "owner_type", :default => 0
+ end
+
+ create_table "member_roles", :force => true do |t|
+ t.integer "member_id", :null => false
+ t.integer "role_id", :null => false
+ t.integer "inherited_from"
+ end
+
+ add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id"
+ add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id"
+
+ create_table "members", :force => true do |t|
+ t.integer "user_id", :default => 0, :null => false
+ t.integer "project_id", :default => 0
+ t.datetime "created_on"
+ t.boolean "mail_notification", :default => false, :null => false
+ t.integer "course_id", :default => -1
+ t.integer "course_group_id", :default => 0
+ end
+
+ 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"
+
+ create_table "memos", :force => true do |t|
+ t.integer "forum_id", :null => false
+ t.integer "parent_id"
+ t.string "subject", :null => false
+ t.text "content", :null => false
+ t.integer "author_id", :null => false
+ t.integer "replies_count", :default => 0
+ t.integer "last_reply_id"
+ t.boolean "lock", :default => false
+ t.boolean "sticky", :default => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "viewed_count", :default => 0
+ end
+
+ create_table "messages", :force => true do |t|
+ t.integer "board_id", :null => false
+ t.integer "parent_id"
+ t.string "subject", :default => "", :null => false
+ t.text "content"
+ t.integer "author_id"
+ t.integer "replies_count", :default => 0, :null => false
+ t.integer "last_reply_id"
+ t.datetime "created_on", :null => false
+ t.datetime "updated_on", :null => false
+ t.boolean "locked", :default => false
+ t.integer "sticky", :default => 0
+ end
+
+ add_index "messages", ["author_id"], :name => "index_messages_on_author_id"
+ add_index "messages", ["board_id"], :name => "messages_board_id"
+ add_index "messages", ["created_on"], :name => "index_messages_on_created_on"
+ add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
+ add_index "messages", ["parent_id"], :name => "messages_parent_id"
+
+ create_table "news", :force => true do |t|
+ t.integer "project_id"
+ t.string "title", :limit => 60, :default => "", :null => false
+ t.string "summary", :default => ""
+ t.text "description"
+ t.integer "author_id", :default => 0, :null => false
+ t.datetime "created_on"
+ t.integer "comments_count", :default => 0, :null => false
+ t.integer "course_id"
+ end
+
+ add_index "news", ["author_id"], :name => "index_news_on_author_id"
+ add_index "news", ["created_on"], :name => "index_news_on_created_on"
+ add_index "news", ["project_id"], :name => "news_project_id"
+
+ create_table "no_uses", :force => true do |t|
+ t.integer "user_id", :null => false
+ t.string "no_use_type"
+ t.integer "no_use_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "notificationcomments", :force => true do |t|
+ t.string "notificationcommented_type"
+ t.integer "notificationcommented_id"
+ t.integer "author_id"
+ t.text "notificationcomments"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "open_id_authentication_associations", :force => true do |t|
+ t.integer "issued"
+ t.integer "lifetime"
+ t.string "handle"
+ t.string "assoc_type"
+ t.binary "server_url"
+ t.binary "secret"
+ end
+
+ create_table "open_id_authentication_nonces", :force => true do |t|
+ t.integer "timestamp", :null => false
+ t.string "server_url"
+ t.string "salt", :null => false
+ end
+
+ create_table "open_source_projects", :force => true do |t|
+ t.string "name"
+ t.text "description"
+ t.integer "commit_count", :default => 0
+ t.integer "code_line", :default => 0
+ t.integer "users_count", :default => 0
+ t.date "last_commit_time"
+ t.string "url"
+ t.date "date_collected"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "option_numbers", :force => true do |t|
+ t.integer "user_id"
+ t.integer "memo"
+ t.integer "messages_for_issues"
+ t.integer "issues_status"
+ t.integer "replay_for_message"
+ t.integer "replay_for_memo"
+ t.integer "follow"
+ t.integer "tread"
+ t.integer "praise_by_one"
+ t.integer "praise_by_two"
+ t.integer "praise_by_three"
+ t.integer "tread_by_one"
+ t.integer "tread_by_two"
+ t.integer "tread_by_three"
+ t.integer "changeset"
+ t.integer "document"
+ t.integer "attachment"
+ t.integer "issue_done_ratio"
+ t.integer "post_issue"
+ t.integer "score_type"
+ t.integer "total_score"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "project_id"
+ end
+
+ create_table "organizations", :force => true do |t|
+ t.string "name"
+ t.string "logo_link"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "phone_app_versions", :force => true do |t|
+ t.string "version"
+ t.text "description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "poll_answers", :force => true do |t|
+ t.integer "poll_question_id"
+ t.text "answer_text"
+ t.integer "answer_position"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "poll_questions", :force => true do |t|
+ t.string "question_title"
+ t.integer "question_type"
+ t.integer "is_necessary"
+ t.integer "poll_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "question_number"
+ end
+
+ create_table "poll_users", :force => true do |t|
+ t.integer "user_id"
+ t.integer "poll_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "poll_votes", :force => true do |t|
+ t.integer "user_id"
+ t.integer "poll_question_id"
+ t.integer "poll_answer_id"
+ t.text "vote_text"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "polls", :force => true do |t|
+ t.string "polls_name"
+ t.string "polls_type"
+ t.integer "polls_group_id"
+ t.integer "polls_status"
+ t.integer "user_id"
+ t.datetime "published_at"
+ t.datetime "closed_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.text "polls_description"
+ t.integer "show_result", :default => 1
+ end
+
+ create_table "praise_tread_caches", :force => true do |t|
+ t.integer "object_id", :null => false
+ t.string "object_type"
+ t.integer "praise_num"
+ t.integer "tread_num"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "praise_treads", :force => true do |t|
+ t.integer "user_id", :null => false
+ t.integer "praise_tread_object_id"
+ t.string "praise_tread_object_type"
+ t.integer "praise_or_tread"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "project_infos", :force => true do |t|
+ t.integer "project_id"
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "project_scores", :force => true do |t|
+ t.string "project_id"
+ t.integer "score"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "issue_num", :default => 0
+ t.integer "issue_journal_num", :default => 0
+ t.integer "news_num", :default => 0
+ t.integer "documents_num", :default => 0
+ t.integer "changeset_num", :default => 0
+ t.integer "board_message_num", :default => 0
+ end
+
+ create_table "project_statuses", :force => true do |t|
+ t.integer "changesets_count"
+ t.integer "watchers_count"
+ t.integer "project_id"
+ t.integer "project_type"
+ t.float "grade", :default => 0.0
+ t.integer "course_ac_para", :default => 0
+ end
+
+ add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade"
+
+ create_table "projecting_softapplictions", :force => true do |t|
+ t.integer "user_id"
+ t.integer "softapplication_id"
+ t.integer "project_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "projects", :force => true do |t|
+ t.string "name", :default => "", :null => false
+ t.text "description"
+ 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 "lft"
+ t.integer "rgt"
+ 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.integer "user_id"
+ t.integer "dts_test", :default => 0
+ t.string "enterprise_name"
+ t.integer "organization_id"
+ t.integer "project_new_type"
+ end
+
+ add_index "projects", ["lft"], :name => "index_projects_on_lft"
+ add_index "projects", ["rgt"], :name => "index_projects_on_rgt"
+
+ create_table "projects_trackers", :id => false, :force => true do |t|
+ t.integer "project_id", :default => 0, :null => false
+ t.integer "tracker_id", :default => 0, :null => false
+ end
+
+ 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"
+
+ create_table "queries", :force => true do |t|
+ t.integer "project_id"
+ t.string "name", :default => "", :null => false
+ t.text "filters"
+ t.integer "user_id", :default => 0, :null => false
+ t.boolean "is_public", :default => false, :null => false
+ t.text "column_names"
+ t.text "sort_criteria"
+ t.string "group_by"
+ t.string "type"
+ end
+
+ add_index "queries", ["project_id"], :name => "index_queries_on_project_id"
+ add_index "queries", ["user_id"], :name => "index_queries_on_user_id"
+
+ create_table "relative_memo_to_open_source_projects", :force => true do |t|
+ t.integer "osp_id"
+ t.integer "relative_memo_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "relative_memos", :force => true do |t|
+ t.integer "osp_id"
+ t.integer "parent_id"
+ t.string "subject", :null => false
+ t.text "content", :limit => 16777215, :null => false
+ t.integer "author_id"
+ t.integer "replies_count", :default => 0
+ t.integer "last_reply_id"
+ t.boolean "lock", :default => false
+ t.boolean "sticky", :default => false
+ t.boolean "is_quote", :default => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "viewed_count_crawl", :default => 0
+ t.integer "viewed_count_local", :default => 0
+ t.string "url"
+ t.string "username"
+ t.string "userhomeurl"
+ t.date "date_collected"
+ t.string "topic_resource"
+ end
+
+ create_table "repositories", :force => true do |t|
+ t.integer "project_id", :default => 0, :null => false
+ t.string "url", :default => "", :null => false
+ t.string "login", :limit => 60, :default => ""
+ t.string "password", :default => ""
+ t.string "root_url", :default => ""
+ t.string "type"
+ t.string "path_encoding", :limit => 64
+ t.string "log_encoding", :limit => 64
+ t.text "extra_info"
+ t.string "identifier"
+ t.boolean "is_default", :default => false
+ t.boolean "hidden", :default => false
+ end
+
+ add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
+
+ create_table "rich_rich_files", :force => true do |t|
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "rich_file_file_name"
+ t.string "rich_file_content_type"
+ t.integer "rich_file_file_size"
+ t.datetime "rich_file_updated_at"
+ t.string "owner_type"
+ t.integer "owner_id"
+ t.text "uri_cache"
+ t.string "simplified_type", :default => "file"
+ end
+
+ create_table "roles", :force => true do |t|
+ t.string "name", :limit => 30, :default => "", :null => false
+ t.integer "position", :default => 1
+ t.boolean "assignable", :default => true
+ t.integer "builtin", :default => 0, :null => false
+ t.text "permissions"
+ t.string "issues_visibility", :limit => 30, :default => "default", :null => false
+ end
+
+ create_table "schools", :force => true do |t|
+ t.string "name"
+ t.string "province"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "logo_link"
+ end
+
+ create_table "seems_rateable_cached_ratings", :force => true do |t|
+ t.integer "cacheable_id", :limit => 8
+ t.string "cacheable_type"
+ t.float "avg", :null => false
+ t.integer "cnt", :null => false
+ t.string "dimension"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "seems_rateable_rates", :force => true do |t|
+ t.integer "rater_id", :limit => 8
+ t.integer "rateable_id"
+ t.string "rateable_type"
+ t.float "stars", :null => false
+ t.string "dimension"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "is_teacher_score", :default => 0
+ end
+
+ create_table "settings", :force => true do |t|
+ t.string "name", :default => "", :null => false
+ t.text "value"
+ t.datetime "updated_on"
+ end
+
+ add_index "settings", ["name"], :name => "index_settings_on_name"
+
+ create_table "shares", :force => true do |t|
+ t.date "created_on"
+ t.string "url"
+ t.string "title"
+ t.integer "share_type"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "project_id"
+ t.integer "user_id"
+ t.string "description"
+ end
+
+ create_table "softapplications", :force => true do |t|
+ t.string "name"
+ t.text "description"
+ t.integer "app_type_id"
+ t.string "app_type_name"
+ t.string "android_min_version_available"
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "contest_id"
+ t.integer "softapplication_id"
+ t.integer "is_public"
+ t.string "application_developers"
+ t.string "deposit_project_url"
+ t.string "deposit_project"
+ t.integer "project_id"
+ end
+
+ create_table "student_works", :force => true do |t|
+ t.string "name"
+ t.text "description"
+ t.integer "homework_common_id"
+ t.integer "user_id"
+ t.float "final_score"
+ t.float "teacher_score"
+ t.float "student_score"
+ t.float "teaching_asistant_score"
+ t.integer "project_id", :default => 0
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ 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 "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_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"
+ end
+
+ 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 "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
+ 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 "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 "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
diff --git a/lib/tasks/office.rake b/lib/tasks/office.rake
new file mode 100644
index 000000000..3e4c0a286
--- /dev/null
+++ b/lib/tasks/office.rake
@@ -0,0 +1,20 @@
+namespace :office do
+ desc "conver any files to html"
+ task :conver => :environment do
+ all_count = Attachment.count
+ i = 0
+ Attachment.find_each do |a|
+ i += 1
+ puts "process [#{i}/#{all_count}] => id #{a.id}"
+ saved_path = File.join(Rails.root, "files", "convered_office")
+ unless Dir.exist?(saved_path)
+ Dir.mkdir(saved_path)
+ end
+ convered_file = File.join(saved_path, a.disk_filename + ".html")
+ office = Trustie::Utils::Office.new(a.diskfile)
+ if office.conver(convered_file)
+ puts "process ok: #{convered_file} "
+ end
+ end
+ end
+end
diff --git a/lib/trustie/utils/office.rb b/lib/trustie/utils/office.rb
new file mode 100644
index 000000000..1bc18cb84
--- /dev/null
+++ b/lib/trustie/utils/office.rb
@@ -0,0 +1,42 @@
+module Trustie
+ module Utils
+ class Office
+
+ def initialize(file)
+ @file = file
+ end
+
+ def office?
+ %w(doc docx ppt pptx xls xlsx pdf).any?{|word| @file.downcase.end_with?(word)}
+ end
+
+ def conver(saved_file, force=false)
+ if force || !File.exist?(saved_file)
+ if File.exist? @file
+ if office?
+ begin
+ resource = RestClient::Resource.new(
+ 'http://192.168.80.107/Any2HtmlHandler.ashx',
+ :timeout => -1,
+ :open_timeout => -1
+ )
+ req = resource.post :txtDes => File.new(@file, 'rb')
+ File.open(saved_file, "wb+") do |f|
+ f.write(req.body)
+ end
+ return true
+ rescue =>e
+ puts e.message
+ end
+ end
+ else
+ puts "can't find file #{@file}"
+ end
+ end
+ false
+ end
+
+ end
+ end
+end
+
diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js
index fbec91afb..d97f1cd2e 100644
--- a/public/assets/kindeditor/kindeditor.js
+++ b/public/assets/kindeditor/kindeditor.js
@@ -260,7 +260,7 @@ K.options = {
items : [ 'emoticons',
'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|',
'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
- 'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'link',"more"
+ 'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'media',"more"
],
noDisableItems : ['source', 'fullscreen'],
colorTable : [
diff --git a/public/assets/kindeditor/plugins/media/media.js b/public/assets/kindeditor/plugins/media/media.js
index 58034662a..6d0d3a387 100644
--- a/public/assets/kindeditor/plugins/media/media.js
+++ b/public/assets/kindeditor/plugins/media/media.js
@@ -9,9 +9,9 @@
KindEditor.plugin('media', function(K) {
var self = this, name = 'media', lang = self.lang(name + '.'),
- allowMediaUpload = K.undef(self.allowMediaUpload, true),
+ allowMediaUpload = K.undef(self.allowMediaUpload, false),
allowFileManager = K.undef(self.allowFileManager, false),
- formatUploadUrl = K.undef(self.formatUploadUrl, true),
+ formatUploadUrl = K.undef(self.formatUploadUrl, false),
extraParams = K.undef(self.extraFileUploadParams, {}),
filePostName = K.undef(self.filePostName, 'imgFile'),
uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php');
@@ -22,10 +22,8 @@ KindEditor.plugin('media', function(K) {
//url
'',
//width
@@ -38,11 +36,6 @@ KindEditor.plugin('media', function(K) {
'' + lang.height + ' ',
' ',
'',
- //autostart
- '',
- '' + lang.autostart + ' ',
- ' ',
- '
',
''
].join('');
var dialog = self.createDialog({
@@ -72,14 +65,8 @@ KindEditor.plugin('media', function(K) {
heightBox[0].focus();
return;
}
- var html = K.mediaImg(self.themesPath + 'common/blank.gif', {
- src : url,
- type : K.mediaType(url),
- width : width,
- height : height,
- autostart : autostartBox[0].checked ? 'true' : 'false',
- loop : 'true'
- });
+
+ var html = ' ';
self.insertHtml(html).hideDialog().focus();
}
}
diff --git a/public/assets/kindeditor/plugins/media/media.old.js b/public/assets/kindeditor/plugins/media/media.old.js
new file mode 100644
index 000000000..58034662a
--- /dev/null
+++ b/public/assets/kindeditor/plugins/media/media.old.js
@@ -0,0 +1,170 @@
+/*******************************************************************************
+* KindEditor - WYSIWYG HTML Editor for Internet
+* Copyright (C) 2006-2011 kindsoft.net
+*
+* @author Roddy
+* @site http://www.kindsoft.net/
+* @licence http://www.kindsoft.net/license.php
+*******************************************************************************/
+
+KindEditor.plugin('media', function(K) {
+ var self = this, name = 'media', lang = self.lang(name + '.'),
+ allowMediaUpload = K.undef(self.allowMediaUpload, true),
+ allowFileManager = K.undef(self.allowFileManager, false),
+ formatUploadUrl = K.undef(self.formatUploadUrl, true),
+ extraParams = K.undef(self.extraFileUploadParams, {}),
+ filePostName = K.undef(self.filePostName, 'imgFile'),
+ uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php');
+ self.plugin.media = {
+ edit : function() {
+ var html = [
+ '',
+ //url
+ '
',
+ '' + lang.url + ' ',
+ ' ',
+ ' ',
+ '',
+ ' ',
+ ' ',
+ '
',
+ //width
+ '
',
+ '' + lang.width + ' ',
+ ' ',
+ '
',
+ //height
+ '
',
+ '' + lang.height + ' ',
+ ' ',
+ '
',
+ //autostart
+ '
',
+ '' + lang.autostart + ' ',
+ ' ',
+ '
',
+ '
'
+ ].join('');
+ var dialog = self.createDialog({
+ name : name,
+ width : 450,
+ height : 230,
+ title : self.lang(name),
+ body : html,
+ yesBtn : {
+ name : self.lang('yes'),
+ click : function(e) {
+ var url = K.trim(urlBox.val()),
+ width = widthBox.val(),
+ height = heightBox.val();
+ if (url == 'http://' || K.invalidUrl(url)) {
+ alert(self.lang('invalidUrl'));
+ urlBox[0].focus();
+ return;
+ }
+ if (!/^\d*$/.test(width)) {
+ alert(self.lang('invalidWidth'));
+ widthBox[0].focus();
+ return;
+ }
+ if (!/^\d*$/.test(height)) {
+ alert(self.lang('invalidHeight'));
+ heightBox[0].focus();
+ return;
+ }
+ var html = K.mediaImg(self.themesPath + 'common/blank.gif', {
+ src : url,
+ type : K.mediaType(url),
+ width : width,
+ height : height,
+ autostart : autostartBox[0].checked ? 'true' : 'false',
+ loop : 'true'
+ });
+ self.insertHtml(html).hideDialog().focus();
+ }
+ }
+ }),
+ div = dialog.div,
+ urlBox = K('[name="url"]', div),
+ viewServerBtn = K('[name="viewServer"]', div),
+ widthBox = K('[name="width"]', div),
+ heightBox = K('[name="height"]', div),
+ autostartBox = K('[name="autostart"]', div);
+ urlBox.val('http://');
+
+ if (allowMediaUpload) {
+ var uploadbutton = K.uploadbutton({
+ button : K('.ke-upload-button', div)[0],
+ fieldName : filePostName,
+ extraParams : extraParams,
+ url : K.addParam(uploadJson, 'dir=media'),
+ afterUpload : function(data) {
+ dialog.hideLoading();
+ if (data.error === 0) {
+ var url = data.url;
+ if (formatUploadUrl) {
+ url = K.formatUrl(url, 'absolute');
+ }
+ urlBox.val(url);
+ if (self.afterUpload) {
+ self.afterUpload.call(self, url, data, name);
+ }
+ alert(self.lang('uploadSuccess'));
+ } else {
+ alert(data.message);
+ }
+ },
+ afterError : function(html) {
+ dialog.hideLoading();
+ self.errorDialog(html);
+ }
+ });
+ uploadbutton.fileBox.change(function(e) {
+ dialog.showLoading(self.lang('uploadLoading'));
+ uploadbutton.submit();
+ });
+ } else {
+ K('.ke-upload-button', div).hide();
+ }
+
+ if (allowFileManager) {
+ viewServerBtn.click(function(e) {
+ self.loadPlugin('filemanager', function() {
+ self.plugin.filemanagerDialog({
+ viewType : 'LIST',
+ dirName : 'media',
+ clickFn : function(url, title) {
+ if (self.dialogs.length > 1) {
+ K('[name="url"]', div).val(url);
+ if (self.afterSelectFile) {
+ self.afterSelectFile.call(self, url);
+ }
+ self.hideDialog();
+ }
+ }
+ });
+ });
+ });
+ } else {
+ viewServerBtn.hide();
+ }
+
+ var img = self.plugin.getSelectedMedia();
+ if (img) {
+ var attrs = K.mediaAttrs(img.attr('data-ke-tag'));
+ urlBox.val(attrs.src);
+ widthBox.val(K.removeUnit(img.css('width')) || attrs.width || 0);
+ heightBox.val(K.removeUnit(img.css('height')) || attrs.height || 0);
+ autostartBox[0].checked = (attrs.autostart === 'true');
+ }
+ urlBox[0].focus();
+ urlBox[0].select();
+ },
+ 'delete' : function() {
+ self.plugin.getSelectedMedia().remove();
+ // [IE] 删除图片后立即点击图片按钮出错
+ self.addBookmark();
+ }
+ };
+ self.clickToolbar(name, self.plugin.media.edit);
+});
diff --git a/public/images/course/arrow.png b/public/images/course/arrow.png
new file mode 100644
index 000000000..2081ddf8d
Binary files /dev/null and b/public/images/course/arrow.png differ
diff --git a/public/images/course/arrow_up.jpg b/public/images/course/arrow_up.jpg
new file mode 100644
index 000000000..6bf285a19
Binary files /dev/null and b/public/images/course/arrow_up.jpg differ
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 828be910d..d9100b0bb 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -897,8 +897,31 @@ $(function(){
}
}
+ });
+ $('#download_homework_attachments').bind('ajax:complete', function (event, data, status, xhr) {
+ if(status == 'success'){
+ var res = JSON.parse(data.responseText);
+ if(res.length<1){
+ return;
+ }
+ if(res.length==1){
+ location.href = '/zipdown/download?file='+res[0].file;return;
+ }
+ document.getElementById('light').style.display='block';
+ $container = $('#light .upload_box_ul');
+ $container.empty();
+ for(var i = 0; i 1){
+ des = '第'+res[i].index+'-'+(res[i].count+res[i].index-1)+'个学生的作品下载';
+ } else {
+ des = '第'+res[i].index+'个学生的作品下载';
+ }
+ $(''+(i+1)+'. '+des+' (共'+res[i].size+'M) ').appendTo($container);
- })
+ }
+ }
+ });
});
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 972ee858f..e35a49eed 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -1,158 +1,182 @@
//配置课程信息
-function course_setting(id) {
+function course_setting(id)
+{
//alert(id);
- $('#tb_' + id).removeClass().addClass("hwork_hovertab");
- $('#tbc_0' + id).removeClass().addClass("dis");
- $('#tb_' + (3 - id)).removeClass().addClass("hwork_normaltab");
- $('#tbc_0' + (3 - id)).removeClass().addClass("undis");
+ $('#tb_'+id).removeClass().addClass("hwork_hovertab");
+ $('#tbc_0'+id).removeClass().addClass("dis");
+ $('#tb_'+(3-id)).removeClass().addClass("hwork_normaltab");
+ $('#tbc_0'+(3-id)).removeClass().addClass("undis");
}
-$(function() {
- $("img").removeAttr("align");
+$(function(){
+ $("img").removeAttr("align");
});
///////////////////////////////////////////////////////////////
//添加分班
-function add_group(url, course_id) {
- var group_name = $('#group_name').val();
- $.get(
- url, {
- valid: "name",
- value: group_name,
- course_id: course_id
- },
- function(data) {
- if (data.valid) {
- $("#add_group_name").submit();
- } else {
- alert(data.message);
- }
+function add_group(url,course_id) {
+ var group_name = $('#group_name').val();
+ $.get(
+ url,
+ { valid: "name",
+ value: group_name,
+ course_id: course_id },
+ function (data) {
+ if (data.valid) {
+ $("#add_group_name").submit();
}
- );
- }
- //修改分班:修改分班时得考虑什么都不改但是点击确定的情况
-
-function edit_group(id, url, course_id, group_id) {
- var group_name = $('#' + id).val();
+ else
+ {
+ alert(data.message);
+ }
+ }
+ );
+}
+//修改分班:修改分班时得考虑什么都不改但是点击确定的情况
+function edit_group(id,url,course_id,group_id)
+{
+ var group_name = $('#'+id).val();
$.get(
- url, {
+ url,
+ {
valid: "name",
value: group_name,
course_id: course_id,
group_id: group_id
},
- function(data) {
+ function (data) {
if (data.valid) {
- $("#update_group_" + group_id).submit();
- } else {
+ $("#update_group_"+group_id).submit();
+ }
+ else
+ {
alert(data.message);
}
}
);
}
-function hidden_homework_score_form() {
- hideModal($("#user_score"));
+function hidden_homework_score_form()
+{
+ hideModal($("#user_score"));
+}
+///////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////新建课程相关
+//验证课程名称
+function regex_course_name()
+{
+ var name = $.trim($("#course_name").val());
+ if(name.length == 0)
+ {
+ $("#course_name_notice").show();
+ return false;
}
- ///////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////新建课程相关
- //验证课程名称
-
-function regex_course_name() {
- var name = $.trim($("#course_name").val());
- if (name.length == 0) {
- $("#course_name_notice").show();
- return false;
- } else {
- $("#course_name_notice").hide();
+ else
+ {
+ $("#course_name_notice").hide();
+ return true;
+ }
+}
+//验证课程学时
+function regex_course_class_period()
+{
+ var class_period = $.trim($("#class_period").val());
+ var regex = /^\d*$/;
+ if(class_period.length == 0)
+ {
+ $("#course_class_period_notice").html("学时总数不能为空");
+ $("#course_class_period_notice").show();
+ return false;
+ }
+ else if (regex.test(class_period)) {
+ if(parseInt(class_period) > 0)
+ {
+ $("#course_class_period_notice").html("");
+ $("#course_class_period_notice").hide();
return true;
}
- }
- //验证课程学时
-
-function regex_course_class_period() {
- var class_period = $.trim($("#class_period").val());
- var regex = /^\d*$/;
- if (class_period.length == 0) {
- $("#course_class_period_notice").html("学时总数不能为空");
- $("#course_class_period_notice").show();
- return false;
- } else if (regex.test(class_period)) {
- if (parseInt(class_period) > 0) {
- $("#course_class_period_notice").html("");
- $("#course_class_period_notice").hide();
- return true;
- } else {
- $("#course_class_period_notice").html("学时总数必须大于0");
- $("#course_class_period_notice").show();
- return false;
- }
- } else {
- $("#course_class_period_notice").html("学时总数必须为数字");
+ else
+ {
+ $("#course_class_period_notice").html("学时总数必须大于0");
$("#course_class_period_notice").show();
return false;
}
}
- //验证密码
-
-function regex_course_password() {
- var class_period = $.trim($("#course_course_password").val());
- var regex = /^\w+$/;
- if (class_period.length == 0) {
- $("#course_course_password_notice").html("课程密码不能为空");
- $("#course_course_password_notice").show();
- return false;
- } else if (regex.test(class_period)) {
- $("#course_course_password_notice").html("");
- $("#course_course_password_notice").hide();
- return true;
- } else {
- $("#course_course_password_notice").html("课程密码有非法字符");
- $("#course_course_password_notice").show();
- return false;
- }
+ else
+ {
+ $("#course_class_period_notice").html("学时总数必须为数字");
+ $("#course_class_period_notice").show();
+ return false;
}
- //提交新建课程
-
-function submit_new_course() {
- if (regex_course_name() && regex_course_class_period() && regex_course_password()) {
+}
+//验证密码
+function regex_course_password()
+{
+ var class_period = $.trim($("#course_course_password").val());
+ var regex = /^\w+$/;
+ if(class_period.length == 0)
+ {
+ $("#course_course_password_notice").html("课程密码不能为空");
+ $("#course_course_password_notice").show();
+ return false;
+ }
+ else if (regex.test(class_period)) {
+ $("#course_course_password_notice").html("");
+ $("#course_course_password_notice").hide();
+ return true;
+ }
+ else
+ {
+ $("#course_course_password_notice").html("课程密码有非法字符");
+ $("#course_course_password_notice").show();
+ return false;
+ }
+}
+//提交新建课程
+function submit_new_course()
+{
+ if(regex_course_name()&®ex_course_class_period()&®ex_course_password())
+ {
$("#new_course").submit();
}
}
-function submit_edit_course(id) {
- if (regex_course_name() && regex_course_class_period() && regex_course_password()) {
- $("#edit_course_" + id).submit();
+function submit_edit_course(id)
+{
+ if(regex_course_name()&®ex_course_class_period()&®ex_course_password())
+ {
+ $("#edit_course_"+id).submit();
}
}
///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////课程讨论区
function regexSubject(id) {
- var subjectid = "#message_subject" + id;
+ var subjectid = "#message_subject" + id ;
var content = $.trim($(subjectid).val());
var message = "#subject_span" + id;
if (content.length == 0) {
$(message).text("主题不能为空");
$(message).css('color', '#ff0000');
- return false;
- } else {
+ return false;
+ }
+ else {
$(message).text("填写正确");
$(message).css('color', '#008000');
return true;
}
return false;
}
-
function regexContent(id) {
var contentid = "#message_content" + id;
- var message = "#message_content_span" + id;
+ var message = "#message_content_span"+ id;
var content = $.trim($(contentid).val());
if (content.length == 0) {
$(message).text("描述不能为空");
$(message).css('color', '#ff0000');
- return false;
- } else {
+ return false;
+ }
+ else {
$(message).text("填写正确");
$(message).css('color', '#008000');
return true;
@@ -171,242 +195,318 @@ function submitProjectsBoard(id) {
///////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////// 课程通知
-function regexTitle() {
+function regexTitle()
+{
var name = $("#news_title").val();
- if (name.length == 0) {
+ if(name.length ==0)
+ {
$("#title_notice_span").text("标题不能为空");
- $("#title_notice_span").css('color', '#ff0000');
+ $("#title_notice_span").css('color','#ff0000');
$("#news_title").focus();
return false;
- } else if (name.length <= 60) {
+ }
+ else if(name.length <= 60)
+ {
$("#title_notice_span").text("填写正确");
- $("#title_notice_span").css('color', '#008000');
+ $("#title_notice_span").css('color','#008000');
return true;
- } else {
+ }
+ else
+ {
$("#title_notice_span").text("标题超过60个字符");
- $("#title_notice_span").css('color', '#ff0000');
+ $("#title_notice_span").css('color','#ff0000');
$("#news_title").focus();
return false;
}
}
-function regexDescription() {
+function regexDescription()
+{
var name = news_description_editor.html();
- if (name.length == 0) {
+ if(name.length ==0)
+ {
$("#description_notice_span").text("描述不能为空");
- $("#description_notice_span").css('color', '#ff0000');
+ $("#description_notice_span").css('color','#ff0000');
$("#description_notice_span").focus();
return false;
- } else if (name.length >= 6000) {
+ }
+ else if(name.length >=6000){
$("#description_notice_span").text("描述最多3000个汉字(或6000个英文字符)");
- $("#description_notice_span").css('color', '#ff0000');
+ $("#description_notice_span").css('color','#ff0000');
$("#description_notice_span").focus();
return false;
- } else {
+ }
+ else
+ {
$("#description_notice_span").text("填写正确");
- $("#description_notice_span").css('color', '#008000');
+ $("#description_notice_span").css('color','#008000');
return true;
}
}
-function submitNews() {
- if (regexTitle() && regexDescription()) {
+function submitNews()
+{
+ if(regexTitle() && regexDescription())
+ {
news_description_editor.sync();
$("#news-form").submit();
}
}
-function submitFocus(obj) {
+function submitFocus(obj)
+{
$(obj).focus();
}
-function submitComment() {
+function submitComment()
+{
comment_editor.sync();
$("#add_comment_form").submit();
}
/////////////////////////////////////////////////课程讨论区
-function course_board_submit_message_replay() {
- if (MessageReplayVevify()) {
- message_content_editor.sync(); //提交内容之前要sync,不然服务器端取不到值
+function course_board_submit_message_replay()
+{
+ if(MessageReplayVevify())
+ {
+ message_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值
$("#message_form").submit();
}
}
-function course_board_canel_message_replay() {
+function course_board_canel_message_replay()
+{
$("#reply").hide(200);
$("#message_quote").html("");
}
function MessageReplayVevify() {
- var content = message_content_editor.html(); //$.trim($("#message_content").val());
- if (content.length == 0) {
- $("#message_content_span").text("回复不能为空");
- $("#message_content_span").css('color', '#ff0000');
- return false;
- } else {
- $("#message_content_span").text("填写正确");
- $("#message_content_span").css('color', '#008000');
- return true;
- }
+ var content = message_content_editor.html();//$.trim($("#message_content").val());
+ if (content.length == 0) {
+ $("#message_content_span").text("回复不能为空");
+ $("#message_content_span").css('color', '#ff0000');
+ return false;
}
- //////////////////////////////////////////////////
+ else {
+ $("#message_content_span").text("填写正确");
+ $("#message_content_span").css('color', '#008000');
+ return true;
+ }
+}
+//////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
//验证搜索时输入名字
-function regexName(content) {
- var name = $.trim($("#name").val());
- if (name.length == 0) {
- $("#project_name_span").text(content);
- $("#project_name_span").css('color', '#ff0000');
- $("#project_name_span").focus();
- return false;
- } else {
- $("#project_name_span").text("");
- return true;
- }
+function regexName(content)
+{
+ var name = $.trim($("#name").val());
+ if(name.length == 0)
+ {
+ $("#project_name_span").text(content);
+ $("#project_name_span").css('color','#ff0000');
+ $("#project_name_span").focus();
+ return false;
}
- //提交搜索
-
-function submitSerch(content) {
- if (regexName(content)) {
- $("#course_search_form").submit();
+ else
+ {
+ $("#project_name_span").text("");
+ return true;
}
}
+//提交搜索
+function submitSerch(content)
+{
+ if(regexName(content)){$("#course_search_form").submit();}
+}
//验证搜索时输入名字
-function regexQ(content) {
- var name = $.trim($("#q").val());
- if (name.length == 0) {
- $("#course_member_name_span").text(content);
- $("#course_member_name_span").css('color', '#ff0000');
- $("#course_member_name_span").focus();
- return false;
- } else {
- $("#course_member_name_span").text("");
- return true;
- }
+function regexQ(content)
+{
+ var name = $.trim($("#q").val());
+ if(name.length == 0)
+ {
+ $("#course_member_name_span").text(content);
+ $("#course_member_name_span").css('color','#ff0000');
+ $("#course_member_name_span").focus();
+ return false;
}
- //提交课程成员搜索
-
-function submitMemberSerch(content) {
+ else
+ {
+ $("#course_member_name_span").text("");
+ return true;
+ }
+}
+//提交课程成员搜索
+function submitMemberSerch(content)
+{
//if(regexQ(content)){$("#course_member_search_form").submit();}
$("#course_member_search_form").submit();
}
//课程描述显示更多信息
-function show_more_msg() {
- $("#course_description").toggleClass("course_description_none");
- }
- //作业描述显示更多信息
-
-function news_show_more_des(id) {
- $('#news_description_' + id).toggleClass("news_description_none");
+function show_more_msg()
+{
+ $("#course_description").toggleClass("course_description_none");
}
-
-function bid_show_more_des(id) {
+//作业描述显示更多信息
+function news_show_more_des(id)
+{
+ $('#news_description_' + id).toggleClass("news_description_none");
+}
+function bid_show_more_des(id)
+{
$("#bid_description_" + id).toggleClass("news_description_none");
}
//课程作业结束时间倒计时
-function show_bid_dead_line(year, month, day, divname) {
- var now = new Date();
- var endDate = new Date(year, month - 1, day);
- var leftTime = endDate.getTime() - now.getTime();
- var leftsecond = parseInt(leftTime / 1000);
- var day1 = Math.floor(leftsecond / (60 * 60 * 24));
- var hour = Math.floor((leftsecond - day1 * 24 * 60 * 60) / 3600);
- var minute = Math.floor((leftsecond - day1 * 24 * 60 * 60 - hour * 3600) / 60);
- var second = Math.floor(leftsecond - day1 * 24 * 60 * 60 - hour * 3600 - minute * 60);
- $("#" + divname).html("" + "作品提交还剩:
");
- }
- //验证新建作业的名字
-
-function regex_bid_name() {
- var name = $.trim($("#bid_name").val());
-
- if (name == "") {
- $("#bid_name_span").text("名称不能为空");
+function show_bid_dead_line(year,month,day,divname)
+{
+ var now = new Date();
+ var endDate = new Date(year, month-1, day);
+ var leftTime=endDate.getTime()-now.getTime();
+ var leftsecond = parseInt(leftTime/1000);
+ var day1=Math.floor(leftsecond/(60*60*24));
+ var hour=Math.floor((leftsecond-day1*24*60*60)/3600);
+ var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60);
+ var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60);
+ $("#"+divname).html(""
+ + "作品提交还剩:
");
+}
+//验证新建作业的名字
+function regex_homework_name()
+{
+ var name = $.trim($("#homework_name").val());
+
+ if(name=="")
+ {
+ $("#homework_name_span").text("名称不能为空");
return false;
- } else {
- $("#bid_name_span").text("");
+ }
+ else
+ {
+ $("#homework_name_span").text("");
return true;
}
}
//验证匿评数量
-function regex_evaluation_num() {
- var evaluation_num = $.trim($("#bid_evaluation_num").val());
+function regex_evaluation_num()
+{
+ var evaluation_num = $.trim($("#evaluation_num").val());
var regex = /^\d+$/;
- if ($("#bid_open_anonymous_evaluation").attr("checked") == "checked") {
- if (evaluation_num == "") {
- $("#bid_evaluation_num_span").text("匿评分配数量不能为空");
- return false;
- } else if (regex.test(evaluation_num)) {
- if (evaluation_num > 0) {
- $("#bid_evaluation_num_span").text("");
- return true;
- } else {
- $("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
- return false;
- }
- } else {
- $("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
+ if(evaluation_num=="")
+ {
+ $("#evaluation_num_notice").html("匿评分配数量不能为空");
+ $("#evaluation_num_notice").removeClass("c_red").addClass("c_red");
+ return false;
+ }
+ else if(regex.test(evaluation_num))
+ {
+ if(evaluation_num > 0)
+ {
+ $("#evaluation_num_notice").html("每个学生将收到 "+ parseInt(evaluation_num) + " 份待匿评作品");
+ $("#evaluation_num_notice").removeClass("c_red");
+ return true;
+ }
+ else
+ {
+ $("#evaluation_num_notice").html("匿评分配数量必须为大于0");
+ $("#evaluation_num_notice").removeClass("c_red").addClass("c_red");
return false;
}
- } else {
- return true;
+ }
+ else
+ {
+ $("#evaluation_num_notice").html("匿评分配数量只能为数字");
+ $("#evaluation_num_notice").removeClass("c_red").addClass("c_red");
+ return false;
}
}
//点击是否开启匿评单选框效果
-$(function() {
- $("#bid_open_anonymous_evaluation").click(function() {
- if ($("#bid_open_anonymous_evaluation").attr("checked") == "checked") {
- $("#bid_evaluation_num_li").slideDown();
- } else {
- $("#bid_evaluation_num_li").slideUp();
+$(function(){
+ $("#homework_common_homework_type").click(function(){
+ if($("#homework_common_homework_type").attr("checked") == "checked")
+ {
+ $("#evaluation_setting").slideDown();
+ $("#ta_proportion").removeAttr("disabled");
}
+ else
+ {
+ $("#evaluation_setting").slideUp();
+ $("#ta_proportion").attr("disabled","disabled");
+ }
+ });
+
+ $("#absence_penalty").change(function(){
+ $("#absence_penalty_notice").html(" "+ $("#absence_penalty").val() +" ");
+ });
+
+ $("#ta_proportion").change(function(){
+ var ta_proportion = $("#ta_proportion").val();
+ $("#student_proportion").val((100 - parseInt(ta_proportion * 100)) + "%");
});
});
+//第一次加载时,如果未开启匿评作业,隐藏显示匿评配置信息
+$(function(){
+ if($("#homework_common_homework_type").attr("checked") == "checked")
+ {
+ $("#evaluation_setting").show();
+ $("#ta_proportion").removeAttr("disabled");
+ }
+ else
+ {
+ $("#evaluation_setting").hide();
+ $("#ta_proportion").attr("disabled","disabled");
+ }
+});
-//老师提交新建作业
-function submit_new_bid(id) {
- if (regex_bid_name() && regex_evaluation_num()) {
- bid_description_editor.sync();
- $("#" + id).submit();
+//老师提交 新建/修改 作业
+function submit_homework(id)
+{
+ if(regex_homework_name()&®ex_evaluation_num())
+ {
+ homework_description_editor.sync();
+ $("#"+id).submit();
}
}
-function show_window(id1, id2, top, left) {
- $('#' + id1).css('top', top);
- $('#' + id1).css('left', left);
- $('#' + id1).css('display', 'block');
- $('#' + id2).css('display', 'block');
+function show_window (id1,id2,top,left) {
+ $('#'+ id1).css('top',top);
+ $('#'+ id1).css('left',left);
+ $('#'+ id1).css('display','block');
+ $('#' + id2).css('display','block');
}
-function close_window(id1, id2) {
- $('#' + id1).css('display', 'none');
- $('#' + id2).css('display', 'none');
+function close_window(id1,id2){
+ $('#' + id1).css('display','none');
+ $('#' + id2).css('display','none');
}
//隐藏提示狂
-function hidden_atert_form(cur_page, cur_type) {
+function hidden_atert_form(cur_page,cur_type)
+{
hideModal($("#popbox"));
}
//当课程描述长度小于112px时,不显示更多按钮
-$(function() {
- if ($("#course_description_content").height() > 112) {
+$(function(){
+ if($("#course_description_content").height()>112)
+ {
$("#lg-foot").show();
}
});
//将右侧的最小高度设置成左侧高度,美化界面
// firefox pre标签换行
-$(document).ready(function() {
- $("#RSide").css("min-height", $("#LSide").height() - 30);
+$(document).ready(function () {
+ $("#RSide").css("min-height",$("#LSide").height()-30);
var userAgent = navigator.userAgent.toLowerCase();
var browser = {
version: (userAgent.match(/.+(?:rv|it|ra|ie)[/: ]([d.]+)/) || [])[1],
@@ -415,55 +515,39 @@ $(document).ready(function() {
msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
};
- if (browser.mozilla || browser.opera) {
+ if (browser.mozilla || browser.opera){
$("pre").addClass("break_word_firefox");
- } else {
+ }
+ else{
$("pre").addClass("break_word");
}
});
// 日历选择日期后关闭
-function regexDeadLine() {
+function regexDeadLine()
+{
('#ui-datepicker-div').hide;
}
//新建、修改课程明码显示
-$(function() {
+$(function(){
$("#psw_btn").click(function() {
- alert("密码: " + $("#course_course_password").val());
- });
-});
-
-//课程通知更多按钮显示
-$(function() {
- $('.news_description').each(function() {
- if ($(this).height() >= 38) {
- $('#news_foot_' + $(this).attr('id').replace('news_description_', '')).css("display", "block");
- }
- });
-
- $(".news_description img").one('load', function() {
- var node = $(this).parents('.news_description');
- if (node && node.height() >= 38) {
- $('#news_foot_' + node.attr('id').replace('news_description_', '')).css("display", "block");
- }
- }).each(function() {
- if (this.complete) {
- $(this).load();
- }
+ alert("密码: "+$("#course_course_password").val());
});
});
//查找TAG资源
-function search_tag_attachment(url, tag_name, q, course_id, sort) {
+function search_tag_attachment(url,tag_name,q,course_id,sort)
+{
//alert("111");
$.get(
- url, {
+ url,
+ {
tag_name: tag_name,
q: q,
- course_id: course_id
+ course_id:course_id
},
- function(data) {
+ function (data) {
}
);
@@ -472,22 +556,27 @@ function search_tag_attachment(url, tag_name, q, course_id, sort) {
// 课程讨论区
function showhelpAndScrollToMessage(id, id1, count) {
$('#' + id).toggle();
- if (cookieget("repositories_visiable") == "true") {
- cookiesave("repositories_visiable", false, '', '', '');
- } else {
- cookiesave("repositories_visiable", true, '', '', '');
+ if(cookieget("repositories_visiable") == "true")
+ {
+ cookiesave("repositories_visiable", false,'','','');
+ }
+ else
+ {
+ cookiesave("repositories_visiable", true,'','','');
}
var information = $(id1);
var val = information.attr("value");
- if (val == "show_help") {
- $(id1).text("收起回复(" + count + ")");
+ if(val=="show_help")
+ {
+ $(id1).text("收起回复(" + count + ")" );
information.attr("value", "hide_help");
- } else {
+ }
+ else
+ {
$(id1).text("展开回复(" + count + ")");
information.attr("value", "show_help");
}
}
-
function show_more_reply(contentid, id2, id3) {
$(contentid).toggleClass("course_description_none");
var information = $(id2);
@@ -497,9 +586,214 @@ function show_more_reply(contentid, id2, id3) {
$(id2).text("[收起]");
information.attr("value", "hide_more");
arrow.attr("src", "/images/jiantouup.jpg")
- } else {
+ }
+ else {
$(id2).text("[展开]");
information.attr("value", "show_more");
arrow.attr("src", "/images/jiantou.jpg")
}
}
+
+///////////////////////////////////////////////
+//学生作品
+function show_project()
+{
+ $("#about_project").slideToggle();
+}
+
+//验证作品名称
+function regexStudentWorkName()
+{
+ var name = $.trim($("#student_work_name").val());
+
+ if(name=="")
+ {
+ $("#student_work_name_span").text("作品名称不能为空");
+ return false;
+ }
+ else
+ {
+ $("#student_work_name_span").text("");
+ return true;
+ }
+}
+
+function regexStudentWorkDescription()
+{
+ var name = $.trim($("#student_work_description").val());
+
+ if(name=="")
+ {
+ $("#student_work_description_textarea").text("作品描述不能为空");
+ return false;
+ }
+ else
+ {
+ $("#student_work_description_textarea").text("");
+ return true;
+ }
+}
+
+//提交新建作品
+function new_student_work()
+{
+ if(regexStudentWorkName()&®exStudentWorkDescription())
+ {$("#new_student_work").submit();}
+}
+
+function edit_student_work(id)
+{
+ if(regexStudentWorkName()&®exStudentWorkDescription())
+ {$("#edit_student_work_" + id).submit();}
+}
+
+//滑动打分
+$.fn.peSlider = function(settings){
+ //configurable options (none so far)
+ var o = $.extend({},settings);
+ if( !$('body').is('[role]') ){ $('body').attr('role','application'); }
+ return $(this).each(function(){
+ var thisLabel = $('label[for=' + $(this).attr('id') + ']').attr('id', $(this).attr('id') + '-label').attr('id');
+ var thisUnits = $(this).attr('data-units') || '';
+ var slider = $('
');
+ if( $(this).is('input') ){
+ var input = $(this);
+ var thisUnits = input.attr('data-units');
+ var friendlyVal = input.val() + ' ' + thisUnits;
+ var sliderOptions = $.extend(o,{
+ min: parseFloat(input.attr('min')),
+ max: parseFloat(input.attr('max')),
+ value: parseFloat(input.val())
+ });
+ slider
+ .insertBefore(input)
+ .slider(sliderOptions)
+ .bind('slide', function(e, ui){
+ input.val(ui.value);
+ friendlyVal = input.val() + ' ' + thisUnits;
+ slider.find('a').attr({
+ 'aria-valuenow': ui.value,
+ 'aria-valuetext': friendlyVal
+ });
+ })
+ .find('a')
+ .attr({
+ 'role': 'slider',
+ 'aria-valuemin': input.attr('min'),
+ 'aria-valuemax': input.attr('max'),
+ 'aria-valuenow': input.val(),
+ 'aria-valuetext': friendlyVal,
+ 'aria-labelledby': thisLabel
+ });
+ input
+ .keyup(function(){
+ var inVal = parseFloat(input.val());
+ if( !isNaN(inVal) ){
+ slider.slider('value', inVal);
+ input.val(slider.slider('value'));
+ }
+ })
+ .change(function(){
+ var inVal = parseFloat(input.val());
+ if( !isNaN(inVal) ){
+ slider.slider('value', inVal);
+ input.val(slider.slider('value'));
+ }
+ })
+ .blur(function(){
+ var inVal = parseFloat(input.val());
+ if( isNaN(inVal) ){
+ input.val(0);
+ }
+ });
+ if( !settings.step ){
+ var step = Math.round( parseFloat(input.attr('max')) / slider.width());
+ if(step > 1){ slider.slider('option','step',step); }
+ }
+ }
+ });
+};
+
+//返回顶部
+$(function(){goTopEx();});
+
+var Sys = {};
+var ua = navigator.userAgent.toLowerCase();
+var s;
+(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
+ (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
+ (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
+ (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
+ (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
+
+function goTopEx() {
+ var obj = document.getElementById("goTopBtn");
+ if(obj != null)
+ {
+ var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
+ function getScrollTop() {
+ var xsun = document.documentElement.scrollTop;
+ if (Sys.chrome) {
+ xsun=document.body.scrollTop;
+ }
+ return xsun;
+ }
+ function setScrollTop(value) {
+ if (Sys.chrome) {
+ document.body.scrollTop = value;
+ }
+ else {
+ document.documentElement.scrollTop = value;
+ }
+ }
+ window.onscroll = function () { getScrollTop() > 0 ? obj.style.display = "" : obj.style.display = "none"; };
+ obj.onclick = function () {
+ var goTop = setInterval(scrollMove, 10);
+ function scrollMove() {
+ setScrollTop(getScrollTop() / 1.1);
+ if (getScrollTop() < 1) clearInterval(goTop);
+ }
+ }
+ }
+}
+
+//匿评评分提示
+$(function(){
+ $(".student_score_info").bind("mouseover",function(e){
+ //alert($(this).html());
+ $(this).find("div").show();
+ $(this).find("div").css("top",e.pageY);
+ $(this).find("div").css("left",e.pageX);
+ });
+ $(".student_score_info").bind("mouseout",function(e){
+ //alert($(this).html());
+ $(this).find("div").hide();
+ });
+});
+
+//匿评弹框取消按钮
+function clickCanel(){hideModal("#popbox02");}
+//匿评弹框确定按钮
+function clickOK(path)
+{
+ clickCanel();
+ $.ajax({
+ type: "GET",
+ url: path,
+ data: 'text',
+ success: function (data) {
+ }
+ });
+}
+//查询
+function SearchByName(obj,url,event)
+{
+ var keycode = (event.keyCode ? event.keyCode : event.which);
+ if(keycode == '13'){
+ location.href = url + "&name=" + obj.val();
+ }
+}
+
+$(function(){
+ $("#about_project label").eq(1).remove();
+});
\ No newline at end of file
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 5c586b757..67d67d69b 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -2794,4 +2794,4 @@ div.repos_explain{
padding-bottom: 20px;
}
.upload_img img{max-width: 100%;}
-#activity .upload_img img{width: 580px;}
+#activity .upload_img img{max-width: 580px;}
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index d27895b03..85db8361d 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -127,14 +127,14 @@ a.re_de{ color:#6883b6; margin-left:15px;}
/* 作业列表 */
.ttl{ }
-.ctt{height:820px;clear:both; }
+.ctt{clear:both; }
#contentbox{float:right;clear:both;width:670px;/*滑动门的宽度*/}
/* TAB 切换效果 */
.tb_{ background-color: #eaeaea; height:40px; }
.tb_ ul{height:40px; }
.tb_ li{float:left;height:34px;width: 90px;cursor:pointer; font-size:14px; padding-top:6px; text-align:center; }
-a.tb_all{ margin-left:212px; font-size:12px; display:block; height:23px; padding-top:4px; width:90px; color:#7a7a7a; border:1px solid #cbcbcb; background:#fff; text-align: center;}
-a:hover.tb_all{ background:#eaeaea; text-decoration:none;}
+a.tb_all{ float:right; font-size:12px; display:block; height:18px; padding-top:2px; width:90px; color:#ff5d31; border:1px solid #ff5d31; background:#fff; text-align: center;}
+a:hover.tb_all{ background:#ff5d31; color:#fff; text-decoration:none;}
.work_tb_{ background-color: #eaeaea; height:40px; }
a.work_edit{color: #64bdd9; display:block; padding:1px 5px; border:1px solid #64bdd9;}
@@ -288,6 +288,18 @@ a:hover.member_btn{ background:#329cbd;}
.ni_con p{ color:#808181;}
.ni_con a:hover{ text-decoration:none;}
a.xls{ margin-left:5px; color:#136b3b;}
+
+/* 开启匿评弹框 */
+.anonymos{width:480px;height:180px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
+.ni_con { width:425px; margin:25px 30px;}
+.ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;}
+.ni_con p{ color:#808181; }
+.ni_con a:hover{ text-decoration:none;}
+.ni_btn{ width:190px; margin:15px auto; line-height:1.9;}
+a.tijiao{ height:28px; display:block; width:80px; color:#fff; background:#15bccf; text-align:center; padding-top:4px; float:left; margin-right:15px;}
+a:hover.tijiao{ background:#0f99a9;}
+.c_pink{ color:#e65d5e;}
+
/* 学生列表*/
.st_list{ width:670px;}
.st_search{ }
@@ -343,7 +355,6 @@ a:hover.st_add{ color:#ff8e15;}
.upload_box{ width:430px; margin:15px auto;}
a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
-.r_txt_tit{width:500px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#09658c; font-size:14px;}
blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;word-break: break-all;word-wrap: break-word;}
.respond-form{display: none;margin: auto;clear: both;}
@@ -354,7 +365,7 @@ blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;word-break: br
#attachments_fields input.description {margin-left: 4px;width: 100px;}
#attachments_fields span.ispublic-label {display: inline-block;width: 30px;margin-left: 10px;}
a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;}
-#attachments_fields input.filename {border: 0;height: 1.8em;width: 150px;color: #555;background-color: inherit;background: url(../images/attachment.png) no-repeat 1px 50%;padding-left: 18px;padding-top: 2px;}
+#attachments_fields input.filename {border: 0;height: 1.8em;width: 150px;color: #555;background-color: inherit;background: url(../images/attachment.png) no-repeat 1px 50%;padding-left: 18px;padding-top: 2px; white-space: nowrap; text-overflow:ellipsis;}
span.add_attachment {font-size: 80%;line-height: 2.5em;}
#attachments_fields span {display: block;white-space: nowrap;}
.file_selector{position: relative;opacity: 0;filter: alpha(opacity:0);}
@@ -392,7 +403,7 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;}
.ui-progressbar-value{margin:-1px;height:100%}
.ui-widget-header{border:1px solid #628db6;background:#759fcf url(jquery/images/ui-bg_gloss-wave_35_759fcf_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:bold}
.ui-corner-left,.ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px}
-.link_file{ background:url(../images/pic_file.png) 0 7px no-repeat !important; padding-left:20px !important; color:#64bdd9 !important; }
+.link_file{ background:url(../images/pic_file.png) 0 3px no-repeat !important; padding-left:20px !important; color:#64bdd9 !important; }
a:hover.link_file_board{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
a.link_file_board{ background:url(../images/pic_file.png) 0 3px no-repeat !important; padding-left:20px !important; color:#64bdd9 !important; }
@@ -491,10 +502,7 @@ blockquote {
}
a.member_search_edit {width: 43px;background: #15bccf;color: #fff;text-align: center;text-decoration: none;padding: 2px;}
.min_search_edit {width: 150px;height: 20px;border: 1px solid #d0d0d0 !important;color: #666;}
-
-a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; color:#64bdd9; }
-a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
-.r_txt_tit{width:510px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#09658c; font-size:14px;}
+.r_txt_tit{max-width:450px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#09658c; font-size:14px;}
/*日历选择图*/
img.ui-datepicker-trigger {
@@ -549,6 +557,20 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px
a.files_tag_icon{ background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px; }
a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #64bdd9; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;}
+/* 20150423作业评分*/
+.ml14{ margin-left:14px;}
+.w548{ width:552px;}
+.w547{ width:544px;}
+.w196{ width:182px;}
+.w459{ width:459px;}
+.hwork_new_set{border:1px dashed #CCC; background:#f5f5f5; text-align:center; padding:10px 0; margin-bottom:10px;}
+.hwork_new_grey{background:#dbdbdb; width:610px; padding:10px 20px; margin:0 auto; text-align:left; margin-bottom:5px;}
+.hwork_new_left{ width:220px; float:left; }
+.hwork_new_right{ width:350px; float:left; margin-left:40px;}
+.w305{ width:305px;}
+.icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;}
+a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;}
+
/* 20150505讨论区*/
.w664{ width:664px;}
.w140{ width:140px;}
@@ -562,7 +584,7 @@ a.talkmain_name{ color:#ff5722;}
a:hover.talkmain_name{ color:#d33503;}
.talkmain_tit{ color:#0781b4; width:450px; display:block; }
.talklist_main{ }
-.talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/arrow.png) 0 0 no-repeat; height:7px; width:13px;}
+/*.talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/arrow.png) 0 0 no-repeat; height:7px; width:13px;}*/
.talkConIpt{ background:#f2f2f2; }
.talkWrapBox{ width:610px; margin-left:60px; }
.inputFeint{ border:1px solid #d9d9d9; background:#fff; width:583px; height:50px; margin:10px; margin-bottom:5px;color:#666;}
@@ -583,12 +605,72 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
/*.talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;}*/
#about_newtalk{ display:none;}
-
-
-
-
-
-
+.ml14{ margin-left:14px;}
+.w548{ width:552px;}
+.w547{ width:544px;}
+.w196{ width:196px;}
+.w459{ width:459px;}
+.hwork_new_set{border:1px dashed #CCC; background:#f5f5f5; text-align:center; padding:10px 0; margin-bottom:10px;}
+.hwork_new_grey{background:#dbdbdb; width:610px; padding:10px 20px; margin:0 auto; text-align:left; margin-bottom:5px;}
+.hwork_new_left{ width:220px; float:left; }
+.hwork_new_right{ width:350px; float:left; margin-left:40px;}
+.w305{ width:305px;}
+.icon_add{background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;}
+a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;}
+
+/* 20150506上传头像*/
+.uppicBox{ width:265px; height:265px; background:#f2f2f5; float:left; color:#666; text-align:center;}
+.showpicBox{width:133px; height:250px; background:#f2f2f5; float:left; margin-left:20px; text-align:center; padding-top:15px; color:#666;}
+.mr2{ margin-right:2px;}
+.uppic_btn{border:none; width:150px; background:none; margin-bottom:5px; color:#666; margin-top:105px;}
+
+/* 20150512作品展示*/
+.hwork_ul{ height:24px; padding-top:10px;}
+.hwork_ul li{ float:left;}
+.w300{ width:300px;}
+.w80{ width:80px;}
+.t_c{ text-align:center;}
+.hwork_tit{ width:240px; float:left; }
+.hwork_tit a{ width:255px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
+.hwork_tit_e{ width:440px; float:left; }
+.hwork_tit_e a{ width:455px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
+.hwork_code{ width:60px; text-align:center; margin-right:15px;}
+.hwork_code02{ width:60px; text-align:center; margin-right:10px;}
+a.hwork_center{ display:block; width:60px; margin-right:5px;overflow: hidden; white-space: nowrap; text-overflow:ellipsis;}
+a.hwork_name{ display:block;width:65px; margin-right:10px;overflow: hidden;white-space: nowrap; text-overflow:ellipsis;min-height: 1px;}
+.show_hwork{ border:2px solid #64bdd9; width:646px; padding:10px; color:#666666; padding-bottom:0px; }
+.show_hwork ul li{ margin-bottom:5px;}
+.show_hwork_arrow{ position:relative; top:2px; left:25px;background:url(../images/course/arrow_up.jpg) 0 0 no-repeat; width:20px; height:11px;}
+.tit_fb{ font-weight:bold; width:66px; text-align:right; display:block; float:left;}
+.ml160{ margin-left:160px;}
+.show_hwork_p{ width:580px; float:left;}
+.hwork_ping_text{ float:left; border:1px solid #e4e4e4; padding:5px; width:568px; height:50px;}
+.ping_box{ width:626px; padding:10px; background:#f5f3f3; }
+a.ping_pic{ display:block; width:34px; height:34px; padding:2px; border:1px solid #e3e3e3;}
+a:hover.ping_pic{border:1px solid #64bdd9;}
+.ping_box_tit{ float:left; width:575px; margin-left:10px;}
+.ping_box_ul{}
+.ping_line{ border-bottom:1px dashed #CCCCCC; padding-bottom:8px; margin-bottom:8px;}
+.ping_text{border:1px solid #CCCCCC; margin:5px; padding:5px; width:560px; height:50px; }
+.ping_back_tit{ float:left; width:523px; margin-left:10px; }
+a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; text-align:center; display:block;}
+a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;}
+.fr{ float:right;}
+.min_search{ width:200px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 185px -193px no-repeat; cursor:pointer;}
+.li_min_search{ float:right; margin-right:-10px;}
+.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;}
+/*返回顶部*/
+.to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;}
+
+/* 评分插件 */
+input#score{ width:40px;}
+.ui-slider{position:relative;width:200px;float:left;margin-right:10px;height:14px; margin-top:2px;background:#e2e2e2; }
+.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:0.5em;height:1.6em;top:-.2em;margin-left:-.5em;cursor:pointer;background:#64bdd9;}
+.ui-slider .ui-slider-handle:hover,.ui-slider .ui-slider-handle:focus{background:#64bdd9;}
+.ui-slider .ui-slider-handle:active{background-image:none;}
+.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;top:0;height:100%;background:#64bdd9;left:0;}
+
+.filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px;}
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index c8d18609f..d6e6907fa 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -6,6 +6,8 @@ table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{color:#7f7f7f;text-decoration:none;}
a:hover,a:active{color:#000;}
+a:hover {text-decoration: none; }
+textarea {resize: none;}
/*常用*/
select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; }
@@ -34,6 +36,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.fmYh{font-family:"MicroSoft Yahei";}
.font999{ color:#999;}
.fontRed{color:#770000;}
+.text_c{ text-align:center;}
/* Float & Clear */
.cl{ clear:both; overflow:hidden; }
@@ -77,6 +80,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mt5{ margin-top:5px;}
.mt8{ margin-top:8px;}
.mt10{ margin-top:10px;}
+.mt30{ margin-top: 30px;}
.mb5{ margin-bottom:5px;}
.mb10{ margin-bottom:10px;}
.mb20{ margin-bottom:20px;}
@@ -134,6 +138,7 @@ a.c_green{ color:#28be6c;}
.b_grey{ background: #F5F5F5;}
.b_dgrey{ background: #CCC;}
.c_orange{color:#e8770d;}
+.c_dark{ color:#2d2d2d;}
.c_lorange{ color:#ff9900;}
.c_purple{color: #6883b6;}
.c_blue{ color:#15bccf;}
@@ -154,7 +159,7 @@ a.green_btn{background:#28be6c;color:#fff;font-size:14px; font-weight:normal; pa
a:hover.green_btn{ background:#14ad5a;}
.blue_btn{ background:#64bdd9; color:#fff; font-size:14px; font-weight:normal;padding:2px 10px; text-align:center;}
a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
-a:hover.blue_btn{ background:#329cbd;}
+a:hover.blue_btn{ background:#329cbd;cursor: pointer;}
a.orange_btn{ background:#ff5722;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center; }
a:hover.orange_btn{ background:#d63502;}
@@ -170,6 +175,9 @@ a:hover.bgreen_u_btn{background:#1abc9c; color:#fff;}
.blue_u_btn{border:1px solid #64bdd9; padding:2px 10px; color:#64bdd9;}
a.blue_u_btn{border:1px solid #64bdd9; padding:2px 10px; color:#64bdd9;}
a:hover.blue_u_btn{background:#64bdd9; color:#fff;}
+.blue_n_btn{ background:#64bdd9; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;}
+a.blue_n_btn{background:#64bdd9;color:#fff;font-weight:normal; padding:2px 10px; text-align:center;}
+a:hover.blue_n_btn{ background:#329cbd;}
.nolink_btn{ background:#BCBCBC; color: #fff; padding:2px 5px;}
.more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;}
@@ -186,6 +194,7 @@ a:hover.blue_u_btn{background:#64bdd9; color:#fff;}
.pic_mes{ display:block; background:url(../images/new_project/public_icon.png) 0px -376px no-repeat; width:20px; height:15px; padding-left:18px;}
.pic_img{ display:block; background:url(../images/new_project/public_icon.png) -31px -419px no-repeat; width:20px; height:15px; }
.pic_del{ display:block; background:url(../images/new_project/public_icon.png) 0px -235px no-repeat; width:20px; height:15px; }
+.pic_del:hover{ background:url(../images/new_project/public_icon.png) -32px -235px no-repeat; }
.pic_stats{display:block; background:url(../images/new_project/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;}
.pic_files{display:block; background:url(../images/new_project/public_icon.png) 0px -578px no-repeat; width:20px; height:15px;}
.pic_text{display:block; background:url(../images/new_project/public_icon.png) 0px -609px no-repeat; width:20px; height:18px;}