diff --git a/app/views/student_work/_add_score.html.erb b/app/views/student_work/_add_score.html.erb
index a2137d103..ca580bebc 100644
--- a/app/views/student_work/_add_score.html.erb
+++ b/app/views/student_work/_add_score.html.erb
@@ -7,8 +7,9 @@
评分:
-
- 分
+
+ 分
+ 未评分
<% if @is_teacher%>
@@ -16,6 +17,8 @@
<%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %>
+
+ 评语、评分、批阅结果至少有一个不为空。
<%end%>
提交
@@ -28,12 +31,29 @@
$('#hint_message_'+id).html("为了对其他学生的作品负责,请您务必填写评语");
$("#hint_message_"+id).css('color','#ff0000');
$("#score_comment_"+id).focus();
- } else {
+ } else if (parseFloat($("#score_"+id).val()) == -1) {
+ $('#score_notice_span_'+id).html("请先评分");
+ $('#score_notice_span_'+id).show();
+ $("#score_"+id).focus();
+ }
+ else {
$("#work_submit_"+id).parent().parent().submit();
$('#about_hwork_'+id).html('');
}
<% else %>
- $("#work_submit_"+id).parent().parent().submit();
+ if($.trim($('#score_comment_'+id).val()) == "" && parseFloat($("#score_"+id).val()) == -1 && $("#attachments_fields"+id).children().length == 0){
+ $("#none_notice_"+id).show();
+ } else if(parseFloat($("#score_"+id).val()) == -1) {
+ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/no_teacher_score_notice') %>');
+ showModal('ajax-modal', '450px');
+ $('#ajax-modal').siblings().remove();
+ $('#ajax-modal').before("" +
+ "
");
+ $('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
+ }
+ else {
+ $("#work_submit_" + id).parent().parent().submit();
+ }
<% end %>
}
\ No newline at end of file
diff --git a/app/views/student_work/_no_teacher_score_notice.html.erb b/app/views/student_work/_no_teacher_score_notice.html.erb
new file mode 100644
index 000000000..12b3025a9
--- /dev/null
+++ b/app/views/student_work/_no_teacher_score_notice.html.erb
@@ -0,0 +1,15 @@
+
+
+
+ 当前作品未进行评分,是否确定提交?
+
+
+
+
\ No newline at end of file
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 4e698e6f2..cdaf8866a 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -1057,10 +1057,26 @@ $.fn.peSlider = function(settings){
max: parseFloat(input.attr('max')),
value: parseFloat(input.val())
});
+ if(parseFloat(input.val()) == -1){
+ input.css("color", "#fff");
+ input.next().next().html("未评分");
+ input.next().next().show();
+ } else{
+ input.css("color", "#000");
+ input.next().next().hide();
+ }
slider
.insertBefore(input)
.slider(sliderOptions)
.bind('slide', function(e, ui){
+ if(ui.value == -1){
+ input.css("color", "#fff");
+ input.next().next().html("未评分");
+ input.next().next().show();
+ } else {
+ input.css("color", "#000");
+ input.next().next().hide();
+ }
input.val(ui.value);
friendlyVal = input.val() + ' ' + thisUnits;
slider.find('a').attr({
@@ -1081,6 +1097,14 @@ $.fn.peSlider = function(settings){
.keyup(function(){
var inVal = parseFloat(input.val());
if( !isNaN(inVal) ){
+ if(inVal == -1){
+ input.css("color", "#fff");
+ input.next().next().html("未评分");
+ input.next().next().show();
+ } else {
+ input.css("color", "#000");
+ input.next().next().hide();
+ }
slider.slider('value', inVal);
input.val(slider.slider('value'));
}
@@ -1088,6 +1112,14 @@ $.fn.peSlider = function(settings){
.change(function(){
var inVal = parseFloat(input.val());
if( !isNaN(inVal) ){
+ if(inVal == -1){
+ input.css("color", "#fff");
+ input.next().next().html("未评分");
+ input.next().next().show();
+ } else {
+ input.css("color", "#000");
+ input.next().next().hide();
+ }
slider.slider('value', inVal);
input.val(slider.slider('value'));
}
@@ -1095,7 +1127,15 @@ $.fn.peSlider = function(settings){
.blur(function(){
var inVal = parseFloat(input.val());
if( isNaN(inVal) ){
- input.val(0);
+ input.val(-1);
+ }
+ if(input.val() == -1){
+ input.css("color", "#fff");
+ input.next().next().html("未评分");
+ input.next().next().show();
+ } else {
+ input.css("color", "#000");
+ input.next().next().hide();
}
});
if( !settings.step ){