From 605ec52f8ac8efdf9559c9dbc3560c1f564eeac7 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 29 Dec 2015 16:31:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E9=AA=8C=E7=AD=94=E9=A2=98=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=97=B6=E6=8F=90=E7=A4=BA=E7=BD=91=E7=BB=9C=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_controller.rb | 2 +- app/views/courses/settings.html.erb | 2 +- app/views/exercise/_exercise_student.html.erb | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 25b5dacec..9c073afa8 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -485,7 +485,7 @@ class ExerciseController < ApplicationController ea.answer_text = params[:answer_text] if ea.save @percent = get_percent(@exercise,User.current) - render :json => {:text => pv.vote_text,:percent => format("%.2f", @percent)} + render :json => {:text => ea.answer_text,:percent => format("%.2f", @percent)} else render :json => {:text => "failure"} end diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index d330551d1..ae6416c9d 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -66,7 +66,7 @@
  • id="course_is_public" name="course[is_public]" type="checkbox"> - (选中后课外用户可见该课程,否则仅对课内成员可见。) + (选中后课外用户可见该课程,否则仅对课内成员可见)
  • diff --git a/app/views/exercise/_exercise_student.html.erb b/app/views/exercise/_exercise_student.html.erb index 8a1f3dbd6..4f4892b79 100644 --- a/app/views/exercise/_exercise_student.html.erb +++ b/app/views/exercise/_exercise_student.html.erb @@ -100,6 +100,9 @@ { obj.checked = false; } + }, + error: function () { + alert("网络异常,答题失败,请确认网络正常连接后再答题。"); } }); } @@ -154,6 +157,9 @@ { obj.checked = false; } + }, + error: function () { + alert("网络异常,答题失败,请确认网络正常连接后再答题。"); } }); } @@ -196,6 +202,9 @@ success: function (data) { var dataObj = eval(data); obj.value = dataObj.text; + }, + error: function () { + alert("网络异常,答题失败,请确认网络正常连接后再答题。"); } });