From 4b275bcbdf11e4d1eb0795fafe25bb80b28e7ae8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 10 Jul 2015 11:36:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=BF=94=E5=9B=9E=E5=80=BC?= =?UTF-8?q?=EF=BC=8C=E4=BD=9C=E4=B8=9A=E8=8E=B7=E5=8F=96question=E7=9A=84i?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 2 ++ config/routes.rb | 1 + 2 files changed, 3 insertions(+) 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