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