Merge branch 'szzh' into sw_new_course

This commit is contained in:
huang 2015-11-20 21:50:25 +08:00
commit 95e8173e0b
5 changed files with 36 additions and 152 deletions

View File

@ -4,7 +4,7 @@
<span class="ml10">(<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>)</span>
</div>
<%= 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") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= exercise_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mc_<%=exercise_question.id%>" onclick="dismiss('mc',<%=exercise_question.id%>);insert_MC('mc',<%=exercise_question.question_number%>,<%=exercise_question.id%>);"></a>

View File

@ -3,7 +3,7 @@
<%= exercise_question.question_title %>
<span class="ml10">(<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>)</span>
</div>
<%= 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") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= exercise_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mcq_<%=exercise_question.id%>" onclick="dismiss('mcq',<%=exercise_question.id%>);insert_MCQ('mcq',<%=exercise_question.question_number%>,<%=exercise_question.id%>);"></a>

View File

@ -2,8 +2,8 @@
<div class="testEditTitle"> 第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)<br />
<%= exercise_question.question_title %>
</div>
<%= 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") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= exercise_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_single_<%=exercise_question.id%>" onclick="dismiss('single',<%=exercise_question.id%>);insert_SINGLE('single',<%=exercise_question.question_number%>,<%=exercise_question.id%>);"></a>
<div class="cl"></div>

View File

@ -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

View File

@ -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