From 9645d6f0c0e584631f3a72aaa7c06542d658f8d8 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 30 Oct 2014 09:33:30 +0800
Subject: [PATCH 001/146] 1
---
app/controllers/zipdown_controller.rb | 69 ++++++---------------------
1 file changed, 14 insertions(+), 55 deletions(-)
diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb
index 8b93d7443..e617829b6 100644
--- a/app/controllers/zipdown_controller.rb
+++ b/app/controllers/zipdown_controller.rb
@@ -33,8 +33,6 @@ class ZipdownController < ApplicationController
rescue Exception => e
render file: 'public/no_file_found.html' , :layout => 'course_base'
- #logger.error "[ZipDown] ===> #{e}"
- #@error = e
end
#下载某一学生的作业的所有文件
@@ -69,7 +67,6 @@ class ZipdownController < ApplicationController
user_zip_paths = homeattaches.map do |homeattach|
zip_homework_by_user homeattach
end
- #zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER
user_zip_paths
end
@@ -87,32 +84,17 @@ class ZipdownController < ApplicationController
#has_file = true unless has_file
end
end
- #unless has_file
- # render file: 'public/no_file_fond.html' , :layout => 'course_base'
- #end
zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER
-
- #@paths = homeworks_attach_path
- #zipfile = ziping homeworks_attach_path
- #send_file zipfile, :filename => bid.name,
- # :type => detect_content_type(zipfile)
- #rescue Errno::ENOENT => e
- # logger.error "[Errno::ENOENT] ===> #{e}"
- # @error = e
end
def zip_homework_by_user(homeattach)
- #if homeattach.attachments.count > 0
- homeworks_attach_path = []
- # 需要将所有homework.attachments遍历加入zip
- # 并且返回zip路径
- user_attaches_paths = homeattach.attachments.each do |attach|
- #length = attach.storage_path.length
- homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
- end
- zipping("#{homework.user.user_extensions.student_id}_#{homeattach.user.name.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
- #user_attaches_paths
- #end
+ homeworks_attach_path = []
+ # 需要将所有homework.attachments遍历加入zip
+ # 并且返回zip路径
+ user_attaches_paths = homeattach.attachments.each do |attach|
+ homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
+ end
+ zipping("#{homeattach.user.name.to_s}_#{Time.now.to_i}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
end
@@ -121,19 +103,19 @@ class ZipdownController < ApplicationController
ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE')
input_filename = files_paths
- rename_zipfile = zip_name_refer ||= "archive_#{Time.now.to_i}.zip"
+ rename_zipfile = zip_name_refer ||= "archive_#{Time.now.to_i}.zip"
zipfile_name = "#{output_path}/#{rename_zipfile}"
Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
- input_filename.each do |filename|
- rename_file = Time.now.to_i.to_s+ ic.iconv( (File.basename(filename)) ).to_s
- rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment
+ input_filename.each do |filename|
+ rename_file = Time.now.to_i.to_s+ ic.iconv( (File.basename(filename)) ).to_s
+ rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment
- zipfile.add(rename_file, filename)
- end
- zipfile.get_output_stream('ReadMe') do |os|
+ zipfile.add(rename_file, filename)
+ end
+ zipfile.get_output_stream('ReadMe') do |os|
os.write 'Homeworks'
end
end
@@ -142,28 +124,6 @@ class ZipdownController < ApplicationController
logger.error "[zipdown#zipping] ===> #{e}"
@error = e
end
-
- #def ziping files_path
- # ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE')
- # folder = SaveFolder
- # input_filename = files_path
- # zipfile_name = "#{OutputFolder}/archive_#{Time.now.to_i}.zip"
- #
- # Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))
- # Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
- # input_filename.each do |filename|
- # zipfile.add(ic.iconv(filename_to_real(File.basename(filename))), folder + '/' + filename)
- # end
- # zipfile.get_output_stream("ReadMe") { |os|
- # os.write "Homeworks"
- # }
- # end
- # zipfile_name
- #rescue Errno => e
- # logger.error "[zipdown#zipping] ===> #{e}"
- # @error = e
- #end
-
def detect_content_type(name)
content_type = Redmine::MimeType.of(name)
content_type.to_s
@@ -173,5 +133,4 @@ class ZipdownController < ApplicationController
attach = Attachment.find_by_disk_filename(name)
attach.filename
end
-
end
From 9434ec69d2c5c8f48c63de36c94eff19b08018b6 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 30 Oct 2014 10:28:26 +0800
Subject: [PATCH 002/146] 1
---
app/views/layouts/base_homework.html.erb | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb
index 4fb97bf24..d3a5f5b07 100644
--- a/app/views/layouts/base_homework.html.erb
+++ b/app/views/layouts/base_homework.html.erb
@@ -254,22 +254,7 @@
-
- -
- <%= link_to l(:label_question_student), {:controller => 'bids', :action => 'show'}, :class => link_class(:respond) %>
-
- <% if User.current.member_of_course? course %>
- -
- <% if User.current.logged? && course && (!Member.where('user_id = ? and course_id = ?', User.current.id, course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, course.id).first.roles&Role.where('id = ? or id = ? or id =?', 5, 10, 7)).size >0) %>
- <%= link_to l(:label_homework_commit), course_for_bid_path, :class => link_class(:course) %>
- <% else %>
- <%= link_to l(:label_homework_info), course_for_bid_path, :class => link_class(:course) %>
- <% end %>
-
- <% end %>
-
-
-
+
<%= yield %>
From 7ec738dd874b2bb7e8d8fc64c8067059691dfe7e Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 30 Oct 2014 10:43:19 +0800
Subject: [PATCH 003/146] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9B=B8=E5=85=B3css?=
=?UTF-8?q?=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_homework.html.erb | 17 +++-
public/stylesheets/css.css | 106 +++++++++++++++++++++++
2 files changed, 122 insertions(+), 1 deletion(-)
create mode 100644 public/stylesheets/css.css
diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb
index d3a5f5b07..4fb97bf24 100644
--- a/app/views/layouts/base_homework.html.erb
+++ b/app/views/layouts/base_homework.html.erb
@@ -254,7 +254,22 @@
-
+
+ -
+ <%= link_to l(:label_question_student), {:controller => 'bids', :action => 'show'}, :class => link_class(:respond) %>
+
+ <% if User.current.member_of_course? course %>
+ -
+ <% if User.current.logged? && course && (!Member.where('user_id = ? and course_id = ?', User.current.id, course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, course.id).first.roles&Role.where('id = ? or id = ? or id =?', 5, 10, 7)).size >0) %>
+ <%= link_to l(:label_homework_commit), course_for_bid_path, :class => link_class(:course) %>
+ <% else %>
+ <%= link_to l(:label_homework_info), course_for_bid_path, :class => link_class(:course) %>
+ <% end %>
+
+ <% end %>
+
+
+
<%= yield %>
diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css
new file mode 100644
index 000000000..ecab893ec
--- /dev/null
+++ b/public/stylesheets/css.css
@@ -0,0 +1,106 @@
+/* CSS Document */
+body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
+div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
+div,img,tr,td{ border:0;}
+table,tr,td{border:0; cellspacing:0; cellpadding:0;}
+ul,li{ list-style-type:none}
+.cl{ clear:both; overflow:hidden; }
+a{ text-decoration:none; }
+a:hover{ text-decoration:underline;}
+
+
+.container{ width:940px; margin:0 auto; padding-top:125px;}
+
+
+/* 作业列表 */
+.ttl{ }
+.ctt{height:820px;clear:both; }
+#content{float:right;clear:both;width:693px;/*滑动门的宽度*/}
+/* TAB 切换效果 */
+.tb_{ background-color: #eaeaea; height:40px; }
+.tb_ ul{height:40px; }
+.tb_ li{float:left;height:35px;width: 90px;cursor:pointer; font-size:14px; padding-top:5px; text-align:center; }
+
+/* 控制显示与隐藏css类 */
+.normaltab { color:#64bdd9 ; }
+.hovertab { color:#fff; background-color:#64bdd9; }
+.normaltab a { color:#64bdd9 ; }
+.hovertab a{color:#fff; background-color:#64bdd9; text-decoration:none;}
+.dis{display:block; }
+.undis{display:none;}
+
+.c_red{ color:#de030d;}
+.f_12{ font-size:12px;}
+
+.dis ul{ height:75px; border-bottom:1px dashed #64bdd9;}
+.dis ul li{ float:left;}
+.dis ul li a{ display:block; color:#15bccf;}
+.pic_head{ width:40px; padding:8px 15px 0 8px; }
+.pic_head img{ border:1px solid #fff;}
+.pic_head img:hover{border:1px solid #15bccf;}
+.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:20px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
+.dis ul li.wdown a{padding-top:22px; color:#3d7ec2; margin-right:43px;}
+.wscore{ padding-top:22px; color:#888888;}
+.dis ul li.wping{margin-left:16px; }
+.dis ul li.wping a{ margin-top:18px; margin-bottom:3px; width:43px; height:23px; background:#15bccf; color:#fff; text-align:center; padding-top:3px;}
+.dis ul li.wping a:hover{ background-color:#03a1b3;}
+ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
+.wlist a{ border:1px solid #15bccf; padding:0 5px; margin-left:3px;}
+.wlist a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
+.code_list{ float:right; font-size:12px; color:#484848; padding:5px 3px; border-bottom:2px solid #15bccf; width:687px; }
+.code_list a{ color:#787878;}
+.fr{ float:right;}
+.c_grey{ color:#999; font-weight:normal;}
+
+.msg_box{ width:693px; height:170px; border-bottom:1px dashed #CCC; padding-top:20px;}
+.msg_box h4{ margin-left:15px;}
+.msg_box textarea{width:660px;height:90px;padding:2px;overflow:hidden;background-color: #ffffff; border:1px solid #CCC; margin:5px 15px; color:#666; font-size:12px;}
+.msg_box a{ float:right; display:block; width:50px; height:22px; background:#15bccf; color:#fff; margin-right:10px; text-align:center; margin-top:5px; }
+.msg_box a:hover{ background-color:#03a1b3; text-decoration:none;}
+
+
+/****评分弹框****/
+#popbox{width:488px;height:550px;position:absolute;z-index:100;left:50%;top:40%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; padding:5px; overflow:auto; }
+.alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(images/close.png) no-repeat;cursor:pointer;}
+.alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; }
+
+.ping_con{ margin:5px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
+.ping_con ul{ height:30px;}
+.ping_con ul li{ float:left; color:#656767; font-weight:bold;}
+.ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; }
+.ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
+.ping_con p span a{ color:#777777;}
+.ping_star{ width:160px; color:#333; font-weight:bold; margin-bottom:5px;}
+.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png) -2px 0 no-repeat; margin-right:3px;}
+.ping_star span a:hover{background:url(images/star.png) -24px 0 no-repeat;}
+.ping_con textarea{ width:455px; height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
+a.ping_sub{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;}
+a:hover.ping_sub{ background:#14a8b9;}
+
+.ping_list{ margin-top:15px;}
+
+.ping_ttl{height:18px;}
+.ping_ctt{height:auto;padding:6px;clear:both;}
+.ping_tb_{ border-bottom:3px solid #e4e4e4; text-align:center;}
+.ping_tb_ ul{height:24px;}
+.ping_tb_ li{float:left;height: 24px;width: auto; padding:0 10px;cursor:pointer;}
+.ping_normaltab { color:#15bccf ; border-bottom:3px solid #e4e4e4;}
+.ping_hovertab { color:#656767; font-weight:bold; border-bottom:3px solid #15bccf; }
+.ping_dis{display:block; }
+.ping_undis{display:none;}
+
+.ping_C{border-bottom:1px dashed #CCC; padding:5px;}
+.ping_dispic a{ display:block; height:46px; width:46px; border:1px solid #CCC; padding:1px; float:left;}
+.ping_discon{ float:left; width:384px; margin-left:15px;}
+.ping_distop span{ float:left;}
+.ping_distop p{ color:#5f5f5f;}
+.ping_disfoot a{ float:right; color:#15bccf; margin-left:5px;}
+
+.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}
+
+
+
+
+
+
+
From ceb181e6699538fe4bb3c10986d7ee67e67d2765 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 30 Oct 2014 10:58:14 +0800
Subject: [PATCH 004/146] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=96=B0=E6=B5=81?=
=?UTF-8?q?=E7=A8=8B=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E9=9D=99=E6=80=81?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_homework.html.erb | 29 --
app/views/bids/_homework_list.html.erb | 373 ++++++++++++++----------
public/stylesheets/css.css | 3 +-
public/stylesheets/images/225905790.jpg | Bin 0 -> 12704 bytes
public/stylesheets/images/close.png | Bin 0 -> 1637 bytes
public/stylesheets/images/pic_down.png | Bin 0 -> 714 bytes
public/stylesheets/images/star.png | Bin 0 -> 1601 bytes
7 files changed, 215 insertions(+), 190 deletions(-)
create mode 100644 public/stylesheets/images/225905790.jpg
create mode 100644 public/stylesheets/images/close.png
create mode 100644 public/stylesheets/images/pic_down.png
create mode 100644 public/stylesheets/images/star.png
diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb
index f3578e713..5071444f4 100644
--- a/app/views/bids/_homework.html.erb
+++ b/app/views/bids/_homework.html.erb
@@ -35,35 +35,6 @@
<% end %>
-
-
-
- <% if @homework_list.empty? %>
-
- <% end %>
- |
-
-
- |
-
-
-
-
- |
-
-
- 项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。
- 项目托管平台:<%= link_to Setting.protocol + "://" + Setting.host_name + "/", home_path %>
- <%= link_to "我要创建项目",new_project_path(course: 0, project_type: 0), :target => '_blank'%>
-
- |
-
-
-
<%= render :partial => 'homework_list', :locals => {:homework => @homework_list} %>
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index 0326f218c..a460a0d7a 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -1,163 +1,218 @@
-
-<% is_student = is_cur_course_student(@bid.courses.first) %>
-<% is_teacher = is_course_teacher(User.current,@bid.courses.first) %>
-
-<% is_evaluation = @bid.is_evaluation == 1 || @bid.is_evaluation == nil %>
-<%= form_tag(:controller => 'bids', :action => "show_courseEx", :method => :get) do %>
-
-
-
- <%= l(:label_task_plural)%>(<%= @homework_list.count%>)
- <%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(is_teacher && @bid.homeworks.count > 0) %>
- |
-
-
- <% if is_teacher %>
- <%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
- <%= submit_tag l(:label_search_by_student_id), :class => "small", :name => nil %>
- <% end %>
-
- |
-
-
-
-<% end %>
-<% display_id = im_watching_student_id? @bid%>
-<% @homework_list.each do |homework|%>
-
-
-
-
- <% user_name = is_teacher ? (homework.user.lastname + homework.user.firstname) : homework.user.login %>
-
- <%= image_tag(url_to_avatar(homework.user), :class => "avatar")%> |
-
-
-
-
-
- <%= link_to user_name, user_path(homework.user),{:style => "color:#727272"} %>
-
- |
-
-
-
- <% if (users_for_homework(homework).include?(User.current) || is_teacher) %>
- <%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
- <% if homework.user == User.current || is_teacher %>
- <%= link_to(l(:label_bid_respond_delete), homework,
- method: :delete, :confirm => l(:text_are_you_sure)) %>
- <% end %>
- <% 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).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
- 迟交
- <% end %>
- |
-
+
+
+ 作业列表页_老师界面
+
+ <%= stylesheet_link_tag 'css', :media => 'all' %>
+
-
-
- 开发项目:
- <% if homework.project != nil %>
-
- <%= link_to homework.project.name,project_path(homework.project.id)%>
-
- <% else %>
- 暂无
- <% end %>
- |
-
- 项目得分:
- ;">
- <%= homework.project.nil? ? "N/A" : project_scores(homework.project) %>
-
-
- |
-
+
+
+
+
+ - 未批作业
+ - 已改作业
+ - 全部作业
+ - 作业下载
+ - 留言(23)
-
-
- 提交文件:
- <% 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 = homework.s_score.nil? ? "N/A" : format("%.2f",homework.s_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 %>
- |
-
- 终评得分:
- <%# totle_homework_score = score_for_homework(homework) %>
- <% totle_homework_score = format("%.2f",(homework.t_score.nil? ? 0.00 : homework.t_score) * ((@bid.proportion.nil? ? 60 : @bid.proportion) * 1.0 / 100) +
- (homework.s_score.nil? ? 0.00 : homework.s_score) * (1 - (@bid.proportion.nil? ? 60 : @bid.proportion) * 1.0 / 100)) %>
- ;">
- <% score = totle_homework_score == "0.00"? "N/A" : totle_homework_score %>
- <%= score %>
-
- <% if is_teacher %>
- <%= link_to "教师评分>>",homework_attach_path(homework) %>
- <% end %>
-
- |
-
-
- |
-
-
-
-<% end %>
-
-
\ No newline at end of file
+
+