diff --git a/app/views/admin/messages.html.erb b/app/views/admin/messages.html.erb
index 10169f30b..1d9f0cc10 100644
--- a/app/views/admin/messages.html.erb
+++ b/app/views/admin/messages.html.erb
@@ -12,7 +12,7 @@
- <%= link_to l(:label_submit), "javascript:void(0)",:class => "small", :onclick => "system_message_editor.sync();submit_message();" %>
+ <%= link_to l(:label_submit), "javascript:void(0)", :class => "btn_message_free", :onclick => "system_message_editor.sync();submit_message();" %>
<% end %>
diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb
index 694069b44..a39f93671 100644
--- a/app/views/homework_common/index.html.erb
+++ b/app/views/homework_common/index.html.erb
@@ -25,8 +25,8 @@
( <%= link_to homework.student_works.count, student_work_index_path(:homework => homework.id), :class => 'c_red'%> )
<% if @is_teacher%>
- <%= homework_anonymous_comment(homework)%>
- <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
+ <%#= homework_anonymous_comment(homework)%>
+ <%#= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
<%#= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %>
<% elsif @is_student%>
<%= student_anonymous_comment homework %>
diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb
index b259e20a5..10e1870ef 100644
--- a/app/views/student_work/_programing_work_show.html.erb
+++ b/app/views/student_work/_programing_work_show.html.erb
@@ -25,40 +25,44 @@
<% if @is_teacher%>
- 测试结果:
-
-
-
- 输入 |
- 输出 |
- 测试结果 |
-
- <%@homework.homework_tests.each do |test|%>
- ">
-
- <%= test.input%>
- |
-
- <%= test.output%>
- |
- <% student_work_test = StudentWorkTest.where(:homework_test_id => test.id,:student_work_id => @work.id).first%>
- <%= student_work_test.nil? ? "正在编译" : student_work_test.status_to_s%> |
-
-
- <% end%>
- <% student_work_test = @work.student_work_test.first%>
- <% if student_work_test && student_work_test.error_msg && !student_work_test.error_msg.empty?%>
-
-
- <%= student_work_test.error_msg%>
- |
-
- <% end%>
-
-
-
-
+
+
+ 测试结果:
+
+
+ <% @work.student_work_tests.each_with_index do |test, index| %>
+
+
第<%= @work.student_work_tests.count - index%>次测试
<%= test.created_at.to_s(:db) %>
+
+
+ <% if test.status.to_i == -2 %>
+
<%= test.results.first %>
+ <% else %>
+
+
+ <% test.results.each_with_index do |x, i| %>
+ -
+ 测试<%=i+1%>
+ <% if x["status"].to_i != 0 %>
+ 测试错误!
+ 您的输出:
+ <%=x["result"]%>
+ 正确输出:
+ <%=x["output"]%>
+
+ <% else %>
+ 测试正确!
+
+ <% end %>
+
+ <% end %>
+
+
+ <% end %>
+ <% end %>
+
+
<%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%>
diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb
index e8fa33902..d128eab67 100644
--- a/app/views/student_work/index.html.erb
+++ b/app/views/student_work/index.html.erb
@@ -123,7 +123,7 @@
<%= @homework.name%>
<% if @is_teacher%>
- <%= homework_anonymous_comment(@homework)%>
+ <%#= homework_anonymous_comment(@homework)%>
<% else%>
<%= student_anonymous_comment @homework %>
<%= student_new_homework @homework %>
diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb
index b22053f6d..6e07e7122 100644
--- a/app/views/users/_user_homework_form.html.erb
+++ b/app/views/users/_user_homework_form.html.erb
@@ -10,7 +10,7 @@
diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb
index 8b02b4594..ab7cb5b59 100644
--- a/app/views/users/new_user_commit_homework.html.erb
+++ b/app/views/users/new_user_commit_homework.html.erb
@@ -70,11 +70,15 @@
请使用 <%= @homework.language_name %> 语言编写
-
+
<%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能" %>
<%= f.text_area :description, id: 'program-src', class:"InputBox W700 H150", placeholder:"请贴入你的代码", rows: 10 %>
+
测试代码
diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb
index a9fb0ffbd..a184a6d7e 100644
--- a/app/views/users/user_messages.html.erb
+++ b/app/views/users/user_messages.html.erb
@@ -99,7 +99,7 @@
<%= time_tag(ma.created_at).html_safe %>
<% end %>
- <% if ma.course_message_type == "HomeworkCommon" %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status != 1 %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">发布了作业:
diff --git a/db/migrate/20150911064528_alter_user_activities.rb b/db/migrate/20150911064528_alter_user_activities.rb
index a65f933d8..b6ede5bdb 100644
--- a/db/migrate/20150911064528_alter_user_activities.rb
+++ b/db/migrate/20150911064528_alter_user_activities.rb
@@ -1,21 +1,16 @@
class AlterUserActivities < ActiveRecord::Migration
def up
- count = UserActivity.all.count / 30 + 3
- transaction do
- for i in 1 ... count do i
- UserActivity.page(i).per(30).each do |activity|
- if activity.act_type == 'Message'
- if activity.act
- unless activity.act.parent_id.nil?
- parent_act = UserActivity.where("act_id = #{activity.act.parent.id} and act_type='Message'").first
- parent_act.created_at = activity.act.parent.children.maximum("created_on")
- parent_act.save
- activity.destroy
- end
- else
- activity.destroy
- end
+ UserActivity.all.each do |activity|
+ if activity.act_type == 'Message'
+ if activity.act
+ unless activity.act.parent_id.nil?
+ parent_act = UserActivity.where("act_id = #{activity.act.parent.id} and act_type='Message'").first
+ parent_act.created_at = activity.act.parent.children.maximum("created_on")
+ parent_act.save
+ activity.destroy
end
+ else
+ activity.destroy
end
end
end
diff --git a/db/schema.rb b/db/schema.rb
index 850160f9c..4dd7f1b68 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20150911031029) do
+ActiveRecord::Schema.define(:version => 20150911064528) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -236,6 +236,13 @@ ActiveRecord::Schema.define(:version => 20150911031029) do
t.boolean "tracker_in_review_dialog", :default => false
end
+ create_table "code_review_user_settings", :force => true do |t|
+ t.integer "user_id", :default => 0, :null => false
+ t.integer "mail_notification", :default => 0, :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
create_table "code_reviews", :force => true do |t|
t.integer "project_id"
t.integer "change_id"
@@ -469,6 +476,13 @@ ActiveRecord::Schema.define(:version => 20150911031029) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
+ create_table "discuss_demos", :force => true do |t|
+ t.string "title"
+ t.text "body"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "documents", :force => true do |t|
t.integer "project_id", :default => 0, :null => false
t.integer "category_id", :default => 0, :null => false
@@ -483,23 +497,26 @@ ActiveRecord::Schema.define(:version => 20150911031029) do
add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
add_index "documents", ["project_id"], :name => "documents_project_id"
- create_table "dts", :force => true do |t|
- t.string "IPLineCode"
- t.string "Description"
- t.string "Num"
- t.string "Variable"
- t.string "TraceInfo"
- t.string "Method"
+ create_table "dts", :primary_key => "Num", :force => true do |t|
+ t.string "Defect", :limit => 50
+ t.string "Category", :limit => 50
t.string "File"
- t.string "IPLine"
- t.string "Review"
- t.string "Category"
- t.string "Defect"
- t.string "PreConditions"
- t.string "StartLine"
+ t.string "Method"
+ t.string "Module", :limit => 20
+ t.string "Variable", :limit => 50
+ t.integer "StartLine"
+ t.integer "IPLine"
+ t.string "IPLineCode", :limit => 200
+ t.string "Judge", :limit => 15
+ t.integer "Review", :limit => 1
+ t.string "Description"
+ t.text "PreConditions", :limit => 2147483647
+ t.text "TraceInfo", :limit => 2147483647
+ t.text "Code", :limit => 2147483647
t.integer "project_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "id", :null => false
end
create_table "enabled_modules", :force => true do |t|
@@ -1162,18 +1179,18 @@ ActiveRecord::Schema.define(:version => 20150911031029) do
create_table "relative_memos", :force => true do |t|
t.integer "osp_id"
t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :null => false
+ t.string "subject", :null => false
+ t.text "content", :limit => 16777215, :null => false
t.integer "author_id"
- t.integer "replies_count", :default => 0
+ t.integer "replies_count", :default => 0
t.integer "last_reply_id"
- t.boolean "lock", :default => false
- t.boolean "sticky", :default => false
- t.boolean "is_quote", :default => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "viewed_count_crawl", :default => 0
- t.integer "viewed_count_local", :default => 0
+ t.boolean "lock", :default => false
+ t.boolean "sticky", :default => false
+ t.boolean "is_quote", :default => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "viewed_count_crawl", :default => 0
+ t.integer "viewed_count_local", :default => 0
t.string "url"
t.string "username"
t.string "userhomeurl"
@@ -1198,6 +1215,19 @@ ActiveRecord::Schema.define(:version => 20150911031029) do
add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
+ create_table "rich_rich_files", :force => true do |t|
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "rich_file_file_name"
+ t.string "rich_file_content_type"
+ t.integer "rich_file_file_size"
+ t.datetime "rich_file_updated_at"
+ t.string "owner_type"
+ t.integer "owner_id"
+ t.text "uri_cache"
+ t.string "simplified_type", :default => "file"
+ end
+
create_table "roles", :force => true do |t|
t.string "name", :limit => 30, :default => "", :null => false
t.integer "position", :default => 1
@@ -1249,10 +1279,11 @@ ActiveRecord::Schema.define(:version => 20150911031029) do
t.string "url"
t.string "title"
t.integer "share_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.integer "project_id"
t.integer "user_id"
+ t.string "description"
end
create_table "softapplications", :force => true do |t|
@@ -1422,8 +1453,8 @@ ActiveRecord::Schema.define(:version => 20150911031029) do
t.integer "zip_code"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
- t.integer "identity"
t.string "technical_title"
+ t.integer "identity"
t.string "student_id"
t.string "teacher_realname"
t.string "student_realname"
@@ -1491,9 +1522,6 @@ ActiveRecord::Schema.define(:version => 20150911031029) do
t.integer "active"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
- t.integer "level"
- t.integer "file"
- t.integer "issue"
end
create_table "user_statuses", :force => true do |t|
diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js
index 45902ef16..ca07093fe 100644
--- a/public/javascripts/homework.js
+++ b/public/javascripts/homework.js
@@ -95,9 +95,9 @@ $(function(){
//发布作业
- $('#program-src').focus(function(){
- $(this).css('height', '100px');
- });
+ //$('#program-src').focus(function(){
+ // $(this).css('height', '100px');
+ //});
var datepickerOptions={dateFormat:'yy-mm-dd',firstDay:0,showWeek:true,showOtherMonths:true,selectOtherMonths:true};
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 8fdb26ffc..ac983479a 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -2809,4 +2809,5 @@ img.school_avatar {
max-width: none;
}
-.admin_message_warn{font-size: 12px;color: red;}
\ No newline at end of file
+.admin_message_warn{font-size: 12px;color: red;}
+a.btn_message_free{ background:#15BCCF; display:block; text-align:center; color:#fff; padding:3px 0; width:60px; margin-bottom:10px;}
\ No newline at end of file
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index bd71ef270..0111ec212 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -680,6 +680,8 @@ a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}
/*20150826协议 LB*/
.AgreementBox{ margin:20px 0; color:#666666; font-size:14px; line-height:1.9;}
.Agreementh4{ color:#2980b9; font-weight:bold; font-size:14px; margin-top:30px; border: none;}
+.AgreementTxt{text-indent: 2em; margin-bottom: 15px;}
+.AgreementImg{margin: 0px auto; width: 820px;}
/*底部*/
#Footer{background-color:#ffffff; padding-bottom:15px; color:#666666;} /*margin-bottom:10px;*/
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 5ff90bb43..e291e503a 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -19,7 +19,7 @@ table{ background:#fff;}
.line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;}
.no_border{ border:none;}
.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/new_project/public_icon.png) 135px -193px no-repeat;}
-
+a.btn_message_free{ background:#ff5722; display:block; text-align:center; color:#fff; padding:3px 0; width:80px; margin-bottom:10px;}
/* font & color */
h2{ font-size:18px; color:#15bccf;}
h3{ font-size:14px; color:#e8770d;}
@@ -536,5 +536,6 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;}
}
.AgreementBox{margin: 20px 0; color: #666666; font-size: 14px; line-height: 1.9;}
+.Agreementh4{ color:#2980b9; font-weight:bold; font-size:14px; margin-top:30px; border: none;}
.AgreementTxt{text-indent: 2em; margin-bottom: 15px;}
.AgreementImg{margin: 0px auto; width: 820px;}
diff --git a/public/stylesheets/public_new.css b/public/stylesheets/public_new.css
index 555cef836..7cd0a461c 100644
--- a/public/stylesheets/public_new.css
+++ b/public/stylesheets/public_new.css
@@ -789,3 +789,9 @@ div.flash.warning, .conflict {
/*消息铃铛样式*/
.navHomepageNews {width:30px; display:block; float:right; margin-top:4px; position:relative; margin-right: 8px;}
.newsActive {width:6px; height:6px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:20px; top:8px;z-index:999}
+
+/*20150826协议 LB*/
+.AgreementBox{ margin:20px 0; color:#666666; font-size:14px; line-height:1.9;}
+.Agreementh4{ color:#2980b9; font-weight:bold; font-size:14px; margin-top:30px; border: none;}
+.AgreementTxt{text-indent: 2em; margin-bottom: 15px;}
+.AgreementImg{margin: 0px auto; width: 820px;}
\ No newline at end of file