parent
86b9daf821
commit
6ac97f2c34
|
@ -30,7 +30,7 @@ class Project < ActiveRecord::Base
|
|||
|
||||
# Specific overidden Activities
|
||||
|
||||
belongs_to :homework_attach
|
||||
has_many :student_works
|
||||
has_many :time_entry_activities
|
||||
has_many :members, :include => [:principal, :roles], :conditions => "#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE}"
|
||||
has_many :memberships, :class_name => 'Member'
|
||||
|
|
|
@ -6,6 +6,7 @@ class StudentWork < ActiveRecord::Base
|
|||
belongs_to :user
|
||||
has_many :student_works_evaluation_distributions, :dependent => :destroy
|
||||
has_many :student_works_scores, :dependent => :destroy
|
||||
belongs_to :project
|
||||
|
||||
acts_as_attachable
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class CreateHomeworkCommons < ActiveRecord::Migration
|
||||
def change
|
||||
def up
|
||||
create_table :homework_commons do |t|
|
||||
t.string :name
|
||||
t.integer :user_id
|
||||
|
@ -13,4 +13,8 @@ class CreateHomeworkCommons < ActiveRecord::Migration
|
|||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :homework_commons
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class CreateHomeworkDetailManuals < ActiveRecord::Migration
|
||||
def change
|
||||
def up
|
||||
create_table :homework_detail_manuals do |t|
|
||||
t.float :ta_proportion
|
||||
t.integer :comment_status
|
||||
|
@ -12,4 +12,8 @@ class CreateHomeworkDetailManuals < ActiveRecord::Migration
|
|||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :homework_detail_manuals
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class CreateHomeworkDetailProgramings < ActiveRecord::Migration
|
||||
def change
|
||||
def up
|
||||
create_table :homework_detail_programings do |t|
|
||||
t.string :language
|
||||
t.text :standard_code, :limit => 4294967295
|
||||
|
@ -8,4 +8,8 @@ class CreateHomeworkDetailProgramings < ActiveRecord::Migration
|
|||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :homework_detail_programings
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class CreateHomeworkTests < ActiveRecord::Migration
|
||||
def change
|
||||
def up
|
||||
create_table :homework_tests do |t|
|
||||
t.text :input
|
||||
t.text :output
|
||||
|
@ -8,4 +8,8 @@ class CreateHomeworkTests < ActiveRecord::Migration
|
|||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :homework_tests
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class CreateStudentWorks < ActiveRecord::Migration
|
||||
def change
|
||||
def up
|
||||
create_table :student_works do |t|
|
||||
t.string :name
|
||||
t.text :description
|
||||
|
@ -9,8 +9,13 @@ class CreateStudentWorks < ActiveRecord::Migration
|
|||
t.float :teacher_score, default: 0
|
||||
t.float :student_score, default: 0
|
||||
t.float :teaching_asistant_score, default: 0
|
||||
t.integer :project_id, default: 0
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :student_works
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class CreateStudentWorksEvaluationDistributions < ActiveRecord::Migration
|
||||
def change
|
||||
def up
|
||||
create_table :student_works_evaluation_distributions do |t|
|
||||
t.integer :student_work_id
|
||||
t.integer :user_id
|
||||
|
@ -7,4 +7,8 @@ class CreateStudentWorksEvaluationDistributions < ActiveRecord::Migration
|
|||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :student_works_evaluation_distributions
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class CreateStudentWorksScores < ActiveRecord::Migration
|
||||
def change
|
||||
def up
|
||||
create_table :student_works_scores do |t|
|
||||
t.integer :student_work_id
|
||||
t.integer :user_id
|
||||
|
@ -9,4 +9,8 @@ class CreateStudentWorksScores < ActiveRecord::Migration
|
|||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :student_works_scores
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1207,6 +1207,7 @@ ActiveRecord::Schema.define(:version => 20150519030544) do
|
|||
t.float "teacher_score", :default => 0.0
|
||||
t.float "student_score", :default => 0.0
|
||||
t.float "teaching_asistant_score", :default => 0.0
|
||||
t.integer "project_id", :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue