老师评阅作品时可以不写评语,只有学生匿评的时候才强制写评语

This commit is contained in:
cxt 2016-01-19 09:55:28 +08:00
parent 7f7d0ac6f7
commit 6e582fa631
1 changed files with 11 additions and 7 deletions
app/views/student_work

View File

@ -23,13 +23,17 @@
<% end%> <% end%>
<script type="text/javascript"> <script type="text/javascript">
function score_submit(id){ function score_submit(id){
if ($.trim($('#score_comment_'+id).val()) == "") { <% if !@is_teacher %>
$('#hint_message_'+id).html("为了对其他学生的作品负责,请您务必填写评语"); if ($.trim($('#score_comment_'+id).val()) == "") {
$("#hint_message_"+id).css('color','#ff0000'); $('#hint_message_'+id).html("为了对其他学生的作品负责,请您务必填写评语");
$("#score_comment_"+id).focus(); $("#hint_message_"+id).css('color','#ff0000');
} else { $("#score_comment_"+id).focus();
} else {
$("#work_submit_"+id).parent().parent().submit();
$('#about_hwork_'+id).html('');
}
<% else %>
$("#work_submit_"+id).parent().parent().submit(); $("#work_submit_"+id).parent().parent().submit();
$('#about_hwork_'+id).html(''); <% end %>
}
} }
</script> </script>