From 7a62b7f13d28f175ba05f9aeb5a9bc4b1e3d764d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 21 Sep 2015 17:11:45 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E6=97=B6=E9=97=B4=E5=92=8C=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=97=B6=E9=97=B4=EF=BC=8C=E5=B9=B6=E5=AF=B9?= =?UTF-8?q?=E5=85=B6=E4=B8=9A=E5=8A=A1=E9=80=BB=E8=BE=91=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?js=E7=9A=84=E6=8E=A7=E5=88=B6=E3=80=82=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E8=BF=99=E4=B8=A4=E4=B8=AA=E5=80=BC=E5=BE=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 4 ++ app/controllers/users_controller.rb | 4 +- app/views/student_work/new.html.erb | 2 +- app/views/users/_user_homework_form.html.erb | 8 +++ app/views/users/user_homeworks.html.erb | 1 + db/schema.rb | 33 ++++++------ public/javascripts/new_user.js | 54 ++++++++++++++++--- 7 files changed, 80 insertions(+), 26 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 9d5768948..41d302829 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -150,6 +150,10 @@ class HomeworkCommonController < ApplicationController @homework.end_time = params[:homework_common][:end_time] || Time.now @homework.course_id = params[:course_id] + homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new + homework_detail_manual.evaluation_start = params[:evaluation_start].blank? ? @homework.end_time + 7 : params[:evaluation_start] + homework_detail_manual.evaluation_end = params[:evaluation_end].blank? ? homework_detail_manual.evaluation_start + 7 : params[:evaluation_end] + @homework.save_attachments(params[:attachments]) render_attachment_warning_if_needed(@homework) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0783d1805..76643a099 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -468,8 +468,8 @@ class UsersController < ApplicationController homework_detail_manual = HomeworkDetailManual.new homework_detail_manual.ta_proportion = homework.homework_type == 1 ? 0.6 : 0.3 homework_detail_manual.comment_status = 1 - homework_detail_manual.evaluation_start = Time.now - homework_detail_manual.evaluation_end = Time.now + homework_detail_manual.evaluation_start = params[:evaluation_start].blank? ? homework.end_time + 7 : params[:evaluation_start] + homework_detail_manual.evaluation_end = params[:evaluation_end].blank? ? homework_detail_manual.evaluation_start + 7 : params[:evaluation_end] homework_detail_manual.evaluation_num = params[:evaluation_num] || 3 homework_detail_manual.absence_penalty = 5 homework.homework_detail_manual = homework_detail_manual diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index f9b242443..c7f1d45c4 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -7,7 +7,7 @@ $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); - $('#ajax-modal').parent().css("top","30%").css("left","40%"); + $('#ajax-modal').parent().css("top","65%").css("left","60%"); $('#ajax-modal').parent().addClass("anonymos_work"); }); <% end%> diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 6e07e7122..b19125ec6 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -21,6 +21,14 @@ <%= calendar_for('homework_end_time')%> +
+ + <%= calendar_for('evaluation_start_time')%> +
+
+ + <%= calendar_for('evaluation_end_time')%> +

diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index f375496d1..a169be166 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -21,6 +21,7 @@
<% homework = HomeworkCommon.new %> + <% homework.homework_detail_manual = HomeworkDetailManual.new%> <%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %>
<%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %> diff --git a/db/schema.rb b/db/schema.rb index 1c6760345..1f40c93b4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -497,23 +497,26 @@ ActiveRecord::Schema.define(:version => 20150918134804) 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| diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index e5f5e8b4c..95d85e48c 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -56,18 +56,20 @@ function show_more_project(url){ } //老师提交 新建/修改 作业 -function submit_homework(id) -{ - if(!regex_homework_name()) - { +function submit_homework(id){ + if(!regex_homework_name()){ $("#homework_name").focus(); } - else if(!regex_homework_end_time()) - { + else if(!regex_homework_end_time()){ $("#homework_end_time").focus(); } - else if(!regex_course_id()) - { + else if(!regex_evaluation_start()){ + $("#evaluation_start_time").focus() + } + else if(!regex_evaluation_end()){ + $("#evaluation_end_time").focus() + } + else if(!regex_course_id()){ $("#course_id").focus(); } else{ @@ -134,6 +136,42 @@ function search_homework_by_name(url){ ); } +//验证匿评开启时间:大于截止时间,或者为空 +function regex_evaluation_start(){ + var evaluation_start = $.trim($("#evaluation_start_time").val()); + if(evaluation_start == ""){ + return true; + } + var end_time = new Date($.trim($("#homework_end_time").val())); + var evaluation_start_time = new Date(evaluation_start); + if(evaluation_start_time > end_time){ + return true; + }else{ + $("#homework_end_time_span").text("开启匿评日期必须大于截止日期"); + return false; + } +} + +//验证匿评结束时间:大于匿评开启时间,或者为空。当匿评开启时间为空时,匿评结束时间必须为空 +function regex_evaluation_end(){ + var evaluation_start = $.trim($("#evaluation_start_time").val()); + var evaluation_end = $.trim($("#evaluation_end_time").val()); + if(evaluation_end == ""){ + return true; + }else if(evaluation_start == ""){ + $("#homework_end_time_span").text("开启匿评日期为空时,关闭匿评日期必须为空"); + return false; + } + var evaluation_start_time = new Date(evaluation_start); + var evaluation_end_time = new Date(evaluation_end); + if(evaluation_end_time > evaluation_start_time){ + return true; + }else{ + $("#homework_end_time_span").text("关闭匿评日期必须大于开启匿评日期"); + return false; + } +} + //提交新建作品 function new_student_work() { From 2d481619284ec1e72dbebdc7982f3f44d5d61858 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 22 Sep 2015 15:03:03 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=96=B0=E7=89=88=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student_work/_evaluation_title.html.erb | 17 ++-- .../_evaluation_un_title.html.erb | 46 ++++++---- .../student_work/_evaluation_un_work.html.erb | 45 +++++----- .../student_work/_evaluation_work.html.erb | 85 +++++++++++-------- app/views/student_work/index.html.erb | 25 +++--- public/stylesheets/courses.css | 40 ++++++--- public/stylesheets/public.css | 9 +- 7 files changed, 165 insertions(+), 102 deletions(-) diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb index bb1919472..cfd9632c2 100644 --- a/app/views/student_work/_evaluation_title.html.erb +++ b/app/views/student_work/_evaluation_title.html.erb @@ -1,8 +1,15 @@ -
<% end%> - \ No newline at end of file + + diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index f8b9addbd..63cb7ea99 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -1,51 +1,62 @@ \ No newline at end of file + + diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 5398b7084..5698a0c70 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -82,22 +82,27 @@ <% end%>
+
-
- - <%= link_to "所有作品[共#{@stundet_works.count}份]".html_safe,student_work_index_path(:homework => @homework.id),:class => "fl f14"%> +
+ + 作品 + + (<%= @stundet_works.count%>) + <%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%> -
- - +
+ +
+ <%= select_tag(:late_penalty,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %> <% end%> -
- +
+
<% if @is_evaluation && !@stundet_works.empty?%> <%= render :partial => "evaluation_title"%> @@ -105,8 +110,8 @@ <%= render :partial => "evaluation_un_title"%> <% end%>
-
+ <% @stundet_works.each do |student_work|%> <% if @is_evaluation%> <%= render :partial => "evaluation_work", :locals => {:student_work => student_work}%> @@ -114,13 +119,13 @@ <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%> <% end%>
-
<% end%>
+
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 7c1e590db..5d837fda5 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -31,8 +31,8 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} /*右侧内容新*/ .ctt2{clear:both; } -.hworkListBanner {width:720px; height:40px; background:#eaeaea; margin-bottom:10px; margin-left:5px;} -.hworkListContainer {float:left; clear:both; width:720px; margin-left:5px;} +.hworkListBanner {width:720px; height:40px; background:#eaeaea; margin-bottom:10px;} +.hworkListContainer {float:left; clear:both; width:720px;} .showHwork{ border:2px solid #269ac9; width:696px; padding:10px; color:#666666; padding-bottom:0px; } .showHworkP{ width:630px; float:left;} .showHwork ul li {margin-bottom: 5px;} @@ -41,17 +41,21 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} .pingBoxTit{ float:left; width:625px; margin-left:10px;} .pingText{border:1px solid #CCCCCC; margin:5px; padding:5px; width:610px; height:20px; } .pingBackTit{ float:left; width:573px; margin-left:10px; } -.hworkUl{ height:50px; border-bottom:1px solid #eaeaea; line-height:50px; vertical-align:middle;} +.hworkUl{ height:30px; border-bottom:1px solid #eaeaea; line-height:30px; vertical-align:middle; padding-bottom:5px;} +.hworkH30 {height:30px !important; line-height:30px !important;} .hworkListRow {height:65px; border-bottom:1px solid #eaeaea; line-height:65px; vertical-align:middle;} -.hworkListRow:hover {background-color:#f6f6f7; cursor:pointer;} +.hworkListRow:hover {background-color:#f6f6f7;} .hworkUl li{ float:left;} .hworkListRow li{ float:left;} -.hworkList380 {width:375px; text-align:left; height:50px; line-height:50px;padding-left:5px;} +.hworkList340 {width:335px; text-align:left; height:50px; line-height:50px;padding-left:5px;} .hworkList80 {width:80px; text-align:center;} .hworkList50 {width:50px; text-align:center;} +.hworkList130 {width:130px; text-align:center;} .codeList{ float:right; font-size:12px; color:#484848; padding:0px 3px; width:714px; margin-bottom:10px; } -.hworkName {max-width:380px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:16px; line-height:16px;} -.hworkDetail {max-width:100px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:14px; line-height:14px; font-size:12px; color:#888888;} +.hworkName {width:115px; float:left; line-height:18px;} +.hworkName div{max-height: 40px;overflow: hidden;} +.hworkStName {width:60px; max-width:60px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;} +.hworkStID {width:80px; max-width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;} .hworkDate {max-width:150px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:14px; line-height:14px; font-size:12px; color:#888888;} .hworkMenu {width:100px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-110px; font-size:12px; color:#888888; display:none; line-height:2;} a.hworkExport {background:url(../images/homepage_icon2.png) -10px -401px no-repeat; padding-left:23px;} @@ -60,11 +64,25 @@ a.hworkSetting {background:url(../images/homepage_icon2.png) -10px -450px no-rep .infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:-24px;margin-left: 40px;} .problemTxt {width:660px; margin-left:10px; color:#777777; position:relative;} .rTxtTit{width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#269ac9; font-size:14px;} -.width620{width: 620px;} -.width625{width: 625px;} -.width455{width: 455px;} -.m_width620{max-width: 620px;} +.hworkSearchBox {border:1px solid #e6e6e6; width:185px; float:left; background-color:#ffffff;} +.hworkSearchInput {border:none; outline:none; background-color:#ffffff; width:145px; height:25px; padding-left:10px; display:block; float:left;} +.hworkSearchIcon {width:30px; height:25px; background:url(../images/nav_icon.png) -8px -1px no-repeat; float:left;} +a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-repeat;} +.classSplit {border:1px solid #e7e7e7; height:27px; line-height:27px; display:inline-block; margin-left:10px; padding-left:5px; cursor:pointer; outline:none; width:95px; max-width:95px;} +.classList {width:45px; border:1px solid #e7e7e7; float:left; position:absolute; background-color:#ffffff; left:-1px;} +.hworkPortrait {float:left; width:40px;} +.HomeworkNameTitle{width: 285px;text-align: center;margin-left: 50px;} +.HomeworkStuTitle{width: 80px;text-align: center;} +.StudentName{display: table-cell;width: 115px;vertical-align: middle;text-align: center;height: 40px;} +.width385{width: 385px;} +.width505{width: 505px;} +.width165{width: 165px;} .width180{width: 180px;} +.width525{width: 525px;} +.width285{width: 285px;} +.mr95{margin-right: 95px;} +.ml100{margin-left: 100px;} +.mt16{margin-top: 16px;} /*邮件邀请*/ diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 4f44a8b60..09ae08f3f 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -91,8 +91,10 @@ h4{ font-size:14px; color:#3b3b3b;} .mr45{margin-right: 45px;} .mr50{margin-right: 50px;} .mr55{margin-right: 55px;} +.mr60 {margin-right:60px;} .mr70{margin-right: 70px;} .mw15{margin:0 15px;} +.mr90 {margin-right:90px;} .mw20{ margin: 0 20px;} .mt1{margin-top: 1px;} .mt-4 {margin-top:-4px;} @@ -102,9 +104,10 @@ h4{ font-size:14px; color:#3b3b3b;} .mt8{ margin-top:8px;} .mt10{ margin-top:10px !important;} .mt30{ margin-top: 30px;} -.mt12 { margin-top:12px;} +.mt12 { margin-top:12px !important;} .mt15 {margin-top:15px;} .mt19 {margin-top:19px !important;} +.ml70{margin-left: 70px;} .mb4{ margin-bottom:4px;} .mb5{ margin-bottom:5px;} .mb8 {margin-bottom:8px;} @@ -213,6 +216,8 @@ a.linkGrey5 {color:#484848;} a.linkGrey5:hover {color:#3498db;} a.linkGrey6 {color:#484848 !important;} a.linkGrey6:hover {color:#ffffff !important;} +a.linkGrey7 {color:#888888;} +a.linkGrey7:hover {color:#269ac9;} a.bBlue {background-color:#3498db;} a.bBlue:hover {background-color:#297fb8;} a.submit_btn {border:1px solid #3498db; padding:3px 10px; border-radius:3px; color:#3498db;} @@ -293,7 +298,7 @@ a:hover.bgreen_n_btn{background:#08a384;} #Container{ width:1000px; margin:0 auto; } /*头部导航*/ -#Header{ margin:10px 0; background:#15bccf; height:40px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; } +#Header{ margin:10px 0; background:#15bccf; height:40px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; position: relative;} .logo{ margin:5px 10px; } #TopNav{} #TopNav ul li{ margin-top:8px;} From 90536efa1e177035401d33a620be642fcacfec00 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 22 Sep 2015 15:52:08 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=86=85=E5=A7=93?= =?UTF-8?q?=E5=90=8D=E5=AD=A6=E5=8F=B7=E9=82=AE=E7=AE=B1=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=EF=BC=8C=E5=90=84=E7=A7=8D=E6=8E=92=E5=BA=8F=20=E6=94=B9?= =?UTF-8?q?=E4=B8=BAjs=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 1 + .../_evaluation_un_title.html.erb | 24 +++++------ .../student_work/_student_work_list.html.erb | 36 ++++++++++++++++ app/views/student_work/index.html.erb | 41 ++----------------- app/views/student_work/index.js.erb | 2 + public/javascripts/course.js | 25 +++++++---- 6 files changed, 72 insertions(+), 57 deletions(-) create mode 100644 app/views/student_work/_student_work_list.html.erb create mode 100644 app/views/student_work/index.js.erb diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 251fd80c4..53f9adcba 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -99,6 +99,7 @@ class StudentWorkController < ApplicationController @score = @b_sort == "desc" ? "asc" : "desc" respond_to do |format| + format.js format.html format.xls { send_data(homework_to_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present", diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index 119976bbb..14079668e 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -6,46 +6,46 @@
  • - <%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50"%> + <%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%> <% if @show_all && @order == "created_at"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> <% end%>
  • - <%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%> + <%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%> <% if @show_all && @order == "teacher_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%> <% end%>
  • - <%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%> + <%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> <% if @show_all && @order == "teaching_asistant_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> <% end%>
  • <% if @homework.homework_type == 2%>
  • - <%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%> + <%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> <% if @show_all && @order == "system_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> <% end%>
  • <% end%>
  • - <%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%> + <%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> <% if @show_all && @order == "student_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> <% end%>
  • - <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%> + <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> <% if @show_all && @order == "score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> <% end%>
  • \ No newline at end of file diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb new file mode 100644 index 000000000..0046393a4 --- /dev/null +++ b/app/views/student_work/_student_work_list.html.erb @@ -0,0 +1,36 @@ +
    + + 作品 + + (<%= @stundet_works.count%>) + + + <%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%> +
    + + +
    + <%= select_tag(:late_penalty,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %> + <% end%> +
    +
    + +
    + <% if @is_evaluation && !@stundet_works.empty?%> + <%= render :partial => "evaluation_title"%> + <% else%> + <%= render :partial => "evaluation_un_title"%> + <% end%> +
    +
    + +<% @stundet_works.each do |student_work|%> + <% if @is_evaluation%> + <%= render :partial => "evaluation_work", :locals => {:student_work => student_work}%> + <% else%> + <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%> + <% end%> +
    +
    +
    +<% end%> \ No newline at end of file diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 5698a0c70..454f0ad57 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -56,7 +56,7 @@