学生匿评必须添加评语

dev_zanle
cxt 10 years ago
parent e7db03f271
commit c073e56b79

@ -1,7 +1,8 @@
<%= form_for('new_form', :remote => true, :method => :post,:url => add_score_student_work_path(work.id)) do |f|%>
<li >
<span class="tit_fb"> 评价:</span>
<%= f.text_area 'user_message', :class => 'hwork_ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %>
<%= f.text_area 'user_message',:id =>"new_form_user_message_#{work.id}", :class => 'hwork_ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %>
<p id="hint_message_<%=work.id %>" style="margin-left: 67px;"></p>
<div class="cl"></div>
</li>
<li >
@ -16,7 +17,24 @@
<%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %>
</div>
<%end%>
<a href="javascript:void(0);" class="blue_n_btn fr evaluation_submit" onclick="$(this).parent().parent().submit();$('#about_hwork_<%= work.id%>').html('');">提交</a>
<a href="javascript:void(0);" class="blue_n_btn fr evaluation_submit" id="submit_evaluation_<%=work.id %>" onclick="submit(<%=work.id %>);">提交</a>
<div class="cl"></div>
</li>
<% end%>
<script type="text/javascript">
function submit(id) {
<% if @is_teacher %>
$('#submit_evaluation_'+id).parent().parent().submit();
$('#about_hwork_'+id).html('');
<% else %>
if ($.trim($('#new_form_user_message_'+id).val()) =="") {
$('#hint_message_'+id).html("为了对其他学生的作品负责,请您务必填写评语");
$('#hint_message_'+id).css('color','#ff0000');
return false;
} else {
$('#submit_evaluation_'+id).parent().parent().submit();
$('#about_hwork_'+id).html('');
}
<% end %>
}
</script>
Loading…
Cancel
Save