diff --git a/app/models/homework_detail_programing.rb b/app/models/homework_detail_programing.rb index f6286a45e..2877ed6c1 100644 --- a/app/models/homework_detail_programing.rb +++ b/app/models/homework_detail_programing.rb @@ -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 diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb index 1828ede6d..c03570072 100644 --- a/app/views/poll/_poll.html.erb +++ b/app/views/poll/_poll.html.erb @@ -30,13 +30,13 @@ <% if poll.polls_status == 1 %>
  • <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml5"%>
  • <% else%> -
  • 编辑
  • +
  • 编辑
  • <% end%> <% if poll.polls_status == 2 %>
  • 关闭
  • <% else %> -
  • 关闭
  • +
  • 关闭
  • <% end%> <% if poll.polls_status == 1%> diff --git a/app/views/users/_user_programing_attr.html.erb b/app/views/users/_user_programing_attr.html.erb index 498005010..970867c43 100644 --- a/app/views/users/_user_programing_attr.html.erb +++ b/app/views/users/_user_programing_attr.html.erb @@ -4,7 +4,7 @@
    <% if edit_mode && homework.is_program_homework? %> diff --git a/db/schema.rb b/db/schema.rb index 90f814ea2..43357f44f 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 => 20150918134804) do +ActiveRecord::Schema.define(:version => 20150918005722) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -497,26 +497,23 @@ ActiveRecord::Schema.define(:version => 20150918134804) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 + create_table "dts", :force => true do |t| + t.string "IPLineCode" t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 + t.string "Num" + t.string "Variable" + t.string "TraceInfo" + t.string "Method" + t.string "File" + t.string "IPLine" + t.string "Review" + t.string "Category" + t.string "Defect" + t.string "PreConditions" + t.string "StartLine" t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "enabled_modules", :force => true do |t| @@ -575,7 +572,6 @@ ActiveRecord::Schema.define(:version => 20150918134804) do t.integer "viewed" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "secret_key" end create_table "forums", :force => true do |t| @@ -687,7 +683,6 @@ ActiveRecord::Schema.define(:version => 20150918134804) do t.integer "user_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "mail" end create_table "issue_categories", :force => true do |t| @@ -1309,9 +1304,9 @@ ActiveRecord::Schema.define(:version => 20150918134804) do create_table "student_work_tests", :force => true do |t| t.integer "student_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 9 + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.text "results" t.text "src" end @@ -1330,7 +1325,7 @@ ActiveRecord::Schema.define(:version => 20150918134804) 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 @@ -1364,10 +1359,8 @@ ActiveRecord::Schema.define(:version => 20150918134804) do create_table "system_messages", :force => true do |t| t.integer "user_id" t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "description" - t.string "subject" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "taggings", :force => true do |t| @@ -1559,6 +1552,7 @@ ActiveRecord::Schema.define(:version => 20150918134804) 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" diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index 0499ac5fb..3589a0728 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -124,7 +124,7 @@ $(function(){ $('#textarea_input_test').focus(); }); - $("#BluePopupBox a.BlueCirBtn").live('click', function(){ + var saveProgramAnswers = function() { var test_numbers = 0; var valid = true; var input = null; @@ -159,6 +159,12 @@ $(function(){ $('.program-input').remove(); var html=bt('t:program-input-list',data); $("input[name=homework_type]").after(html); + } + return valid; + } + + $("#BluePopupBox a.BlueCirBtn").live('click', function(){ + if(saveProgramAnswers()){ if($( "#BluePopupBox" ).dialog( "isOpen" )){ $("#BluePopupBox").dialog( "close" ); } @@ -180,4 +186,4 @@ $(function(){ $("#BluePopupBox").on('click', 'a.icon_remove', function(){ $(this).parent('.mt10').remove(); }); -}); \ No newline at end of file +});