diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 8109a7e62..017d22de0 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -86,6 +86,8 @@ class HomeworkCommonController < ApplicationController question[:output] = homework_test.output res = Net::HTTP.post_form(uri, question) + result = JSON.parse(res.body) + homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0 end end end diff --git a/config/routes.rb b/config/routes.rb index f31ec9859..de8a92b66 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -86,6 +86,7 @@ RedmineApp::Application.routes.draw do end collection do post 'next_step' + post 'set_program_score' end end