加入了python语言支持

This commit is contained in:
guange 2015-09-19 10:39:10 +08:00
parent bebc602efc
commit c99222820e
3 changed files with 1706 additions and 1698 deletions

View File

@ -4,6 +4,6 @@ class HomeworkDetailPrograming < ActiveRecord::Base
belongs_to :homework_common
def language_name
%W(c c++).at(self.language.to_i - 1)
%W(C C++ Python).at(self.language.to_i - 1)
end
end

View File

@ -4,7 +4,7 @@
<div class="HomeWorkCon">
<div class="mt15">
<select class="InputBox W120 language_type" >
<%= options_for_select({"C语言"=>1, "C++"=>2}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
<%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
</select>
</div>
<% if edit_mode && homework.is_program_homework? %>

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150917071652) do
ActiveRecord::Schema.define(:version => 20150918005722) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -476,6 +476,13 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
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
@ -614,6 +621,7 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
t.integer "course_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "teacher_priority", :default => 1
end
create_table "homework_detail_manuals", :force => true do |t|
@ -906,7 +914,6 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false
t.integer "course_id"
t.datetime "updated_on"
end
add_index "news", ["author_id"], :name => "index_news_on_author_id"
@ -1297,9 +1304,9 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
create_table "student_work_tests", :force => true do |t|
t.integer "student_work_id"
t.integer "status"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "status", :default => 9
t.text "results"
t.text "src"
end
@ -1318,7 +1325,7 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
t.datetime "updated_at", :null => false
t.integer "late_penalty", :default => 0
t.integer "absence_penalty", :default => 0
t.integer "system_score"
t.float "system_score", :default => 0.0
t.boolean "is_test", :default => false
end
@ -1545,6 +1552,7 @@ ActiveRecord::Schema.define(:version => 20150917071652) do
t.string "identity_url"
t.string "mail_notification", :default => "", :null => false
t.string "salt", :limit => 64
t.integer "gid"
end
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"