diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 50f303700..04a07e9a8 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -93,7 +93,7 @@ class HomeworkCommonController < ApplicationController
if homework.homework_type == 2
homework_detail_programing = HomeworkDetailPrograming.new
- homework_detail_programing.language = "C++"
+ homework_detail_programing.language = params[:language]
homework_detail_programing.standard_code = params[:standard_code]
homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6
question = {title:homework.name,content:homework.description}
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index dae0bcab6..da2575456 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -128,7 +128,7 @@ class StudentWorkController < ApplicationController
solutions = {
student_work_id:stundet_work.id,
src:Base64.encode64(stundet_work.description),
- language:1
+ language:@homework.homework_detail_programing.language
}
uri = URI(url)
body = solutions.to_json
@@ -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|
@@ -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
@@ -444,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
diff --git a/app/helpers/homework_common_helper.rb b/app/helpers/homework_common_helper.rb
index 81f817ee9..49384cca4 100644
--- a/app/helpers/homework_common_helper.rb
+++ b/app/helpers/homework_common_helper.rb
@@ -27,6 +27,19 @@ module HomeworkCommonHelper
type
end
+ def programing_languages_options
+ type = []
+ option = []
+ option << "C"
+ option << 1
+ type << option
+ option_1 = []
+ option_1 << "C++"
+ option_1 << 2
+ type << option_1
+ type
+ end
+
#缺评扣分
def absence_penalty_option
type = []
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
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/app/views/homework_common/_homework_detail_programing_form.html.erb b/app/views/homework_common/_homework_detail_programing_form.html.erb
index e27fb5b9e..5d1d5ce88 100644
--- a/app/views/homework_common/_homework_detail_programing_form.html.erb
+++ b/app/views/homework_common/_homework_detail_programing_form.html.erb
@@ -56,9 +56,7 @@
开发语言:
-
- C
-
+ <%= select_tag :language,options_for_select(programing_languages_options,homework.homework_detail_programing.language), {:class => "fl mb10 h26 w70"} %>
diff --git a/app/views/homework_common/new.html.erb b/app/views/homework_common/new.html.erb
index 6fc0fff0e..cdc2ceca0 100644
--- a/app/views/homework_common/new.html.erb
+++ b/app/views/homework_common/new.html.erb
@@ -1,17 +1,27 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
-<%= error_messages_for 'homework_common' %>
<%= l(:label_course_homework_new)%>
-
- <%= 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%>
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/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
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
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/_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%>
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") %>
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: 在线开发平台
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