作业评分、上传评阅结果,以及上传结果的显示样式
This commit is contained in:
parent
f3246b99c9
commit
1ae8c7d234
|
@ -72,6 +72,7 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
#评分
|
||||
def add_score
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
|
|
@ -11,7 +11,4 @@ fileSpan.find('a.remove-upload')
|
|||
})
|
||||
.off('click');
|
||||
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan);
|
||||
|
||||
//var divattach = fileSpan.find('div.div_attachments');
|
||||
//divattach.html('<%= j(render :partial => 'tags/tagEx', :locals => {:obj => @attachment, :object_flag => "6"})%>');
|
||||
<% end %>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= stylesheet_link_tag 'public', 'leftside', 'jquery/jquery-ui-1.9.2', 'courses'%>
|
||||
<%= javascript_include_tag "course","header" %>
|
||||
<%= javascript_include_tag "course","header","attachments" %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
</head>
|
||||
|
|
|
@ -31,24 +31,27 @@
|
|||
<% end%>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li >
|
||||
<span class="tit_fb"> 评价:</span>
|
||||
<textarea class="hwork_ping_text "></textarea>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<span class="tit_fb mt2"> 评分:</span>
|
||||
<input type="number" name="score" id="score_<%= work.id%>" value="50" min="0" max="100" size="4" data-units="dollars" />
|
||||
<span class=" ml5">分</span>
|
||||
<div class="cl"></div></li>
|
||||
<li >
|
||||
<span class="tit_fb"> 批阅结果:</span>
|
||||
<div>
|
||||
<%= render :partial => 'attachments/form' %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="blue_n_btn fr" >提交</a>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<%= 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 %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<span class="tit_fb mt2"> 评分:</span>
|
||||
<input type="number" name="score" id="score_<%= work.id%>" value="50" min="0" max="100" size="4" data-units="dollars" />
|
||||
<span class=" ml5">分</span>
|
||||
<div class="cl"></div></li>
|
||||
<li >
|
||||
<span class="tit_fb"> 批阅结果:</span>
|
||||
<div>
|
||||
<%= render :partial => 'student_work/student_work_attachment_form', :locals => {:id => work.id} %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="blue_n_btn fr" onclick="$(this).parent().parent().submit();">提交</a>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end%>
|
||||
</ul>
|
||||
|
||||
<div class="ping_box">
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<div class="fl">
|
||||
<span id="attachments_fields<%= id%>" xmlns="http://www.w3.org/1999/html"></span>
|
||||
<div class="cl"></div>
|
||||
<span class="add_attachment" style="font-weight:normal;">
|
||||
<%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file#{id}').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => "_file#{id}",
|
||||
:class => 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => "addInputFiles_board(this, '#{id}');",
|
||||
:style => 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js'),
|
||||
:description_placeholder => l(:label_optional_description),
|
||||
:field_is_public => l(:field_is_public),
|
||||
:are_you_sure => l(:text_are_you_sure),
|
||||
:file_count => l(:label_file_count),
|
||||
:delete_all_files => l(:text_are_you_sure_all),
|
||||
:containerid => "#{id}"
|
||||
} %>
|
||||
<span id="upload_file_count<%= id%>">
|
||||
<%= l(:label_no_file_uploaded) %>
|
||||
</span>
|
||||
(<%= l(:label_max_size) %>:
|
||||
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</span>
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -0,0 +1 @@
|
|||
alert("评分成功");
|
|
@ -672,6 +672,8 @@ input#score{ width:40px;}
|
|||
.ui-slider .ui-slider-handle:active{background-image:none;}
|
||||
.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;top:0;height:100%;background:#64bdd9;left:0;}
|
||||
|
||||
.filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ table,tr,td{border:0;cellspacing:0; cellpadding:0;}
|
|||
ol,ul,li{ list-style-type:none}
|
||||
a:link,a:visited{color:#7f7f7f;text-decoration:none;}
|
||||
a:hover,a:active{color:#000;}
|
||||
textarea {resize: none;}
|
||||
|
||||
/*常用*/
|
||||
select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; }
|
||||
|
|
Loading…
Reference in New Issue