From 7702b746c623d663bae331eeb77b04d7b12ee0d0 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 26 Jun 2014 10:55:50 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=95=8C=E9=9D=A2=EF=BC=8C=E6=8F=90=E4=BA=A4?=
=?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=8C=89=E9=92=AE=E4=B8=8D=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_homework.html.erb | 2 +-
db/schema.rb | 74 ++++--------------------
2 files changed, 12 insertions(+), 64 deletions(-)
diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb
index ac10931dc..396457c35 100644
--- a/app/views/layouts/base_homework.html.erb
+++ b/app/views/layouts/base_homework.html.erb
@@ -211,7 +211,7 @@
<% if User.current.logged? && @bid.courses.first && (!Member.where('user_id = ? and course_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?', 5, 10, 7)).size >0) %>
<%= link_to l(:label_homework_commit), {:controller => 'bids', :action => 'show_course'}, :class => link_class(:course) %>
diff --git a/db/schema.rb b/db/schema.rb
index 67da188af..0032afedb 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -175,58 +175,6 @@ ActiveRecord::Schema.define(:version => 20140618155324) do
add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true
- create_table "code_review_assignments", :force => true do |t|
- t.integer "issue_id"
- t.integer "change_id"
- t.integer "attachment_id"
- t.string "file_path"
- t.string "rev"
- t.string "rev_to"
- t.string "action_type"
- t.integer "changeset_id"
- end
-
- create_table "code_review_project_settings", :force => true do |t|
- t.integer "project_id"
- t.integer "tracker_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "updated_by"
- t.boolean "hide_code_review_tab", :default => false
- t.integer "auto_relation", :default => 1
- t.integer "assignment_tracker_id"
- t.text "auto_assign"
- t.integer "lock_version", :default => 0, :null => false
- 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"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "line"
- t.integer "updated_by_id"
- t.integer "lock_version", :default => 0, :null => false
- t.integer "status_changed_from"
- t.integer "status_changed_to"
- t.integer "issue_id"
- t.string "action_type"
- t.string "file_path"
- t.string "rev"
- t.string "rev_to"
- t.integer "attachment_id"
- t.integer "file_count", :default => 0, :null => false
- t.boolean "diff_all"
- end
-
create_table "comments", :force => true do |t|
t.string "commented_type", :limit => 30, :default => "", :null => false
t.integer "commented_id", :default => 0, :null => false
@@ -793,20 +741,20 @@ ActiveRecord::Schema.define(:version => 20140618155324) do
end
create_table "relative_memos", :force => true do |t|
- t.integer "osp_id"
+ t.integer "osp_id", :null => false
t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :limit => 16777215, :null => false
+ t.string "subject", :null => false
+ t.text "content", :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"
From 12087f40c7fcb88d938a4e615f8285fe3cf93902 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 26 Jun 2014 11:22:48 +0800
Subject: [PATCH 2/3] =?UTF-8?q?1.=E5=BD=93=E4=BD=9C=E4=B8=9A=E6=9C=AA?=
=?UTF-8?q?=E9=80=89=E5=AE=9A=E9=A1=B9=E7=9B=AE=E6=97=B6=EF=BC=8C=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E5=BE=97=E5=88=86=E4=B8=BA=E7=81=B0=E8=89=B2=E7=9A=84?=
=?UTF-8?q?N/A=EF=BC=8C=E9=80=89=E5=AE=9A=E4=BA=86=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=EF=BC=8C=E9=A1=B9=E7=9B=AE=E5=BE=97=E5=88=86=E4=B8=BA=E6=A9=98?=
=?UTF-8?q?=E8=89=B2=E7=9A=84=E5=88=86=E6=95=B0=202.=E5=BD=93=E6=97=A0?=
=?UTF-8?q?=E4=BA=BA=E5=AF=B9=E4=BD=9C=E4=B8=9A=E8=BF=9B=E8=A1=8C=E4=BA=92?=
=?UTF-8?q?=E8=AF=84=E3=80=81=E7=BB=BC=E8=AF=84=E6=97=B6=EF=BC=8C=E4=BD=9C?=
=?UTF-8?q?=E4=B8=9A=E7=9A=84=E4=BA=92=E8=AF=84=E3=80=81=E7=BB=BC=E8=AF=84?=
=?UTF-8?q?=E5=BE=97=E5=88=86=E4=B8=BA=E7=81=B0=E8=89=B2=E7=9A=84N/A?=
=?UTF-8?q?=EF=BC=8C=E6=9C=89=E4=BA=BA=E8=BF=9B=E8=A1=8C=E8=AF=84=E5=88=86?=
=?UTF-8?q?=E5=88=99=E4=B8=BA=E6=A9=98=E8=89=B2=E7=9A=84=E5=88=86=E6=95=B0?=
=?UTF-8?q?=203.=E7=AE=80=E5=8C=96=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_homework_list.html.erb | 163 +++++++++++++------------
1 file changed, 83 insertions(+), 80 deletions(-)
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index c1de9629d..705040579 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -58,90 +58,93 @@
-
-
- 作品名称:
- <% if homework.name == nil || homework.name == "" %>
- <% homework_filename = homework.user.name + "提交的作业" %>
- <% else %>
- <% homework_filename = homework.name %>
- <% end %>
-
- <%= link_to homework_filename , homework_attach_path(homework)%>
-
- |
-
- 合作成员:
- <% homework_users = homework_user_of_homework(homework,is_teacher) %>
- <% if homework.users.count == 0 %>
- 无
- <% else %>
- <%= homework_users %>
- <% end %>
- |
-
- <% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %>
- 迟交
- <% end %>
- |
-
+
+
+ 作品名称:
+ <% if homework.name == nil || homework.name == "" %>
+ <% homework_filename = homework.user.name + "提交的作业" %>
+ <% else %>
+ <% homework_filename = homework.name %>
+ <% end %>
+
+ <%= link_to homework_filename , homework_attach_path(homework)%>
+
+ |
+
+ 合作成员:
+ <% homework_users = homework_user_of_homework(homework,is_teacher) %>
+ <% if homework.users.count == 0 %>
+ 无
+ <% else %>
+ <%= homework_users %>
+ <% end %>
+ |
+
+ <% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %>
+ 迟交
+ <% end %>
+ |
+
-
-
- 开发项目:
- <% if homework.project != nil %>
- <%= link_to homework.project.name,project_path(homework.project.id)%>
- <% else %>
- 暂无
- <% end %>
- |
-
- 项目得分:
-
- <% if homework.project != nil %>
- <%= project_score homework.project %>
- <% else %>
- 0.00
- <% end %>
-
-
- |
-
-
-
-
- 提交文件:
- <% if is_evaluation || is_teacher%>
- <%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
- <% else %>
- 未开启互评功能作业不允许下载
- <% end %>
-
- |
-
- 互评得分:
- <%= student_score_for_homework(homework) %>
- <% if is_evaluation && is_student && (!users_for_homework(homework).include? User.current)%>
- <%= link_to "学生互评>>",homework_attach_path(homework) %>
- <% end %>
-
- |
-
+
+
+ 开发项目:
+ <% if homework.project != nil %>
+ <%= link_to homework.project.name,project_path(homework.project.id)%>
+ <% else %>
+ 暂无
+ <% end %>
+ |
+
+ 项目得分:
+ ;">
+ <%= homework.project.nil? ? "N/A" : project_score(homework.project) %>
+
+
+ |
+
+
+
+ 提交文件:
+ <% if is_evaluation || is_teacher%>
+ <%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
+ <% else %>
+ 未开启互评功能作业不允许下载
+ <% end %>
+
+ |
+
+ 互评得分:
+ <% student_homework_score = student_score_for_homework(homework) %>
+ ;">
+ <% score = student_homework_score == "0.00"? "N/A" : student_homework_score %>
+ <%= score %>
+
+ <% if is_evaluation && is_student && (!users_for_homework(homework).include? User.current)%>
+ <%= link_to "学生互评>>",homework_attach_path(homework) %>
+ <% end %>
+
+ |
+
- <% if is_evaluation || is_teacher%>
- <%= render :partial => 'app_link', :locals => {:attachments => homework.attachments} %>
- <% end %>
- |
-
- 终评得分:
- <%= score_for_homework homework %>
- <% if is_teacher %>
- <%= link_to "教师评分>>",homework_attach_path(homework) %>
- <% end %>
-
- |
+ <% if is_evaluation || is_teacher%>
+ <%= render :partial => 'app_link', :locals => {:attachments => homework.attachments} %>
+ <% end %>
+
+
+ 终评得分:
+ <% totle_homework_score = score_for_homework(homework) %>
+ ;">
+ <% score = totle_homework_score == "0.00"? "N/A" : totle_homework_score %>
+ <%= score %>
+
+ <% if is_teacher %>
+ <%= link_to "教师评分>>",homework_attach_path(homework) %>
+ <% end %>
+
+ |
|
From c4b2c47dc76d76b74784f8f89b1cada1eb4e1d1b Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 26 Jun 2014 11:40:54 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_homework.html.erb | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb
index 396457c35..6fb6e71c6 100644
--- a/app/views/layouts/base_homework.html.erb
+++ b/app/views/layouts/base_homework.html.erb
@@ -38,7 +38,7 @@
<%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %>
<%= link_to "主页", home_path %>
> <%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> >
- <%= link_to(@bid.courses.first.name.to_s, homework_course_path(@bid.courses.first)) if @bid.courses.first %>
+ <%= link_to(course.name.to_s, homework_course_path(course)) if course %>
>
<%= link_to(@bid.name, respond_path(@bid)) %> |
@@ -65,7 +65,7 @@
- <%= link_to @bid.courses.first.name.to_s, homework_course_path(@bid.courses.first) if @bid.courses.first %>
+ <%= link_to course.name.to_s, homework_course_path(course) if course %>
|
@@ -211,9 +211,9 @@