This commit is contained in:
cxt 2015-08-01 17:45:17 +08:00
commit 86ddbb43c3
5 changed files with 16 additions and 14 deletions

View File

@ -387,8 +387,8 @@ class StudentWorkController < ApplicationController
if stundet_work && params[:results] && params[:results].class.to_s == "Array"
homework_common = stundet_work.homework_common
params[:results].each do |result|
homework_test = homework_common.homework_tests.where("input = '#{result[:input]}' AND output = '#{result[:output]}'").first
if homework_test
homework_tests = homework_common.homework_tests.where("input = '#{result[:input]}' AND output = '#{result[:output]}'")
homework_tests.each do |homework_test|
student_work_test = StudentWorkTest.new
student_work_test.student_work = stundet_work
student_work_test.homework_test = homework_test

View File

@ -34,7 +34,7 @@
</li>
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;">
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')',
{:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user},
{:controller=> 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.host_user},
{:class => 'my-message'} if User.current.logged?%>
</li>
</ul>

View File

@ -13,8 +13,8 @@
<td class="w90" > <%= l(:field_effective_date) %></td>
<td class="w150"><%= l(:field_description) %> </td>
<td class="w90"><%= l(:field_status) %></td>
<td class="w90"><%= l(:field_sharing) %></td>
<td class="w150"><%= l(:label_wiki_page) %></td>
<!--<td class="w90"><%#= l(:field_sharing) %></td>-->
<!--<td class="w150"><%#= l(:label_wiki_page) %></td>-->
<td class="w150"></td>
</tr>
<% for version in @project.shared_versions.sort %>
@ -25,13 +25,13 @@
<td class="description"><%= format_date(version.effective_date) %></td>
<td class="description tl" style="word-break:break-all;"><%=h version.description %></td>
<td class="status"><%= l("version_status_#{version.status}") %></td>
<td class="sharing"><%=h format_version_sharing(version.sharing) %></td>
<td class="tl" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="">
<%= link_to_if_authorized(h(truncate(version.wiki_page_title,:length=>20)), {:controller => 'wiki',
:action => 'show',
:project_id => version.project,
<!--<td class="sharing"><%#=h format_version_sharing(version.sharing) %></td>-->
<!--<td class="tl" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="">-->
<%#= link_to_if_authorized(h(truncate(version.wiki_page_title,:length=>20)), {:controller => 'wiki',
# :action => 'show',
# :project_id => version.project,
:id => Wiki.titleize(version.wiki_page_title)},:class=>"c_blue02") || h(version.wiki_page_title) unless version.wiki_page_title.blank? || version.project.wiki.nil? %>
</td>
<!--</td>-->
<td >
<% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %>
<%= link_to l(:button_edit), edit_version_path(version), :class => 'c_purple' %></a>

View File

@ -48,8 +48,10 @@
<span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分。
迟交扣分
<span class="c_red">&nbsp;<%= student_work.late_penalty%>&nbsp;</span>分,
缺评扣分
<span class="c_red">&nbsp;<%= student_work.absence_penalty%>&nbsp;</span>分,
<% if student_work.homework_common.homework_type == 1%>
缺评扣分
<span class="c_red">&nbsp;<%= student_work.absence_penalty%>&nbsp;</span>分,
<% end%>
最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score)%>&nbsp;</span>分。
</div>

View File

@ -148,7 +148,7 @@
输出
</td>
</tr>
<% homework.homework_tests.each do |test|%>
<% @homework.homework_tests.each do |test|%>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit">
<%=test.input%>