- <%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
- <%= hidden_field_tag "course",@course.id%>
- <%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
-
提交
- <%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
- <%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
+
+ <%= form_for("new_homework_common",:url => next_step_homework_common_index_path) do |f|%>
+
+
+ 请选择将要发布的作业类型
+
+
+
+ 人工评分的作业(支持匿名互评、灵活设置评分比例)
+
+
+
+
+ 自动评测的编程作业(支持C程序的自动评分)
+
+
+
+ 下一步
+
<% end%>
From 987ff98141ded9de15a4d8a159eeadf47cfc31d3 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 20 Jul 2015 15:03:42 +0800
Subject: [PATCH 15/27] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8C=89=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/services/courses_service.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb
index 2921cc825..185f448ce 100644
--- a/app/services/courses_service.rb
+++ b/app/services/courses_service.rb
@@ -711,19 +711,19 @@ class CoursesService
" limit 0,4"
active_students = User.find_by_sql(sql1)
if homework_count != 0 && !better_students.empty?
- latest_course_dynamics <<{:type=> 6,:time=>Time.now.to_s,:count=> 4,:better_students=> better_students}
+ latest_course_dynamics <<{:type=> 6,:time=>"1970-01-01 0:0:0 +0800",:count=> 4,:better_students=> better_students}
end
unless active_students.empty?
- latest_course_dynamics <<{:type=> 7,:time=>Time.now.to_s,:count=> 4,:active_students=>active_students}
+ latest_course_dynamics <<{:type=> 7,:time=>"1970-01-01 0:0:0 +0800",:count=> 4,:active_students=>active_students}
end
latest_course_dynamic = latest_course_dynamics.first
unless latest_course_dynamic.nil?
result << {:course_name => course.name,:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course), :course_id => course.id, :course_img_url => url_to_avatar(course), :course_time => course.time, :course_term => course.term,:message => "", :dynamics => latest_course_dynamics,
- :course_student_num=>course ? course.members.count : 0,:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "前"}
+ :course_student_num=>course ? course.members.count : 0,:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "前",:time=>latest_course_dynamic[:time].to_time}
end
end
#返回数组集合
- result.sort! { |order, newer| newer[:update_time] <=> order[:update_time] }
+ result.sort! { |order, newer| newer[:time] <=> order[:time] }
result
end
From 8f1a7f47d1b20fa7ba94ef1efb99177309bc5281 Mon Sep 17 00:00:00 2001
From: huang
Date: Mon, 20 Jul 2015 16:03:33 +0800
Subject: [PATCH 16/27] =?UTF-8?q?dts=E6=B5=8B=E8=AF=95=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=BF=9B=E5=BA=A6=E6=95=88=E6=9E=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/dts_rep.html.erb | 95 +++++++++++++++++++++--------
config/routes.rb | 3 +
2 files changed, 74 insertions(+), 24 deletions(-)
diff --git a/app/views/projects/dts_rep.html.erb b/app/views/projects/dts_rep.html.erb
index e62c58283..8c2a9e0d8 100644
--- a/app/views/projects/dts_rep.html.erb
+++ b/app/views/projects/dts_rep.html.erb
@@ -1,30 +1,77 @@
<%= l(:label_project_dts_statics) %>
-语言:Java 总文件数:361 代码行数:48662
-
-
+
+
+
+
+
+
语言:Java 总文件数:361 代码行数:48662
+
+
+
-
-<% @dts.each do |dt| %>
-
-
- 错误变量
- <%= dt.Variable %>
- 起始行
- <%= dt.StartLine %>
- IP行
- <%= dt.IPLine %>
-
-
- 缺陷代码
- <%= dt.IPLineCode %>
-
-
- 错误描述
- <%= dt.Description %>
-
-
-<% end %>
\ No newline at end of file
+
+ <% @dts.each do |dt| %>
+
+
+ 错误变量
+ <%= dt.Variable %>
+ 起始行
+ <%= dt.StartLine %>
+ IP行
+ <%= dt.IPLine %>
+
+
+ 缺陷代码
+ <%= dt.IPLineCode %>
+
+
+ 错误描述
+ <%= dt.Description %>
+
+
+ 文件
+ <%= dt.File %>
+
+
+ <% end %>
+
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index b74fd28fd..b460db857 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -385,8 +385,11 @@ RedmineApp::Application.routes.draw do
get 'feedback', :action => 'feedback', :as => 'project_feedback'
get 'watcherlist', :action=> 'watcherlist'
+
+ # 添加dts测试工具
get 'dts_rep', :action=> 'dts_rep'
get 'dts_yun', :action=> 'dts_yun'
+
get 'invite_members', :action=> 'invite_members'
get 'invite_members_by_mail', :action=> 'invite_members_by_mail'
get 'send_mail_to_member', :action => 'send_mail_to_member'
From 9f72b25360b99c79786d1826267b45f2582202a3 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 20 Jul 2015 16:22:18 +0800
Subject: [PATCH 17/27] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/student_work_test.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/models/student_work_test.rb b/app/models/student_work_test.rb
index d9ac5e935..2e6efdf0a 100644
--- a/app/models/student_work_test.rb
+++ b/app/models/student_work_test.rb
@@ -1,12 +1,12 @@
# encoding: utf-8
class StudentWorkTest < ActiveRecord::Base
- attr_accessible :student_work_id, :homework_test_id
+ attr_accessible :student_work_id, :homework_test_id, :result
belongs_to :homework_test
belongs_to :student_work
def status_to_s
- case self.result
+ case self.result.to_i
when -1
'编译出错'
when -2
@@ -33,7 +33,7 @@ class StudentWorkTest < ActiveRecord::Base
end
def test_score
- if self.result == 0
+ if self.result.to_i == 0
format("%.1f",100.0 / self.student_work.homework_common.homework_tests.count)
else
0
From 654a8078de1717e4f04a5fd44d767bee73d86e1c Mon Sep 17 00:00:00 2001
From: huang
Date: Mon, 20 Jul 2015 16:28:35 +0800
Subject: [PATCH 18/27] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BD=AF=E4=BB=B6?=
=?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 24 +++++++-
app/views/projects/_tools_expand.html.erb | 4 +-
.../{dts_rep.html.erb => dts_dep.html.erb} | 55 +++++++++----------
app/views/projects/dts_yun.html.erb | 3 -
app/views/projects/soft_knowledge.html.erb | 46 ++++++++++++++++
app/views/projects/yun_dep.html.erb | 46 ++++++++++++++++
config/routes.rb | 8 ++-
7 files changed, 147 insertions(+), 39 deletions(-)
rename app/views/projects/{dts_rep.html.erb => dts_dep.html.erb} (63%)
delete mode 100644 app/views/projects/dts_yun.html.erb
create mode 100644 app/views/projects/soft_knowledge.html.erb
create mode 100644 app/views/projects/yun_dep.html.erb
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 9ddc513cd..2efaf591a 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -362,13 +362,33 @@ class ProjectsController < ApplicationController
end
# dts测试工具
- def dts_rep
+ def dts_dep
render_403 unless User.current.admin?
@dts = Dts.all
end
# dts云部署
- def dts_yun
+ def yun_dep
+ render_403 unless User.current.admin?
+ end
+
+ # 软件知识库
+ def soft_knowledge
+ render_403 unless User.current.admin?
+ end
+
+ # 在线开发平台
+ def online_dev
+ render_403 unless User.current.admin?
+ end
+
+ # 软件资源库
+ def soft_file
+ render_403 unless User.current.admin?
+ end
+
+ # 软件服务
+ def soft_service
render_403 unless User.current.admin?
end
diff --git a/app/views/projects/_tools_expand.html.erb b/app/views/projects/_tools_expand.html.erb
index 897d99fd7..7ba58f424 100644
--- a/app/views/projects/_tools_expand.html.erb
+++ b/app/views/projects/_tools_expand.html.erb
@@ -37,12 +37,12 @@
<% if User.current.admin? %>
- <%= link_to l(:label_project_dts_new) ,dts_rep_project_path(@project), data: { confirm:'你确定要进行DTS测试吗?' } %>
+ <%= link_to l(:label_project_dts_new) ,dts_dep_project_path(@project), data: { confirm:'你确定要进行DTS测试吗?' } %>
<% end %>
<% if User.current.admin? %>
- <%= link_to l(:label_project_dts_yun) ,dts_yun_project_path(@project) %>
+ <%= link_to l(:label_project_dts_yun) ,yun_dep_project_path(@project) %>
<% end %>
diff --git a/app/views/projects/dts_rep.html.erb b/app/views/projects/dts_dep.html.erb
similarity index 63%
rename from app/views/projects/dts_rep.html.erb
rename to app/views/projects/dts_dep.html.erb
index 8c2a9e0d8..17630c622 100644
--- a/app/views/projects/dts_rep.html.erb
+++ b/app/views/projects/dts_dep.html.erb
@@ -9,47 +9,42 @@
#font_color{background:yellow;text-align:center;color:white;}
-