- <%= 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/C++程序的自动评分)
+
+
+
+ 下一步
+
<% end%>
From b13e9f918c7cceb0e24a449f141b9c0efa1940ca Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 21 Jul 2015 15:15:38 +0800
Subject: [PATCH 02/10] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=9C=80=E5=90=8E?=
=?UTF-8?q?=E4=B8=80=E5=88=97=E5=BE=97=E5=88=86=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/student_work/_programing_work_show.html.erb | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb
index b929e0f27..eab8313bc 100644
--- a/app/views/student_work/_programing_work_show.html.erb
+++ b/app/views/student_work/_programing_work_show.html.erb
@@ -48,7 +48,6 @@
<%= test.output%>
<%= test.student_work_test.nil? ? "正在编译" : test.student_work_test.status_to_s%> |
-
<%= test.student_work_test.nil? ? "0" : test.student_work_test.test_score%> |
<% end%>
From cfbd50e474678069468a1875cf31f60ed32ac9f3 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 21 Jul 2015 15:39:48 +0800
Subject: [PATCH 03/10] =?UTF-8?q?student=5Fwork=E5=92=8Cstudent=5Fwork=5Ft?=
=?UTF-8?q?est=E5=85=B3=E7=B3=BB=EF=BC=9A1=E5=AF=B9=E5=A4=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/student_work.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/student_work.rb b/app/models/student_work.rb
index c80d1315b..b95c11c11 100644
--- a/app/models/student_work.rb
+++ b/app/models/student_work.rb
@@ -7,7 +7,7 @@ class StudentWork < ActiveRecord::Base
has_many :student_works_evaluation_distributions, :dependent => :destroy
has_many :student_works_scores, :dependent => :destroy
belongs_to :project
- has_one :student_work_test
+ has_many :student_work_test
before_destroy :delete_praise
From 5e79288d49b46b0c295c64b81f8b640a2770406d Mon Sep 17 00:00:00 2001
From: huang
Date: Tue, 21 Jul 2015 15:47:53 +0800
Subject: [PATCH 04/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9dts=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/dts_dep.html.erb | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/app/views/projects/dts_dep.html.erb b/app/views/projects/dts_dep.html.erb
index 099e7d6d6..a0a79740d 100644
--- a/app/views/projects/dts_dep.html.erb
+++ b/app/views/projects/dts_dep.html.erb
@@ -45,11 +45,11 @@
-
语言:Java 总文件数:361 代码行数:48662
-
- <% @dts.each do |dt| %>
+
语言:Java 总文件数:361 代码行数:48662
-
+ <% @dts.each do |dt| %>
+
+
错误变量 |
<%= dt.Variable %> |
@@ -71,6 +71,7 @@
<%= dt.File %> |
+
<% end %>
-
+
\ No newline at end of file
From bb08c7160fe93453fb3cbbe1b2b7d93ed16f09a6 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 21 Jul 2015 15:52:40 +0800
Subject: [PATCH 05/10] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E9=83=A8=E5=88=86=E6=8A=A5500?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_common_controller.rb | 44 +++++++++----------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index e71fd5e29..04a07e9a8 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -18,28 +18,28 @@ class HomeworkCommonController < ApplicationController
end
def new
- # @homework_type = "1"
- #
- # @homework = HomeworkCommon.new
- # @homework.safe_attributes = params[:homework_common]
- # @homework.late_penalty = 0
- # @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
- # @homework.publish_time = Time.now.strftime('%Y-%m-%d')
- #
- # if @homework_type == "1"
- # #匿评作业相关属性
- # @homework_detail_manual = HomeworkDetailManual.new
- # @homework_detail_manual.ta_proportion = 0.6
- # @homework_detail_manual.absence_penalty = 0
- # @homework_detail_manual.evaluation_num = 3
- # @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
- # @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
- # @homework.homework_detail_manual = @homework_detail_manual
- # elsif @homework_type == "2"
- # #编程作业相关属性
- # @homework_detail_programing = HomeworkDetailPrograming.new
- # @homework.homework_detail_programing = @homework_detail_programing
- # end
+ @homework_type = "1"
+
+ @homework = HomeworkCommon.new
+ @homework.safe_attributes = params[:homework_common]
+ @homework.late_penalty = 0
+ @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
+ @homework.publish_time = Time.now.strftime('%Y-%m-%d')
+
+ if @homework_type == "1"
+ #匿评作业相关属性
+ @homework_detail_manual = HomeworkDetailManual.new
+ @homework_detail_manual.ta_proportion = 0.6
+ @homework_detail_manual.absence_penalty = 0
+ @homework_detail_manual.evaluation_num = 3
+ @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
+ @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
+ @homework.homework_detail_manual = @homework_detail_manual
+ elsif @homework_type == "2"
+ #编程作业相关属性
+ @homework_detail_programing = HomeworkDetailPrograming.new
+ @homework.homework_detail_programing = @homework_detail_programing
+ end
respond_to do |format|
format.html
end
From c675db938186bba217843661f0827bc0d923bd0e Mon Sep 17 00:00:00 2001
From: huang
Date: Tue, 21 Jul 2015 15:52:45 +0800
Subject: [PATCH 06/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=91=E9=83=A8?=
=?UTF-8?q?=E7=BD=B2=E8=B7=AF=E5=BE=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/yun_dep.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/projects/yun_dep.html.erb b/app/views/projects/yun_dep.html.erb
index 71780faa3..20abf038f 100644
--- a/app/views/projects/yun_dep.html.erb
+++ b/app/views/projects/yun_dep.html.erb
@@ -43,5 +43,5 @@
\ No newline at end of file
From d9f312bbe3574a352fd8f473ef81421cbb9a7701 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 22 Jul 2015 09:56:27 +0800
Subject: [PATCH 07/10] =?UTF-8?q?1=E3=80=81=E5=BD=93=E4=BD=9C=E5=93=81?=
=?UTF-8?q?=E6=8F=8F=E8=BF=B0=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E6=89=93?=
=?UTF-8?q?=E5=BC=80=E4=BD=9C=E5=93=81=E6=8A=A5=E9=94=99=202=E3=80=81?=
=?UTF-8?q?=E4=BD=9C=E5=93=81=E5=90=8D=E7=A7=B0=E4=B8=BA=E7=A9=BA=E6=97=B6?=
=?UTF-8?q?=EF=BC=8C=E9=BB=98=E8=AE=A4=E6=98=BE=E7=A4=BA=E4=BD=9C=E5=93=81?=
=?UTF-8?q?=E5=90=8D=E4=B8=BA=EF=BC=9AXX=E7=9A=84=E4=BD=9C=E5=93=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/student_work/_evaluation_student_work.html.erb | 3 ++-
app/views/student_work/_evaluation_work.html.erb | 3 ++-
app/views/student_work/_show.html.erb | 2 +-
app/views/student_work/_student_work.html.erb | 3 ++-
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/app/views/student_work/_evaluation_student_work.html.erb b/app/views/student_work/_evaluation_student_work.html.erb
index b5bdd6f55..9569718fb 100644
--- a/app/views/student_work/_evaluation_student_work.html.erb
+++ b/app/views/student_work/_evaluation_student_work.html.erb
@@ -9,7 +9,8 @@
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
- <%= link_to student_work.name, student_work_path(student_work.id),:remote => true,:title => student_work.name, :class => "c_blue02"%>
+ <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
+ <%= link_to student_work_name, student_work_path(student_work.id),:remote => true,:title => student_work.name, :class => "c_blue02"%>
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb
index 11ce7b080..be07269c3 100644
--- a/app/views/student_work/_evaluation_work.html.erb
+++ b/app/views/student_work/_evaluation_work.html.erb
@@ -18,7 +18,8 @@
<% end%>
- <%= link_to student_work.name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%>
+ <% student_work_name = student_work.name.nil? || student_work.name.empty? ? '匿名的作品' : student_work.name%>
+ <%= link_to student_work_name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%>
<% my_score = student_work_score(student_work,User.current) %>
diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb
index 2b7d49402..f6580659e 100644
--- a/app/views/student_work/_show.html.erb
+++ b/app/views/student_work/_show.html.erb
@@ -36,7 +36,7 @@
内容:
- <%= text_format @work.description%>
+ <%= text_format(@work.description) if @work.description%>
diff --git a/app/views/student_work/_student_work.html.erb b/app/views/student_work/_student_work.html.erb
index dd7ab7e2d..f7eb7514d 100644
--- a/app/views/student_work/_student_work.html.erb
+++ b/app/views/student_work/_student_work.html.erb
@@ -9,7 +9,8 @@
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
- <%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
+ <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
+ <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
From ae4eed45c3167af958be6145ce7d4aed3beb84c8 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 22 Jul 2015 10:05:21 +0800
Subject: [PATCH 08/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=96=B0=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E5=B7=A5=E5=85=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/_tools_expand.html.erb | 116 ++++++++--------------
config/locales/projects/zh.yml | 2 +-
2 files changed, 45 insertions(+), 73 deletions(-)
diff --git a/app/views/projects/_tools_expand.html.erb b/app/views/projects/_tools_expand.html.erb
index 4cf7ebcab..85c8ca6b1 100644
--- a/app/views/projects/_tools_expand.html.erb
+++ b/app/views/projects/_tools_expand.html.erb
@@ -43,97 +43,69 @@
<% if User.current.admin? %>
- 软件知识库
- <%#= link_to l(:label_project_soft_knowledge) ,soft_knowledge_project_path(@project) %>
- <% end %>
-
-
- <% if User.current.admin? %>
- 软件资源库
- <%#= link_to l(:label_project_soft_file) ,soft_file_project_path(@project) %>
- <% end %>
-
-
-
- <% if User.current.admin? %>
- <%= link_to l(:label_project_dts_new) ,dts_dep_project_path(@project), data: { confirm:'你确定要对本项目进行代码缺陷测试分析吗?' } %>
- <% end %>
-
-
-
- <% if User.current.admin? %>
- 在线开发平台
- <%#= link_to l(:label_project_online_dev) ,online_dev_project_path(@project) %>
- <% end %>
-
-
- <% if User.current.admin? %>
- 软工服务平台
+ QoS评估工具
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
-
<% if User.current.admin? %>
- 形式验证工具
+ QoS证据采集工具
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
-
<% if User.current.admin? %>
- QoS 评估工具
+ QoS证据评估统计分析工具
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
-
<% if User.current.admin? %>
- QoS 证据采集工具
- <%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
+ <%= link_to "代码缺陷测试工具(DTS)" ,dts_dep_project_path(@project), data: { confirm:'你确定要对本项目进行代码缺陷测试分析吗?' } %>
+ <% end %>
+
+
+ <% if User.current.admin? %>
+ 软工服务平台(SASSP)
+ <% end %>
+
+
+ <% if User.current.admin? %>
+ 软件知识库(KnowledgeBase)
+ <% end %>
+
+
+ <% if User.current.admin? %>
+ 可信评估工具(Evaluator)
+ <% end %>
+
+
+ <% if User.current.admin? %>
+ 在线验证工具(BACH-Online)
+ <% end %>
+
+
+ <% if User.current.admin? %>
+ 软件测试工具(SSCC-Web)
+ <% end %>
+
+
+ <% if User.current.admin? %>
+ 服务资源共享平台(ServiceXchange)
+ <% end %>
+
+
+ <% if User.current.admin? %>
+ 在线服务开发平台(ServiceFoundry)
+ <% end %>
+
+
+ <% if User.current.admin? %>
+ 组合开发和运行演化平台(Service4All)
<% end %>
-
- <% if User.current.admin? %>
- 可信度评估工具 SAS
-
- <%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
- <% end %>
-
-
- <% if User.current.admin? %>
- 可信评估工具 Evaluator
- <%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
- <% end %>
-
-
- <% if User.current.admin? %>
- 软件测试工具 SSCC-Web
- <%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
- <% end %>
-
-
-
-
-
-
-
-
- <% if User.current.admin? %>
- QoS 证据评估统计分析工具
- <%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
- <% end %>
-
-
-
- <% if User.current.admin? %>
- 在线验证工具 BACH-Online
- <%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
- <% end %>
-
diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml
index e1971cfb9..6c2646acf 100644
--- a/config/locales/projects/zh.yml
+++ b/config/locales/projects/zh.yml
@@ -92,7 +92,7 @@ zh:
label_project_dts_new: DTS缺陷测试
label_project_dts_statics: DTS缺陷报告
- label_project_dts_yun: 云化部署
+ label_project_dts_yun: 云化部署工具
label_project_soft_knowledge: 软件知识库
label_project_soft_file: 软件资源库
label_project_online_dev: 在线开发平台
From 5bd1cdc4eb20464bf37aee1747e2e2630d415074 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 22 Jul 2015 10:06:55 +0800
Subject: [PATCH 09/10] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF=E7=9A=84=E5=AD=98=E5=82=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/student_work_controller.rb | 1 +
app/models/student_work_test.rb | 2 +-
.../20150722015428_add_errormsg_to_studen_work_test.rb | 9 +++++++++
3 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 209fa7269..e885a780a 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -396,6 +396,7 @@ class StudentWorkController < ApplicationController
if student_work_test.result == 0
student_score_count += 1
end
+ student_work_test.error_msg = params[:compile_error_msg]
student_work_test.save!
end
end
diff --git a/app/models/student_work_test.rb b/app/models/student_work_test.rb
index 2e6efdf0a..413528b82 100644
--- a/app/models/student_work_test.rb
+++ b/app/models/student_work_test.rb
@@ -1,6 +1,6 @@
# encoding: utf-8
class StudentWorkTest < ActiveRecord::Base
- attr_accessible :student_work_id, :homework_test_id, :result
+ attr_accessible :student_work_id, :homework_test_id, :result, :error_msg
belongs_to :homework_test
belongs_to :student_work
diff --git a/db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb b/db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb
new file mode 100644
index 000000000..e3f0611db
--- /dev/null
+++ b/db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb
@@ -0,0 +1,9 @@
+class AddErrormsgToStudenWorkTest < ActiveRecord::Migration
+ def up
+ add_column :student_work_tests,:error_msg,:text
+ end
+
+ def down
+ remove_column :student_work_tests,:error_msg,
+ end
+end
From ec4395c30c9460c0d5a9b7f84cbbbce9dc5f65df Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 22 Jul 2015 10:18:01 +0800
Subject: [PATCH 10/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E5=93=81?=
=?UTF-8?q?=E6=9D=83=E9=99=90=E5=AF=B9admin=E7=94=A8=E6=88=B7=E5=85=AC?=
=?UTF-8?q?=E5=BC=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/student_work_controller.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index e885a780a..da2575456 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -157,7 +157,7 @@ class StudentWorkController < ApplicationController
end
def edit
- if @homework.homework_type == 2 #编程作业不能修改作业
+ if !User.current.admin? && @homework.homework_type == 2 #编程作业不能修改作业
render_403
else
respond_to do |format|
@@ -445,7 +445,7 @@ class StudentWorkController < ApplicationController
#判断是不是当前作品的提交者
#提交者 && (非匿评作业 || 未开启匿评) 可以编辑作品
def author_of_work
- render_403 unless (User.current.id == @work.user_id || User.current.admin?) && (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 )
+ render_403 unless User.current.admin? || (User.current.id == @work.user_id && @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 )
end
def teacher_of_course