diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index a008414f3..d3a4be17d 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -72,6 +72,7 @@ class StudentWorkController < ApplicationController
#评分
def add_score
+
respond_to do |format|
format.js
end
diff --git a/app/views/attachments/upload.js.erb b/app/views/attachments/upload.js.erb
index c3e7fc3ff..970c5b22d 100644
--- a/app/views/attachments/upload.js.erb
+++ b/app/views/attachments/upload.js.erb
@@ -11,7 +11,4 @@ fileSpan.find('a.remove-upload')
})
.off('click');
$('', { 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 %>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 6849f1f13..09844778c 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -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" %>
<%= yield :header_tags -%>
diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb
index df6b00a9d..b2eabc536 100644
--- a/app/views/student_work/_show.html.erb
+++ b/app/views/student_work/_show.html.erb
@@ -31,24 +31,27 @@
<% end%>
-
- 评价:
-
-
-
-
- 评分:
-
- 分
-
-
- 批阅结果:
-
- <%= render :partial => 'attachments/form' %>
-
- 提交
-
-
+
+ <%= form_for('new_form', :remote => true, :method => :post,:url => add_score_student_work_path(work.id)) do |f|%>
+
+ 评价:
+ <%= f.text_area 'user_message', :class => 'hwork_ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %>
+
+
+
+ 评分:
+
+ 分
+
+
+ 批阅结果:
+
+ <%= render :partial => 'student_work/student_work_attachment_form', :locals => {:id => work.id} %>
+
+ 提交
+
+
+ <% end%>
diff --git a/app/views/student_work/_student_work_attachment_form.html.erb b/app/views/student_work/_student_work_attachment_form.html.erb
new file mode 100644
index 000000000..f56d70f36
--- /dev/null
+++ b/app/views/student_work/_student_work_attachment_form.html.erb
@@ -0,0 +1,34 @@
+
+
+
+
+ <%= 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}"
+ } %>
+
+ <%= l(:label_no_file_uploaded) %>
+
+ (<%= l(:label_max_size) %>:
+ <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
+
+ <% content_for :header_tags do %>
+ <%= javascript_include_tag 'attachments' %>
+ <% end %>
+
+
diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb
index e69de29bb..6f0d25876 100644
--- a/app/views/student_work/add_score.js.erb
+++ b/app/views/student_work/add_score.js.erb
@@ -0,0 +1 @@
+alert("评分成功");
\ No newline at end of file
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 93a8da41f..b503fd88d 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -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;}
+
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index e7421d1fe..b995c6d5c 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -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; }