diff --git a/app/views/exercise/_show_MC.html.erb b/app/views/exercise/_show_MC.html.erb
index b932eac1e..6f3081e5f 100644
--- a/app/views/exercise/_show_MC.html.erb
+++ b/app/views/exercise/_show_MC.html.erb
@@ -4,7 +4,7 @@
(<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>)
- <%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id),
+ <%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id, :quest_num => exercise_question.question_number),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
diff --git a/app/views/exercise/_show_MCQ.html.erb b/app/views/exercise/_show_MCQ.html.erb
index 2a91afab5..e4bdad3f1 100644
--- a/app/views/exercise/_show_MCQ.html.erb
+++ b/app/views/exercise/_show_MCQ.html.erb
@@ -3,7 +3,7 @@
<%= exercise_question.question_title %>
(<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>)
- <%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id),
+ <%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id, :quest_num => exercise_question.question_number),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
diff --git a/app/views/exercise/_show_single.html.erb b/app/views/exercise/_show_single.html.erb
index 5f36a931e..8223f98fd 100644
--- a/app/views/exercise/_show_single.html.erb
+++ b/app/views/exercise/_show_single.html.erb
@@ -2,8 +2,8 @@
第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)
<%= exercise_question.question_title %>
- <%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id),
- method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
+ <%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id, :quest_num => exercise_question.question_number),
+ method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
diff --git a/db/migrate/20151118031602_copy_course_activities_to_org_activities.rb b/db/migrate/20151118031602_copy_course_activities_to_org_activities.rb
index 08f952afa..2b5d6ba1e 100644
--- a/db/migrate/20151118031602_copy_course_activities_to_org_activities.rb
+++ b/db/migrate/20151118031602_copy_course_activities_to_org_activities.rb
@@ -1,25 +1,25 @@
class CopyCourseActivitiesToOrgActivities < ActiveRecord::Migration
def up
- count = CourseActivity.all.count/30 + 1
- for i in 1 ... count do
- transaction do
- CourseActivity.page(i).per(30).each do |course_act|
- if course_act.course_act_type == 'Message' && !course_act.course_act.parent_id.nil?
- org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{course_act.course_act.parent.id}").first
- org_activity.created_at = course_act.created_at
- org_activity.save
- else
- OrgActivity.create(:user_id => course_act.user_id,
- :org_act_id => course_act.course_act_id,
- :org_act_type => course_act.course_act_type,
- :container_id => course_act.course_id,
- :container_type => 'Course',
- :created_at => course_act.created_at,
- :updated_at => course_act.updated_at)
- end
- end
- end
- end
+ # count = CourseActivity.all.count/30 + 1
+ # for i in 1 ... count do
+ # transaction do
+ # CourseActivity.page(i).per(30).each do |course_act|
+ # if course_act.course_act_type == 'Message' && !course_act.course_act.parent_id.nil?
+ # org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{course_act.course_act.parent.id}").first
+ # org_activity.created_at = course_act.created_at
+ # org_activity.save
+ # else
+ # OrgActivity.create(:user_id => course_act.user_id,
+ # :org_act_id => course_act.course_act_id,
+ # :org_act_type => course_act.course_act_type,
+ # :container_id => course_act.course_id,
+ # :container_type => 'Course',
+ # :created_at => course_act.created_at,
+ # :updated_at => course_act.updated_at)
+ # end
+ # end
+ # end
+ # end
end
def down
diff --git a/db/schema.rb b/db/schema.rb
index 27b52780d..95f79b84b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20151120021958) do
+ActiveRecord::Schema.define(:version => 20151120134208) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -241,58 +241,6 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
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
@@ -425,8 +373,8 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
t.string "code"
t.integer "time"
t.string "extra"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "location"
t.string "term"
t.string "string"
@@ -436,14 +384,14 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
t.string "class_period"
t.integer "school_id"
t.text "description"
- t.integer "status", :default => 1
- t.integer "attachmenttype", :default => 2
+ 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
- t.integer "outline", :default => 0
+ t.integer "is_public", :limit => 1, :default => 1
+ t.integer "inherit_members", :limit => 1, :default => 1
+ t.integer "open_student", :default => 0
+ t.integer "outline", :default => 0
t.integer "publish_resource", :default => 0
end
@@ -573,7 +521,6 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
-<<<<<<< .mine
create_table "exercise_answers", :force => true do |t|
t.integer "user_id"
t.integer "exercise_question_id"
@@ -592,7 +539,7 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
end
create_table "exercise_questions", :force => true do |t|
- t.string "question_title"
+ t.text "question_title"
t.integer "question_type"
t.integer "question_number"
t.integer "exercise_id"
@@ -621,7 +568,7 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
end
create_table "exercises", :force => true do |t|
- t.string "exercise_name"
+ t.text "exercise_name"
t.text "exercise_description"
t.integer "course_id"
t.integer "exercise_status"
@@ -634,68 +581,6 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
t.integer "show_result"
end
-=======
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
->>>>>>> .theirs
create_table "first_pages", :force => true do |t|
t.string "web_title"
t.string "title"
@@ -1180,7 +1065,7 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
end
create_table "org_document_comments", :force => true do |t|
- t.string "title"
+ t.text "title"
t.text "content"
t.integer "organization_id"
t.integer "creator_id"
@@ -1200,7 +1085,6 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
create_table "org_members", :force => true do |t|
t.integer "user_id"
t.integer "organization_id"
- t.string "role"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end