Merge branch 'develop_new' into develop

This commit is contained in:
huang 2016-04-05 11:26:16 +08:00
commit b94c483d21
5 changed files with 29 additions and 4 deletions

View File

@ -29,6 +29,7 @@
<tbody>
<%@count=@page*30 %>
<% for homework in @homework do %>
<% unless homework.nil? %>
<% @count+=1 %>
<tr>
<td align="center">
@ -56,6 +57,7 @@
<%=format_date( homework.created_at ) %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>

View File

@ -4,9 +4,9 @@
<p class="f14 mt5">
<span class="fb">作品名称:</span><%=@student_work.name%>
</p>
<div class="f14 mt5" style="max-width: 425px; color:#808181">
<div class="f14 mt5" style="max-width: 425px; color:#808181; max-height:300px; overflow: auto;">
<div class="fb fl dis">作品描述:</div>
<div class="upload_img fl" style="max-width: 350px;"><%=@student_work.description.html_safe %></div>
<div class="upload_img fl" style="max-width: 330px;"><%=@student_work.description.html_safe %></div>
<div class="cl"></div>
</div>
<p class="mt5">

View File

@ -4,9 +4,9 @@
<p class="f14 mt5">
<span class="fb">作品名称:</span><%=@student_work.name%>
</p>
<div class="f14 mt5" style="max-width: 425px; color:#808181">
<div class="f14 mt5" style="max-width: 425px; color:#808181; max-height:300px; overflow: auto;">
<div class="fb fl dis">作品描述:</div>
<div class="upload_img fl" style="max-width: 350px;"><%=@student_work.description.html_safe %></div>
<div class="upload_img fl" style="max-width: 330px;"><%=@student_work.description.html_safe %></div>
<div class="cl"></div>
</div>
<p class="mt5">

View File

@ -0,0 +1,19 @@
class DeleteAnonymousWork < ActiveRecord::Migration
def up
student_works = StudentWork.where("homework_common_id = 2882").map{|work| work.id} unless StudentWork.where("homework_common_id = 2882").empty?
student_work_ids = "(" + student_works.join(",") + ")"
student_work_scores = StudentWorksScore.where("student_work_id in #{student_work_ids}")
unless student_work_scores.empty?
student_work_scores.each do |sscore|
student_work = StudentWork.find sscore.student_work_id
student_work.student_score = 0 unless student_work.nil?
student_work.absence_penalty = 0
sscore.destroy
student_work.save
end
end
end
def down
end
end

View File

@ -11,7 +11,11 @@
#
# It's strongly recommended to check this file into your version control system.
<<<<<<< HEAD
ActiveRecord::Schema.define(:version => 20160331063938) do
=======
ActiveRecord::Schema.define(:version => 20160405021915) do
>>>>>>> c3ee4dadfb92c75e8649cad7e0ed57c2ec02ec00
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false