测验答题失败时提示网络异常

This commit is contained in:
cxt 2015-12-29 16:31:19 +08:00
parent 179058f1aa
commit 605ec52f8a
3 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -66,7 +66,7 @@
<li class=" mb5 ml80">
<label >公开&nbsp;&nbsp;</label>
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox">
<span class="c_grey">(选中后课外用户可见该课程,否则仅对课内成员可见</span>
<span class="c_grey">(选中后课外用户可见该课程,否则仅对课内成员可见)</span>
<div class="cl"></div>
</li>
<li class=" mb5 ml30">

View File

@ -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("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});