From 9be7e633ae4c83912e059c3e3e5f1bb0c6cdfc26 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 21 Sep 2015 16:20:29 +0800 Subject: [PATCH 01/25] =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=A1=86=E7=9A=84=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_message.html.erb | 2 +- app/views/users/_course_news.html.erb | 2 +- app/views/users/_project_issue.html.erb | 2 +- app/views/users/_project_message.html.erb | 2 +- app/views/users/_user_activities.html.erb | 2 +- .../javascripts/init_activity_KindEditor.js | 33 +++++++++++-------- 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 703882bd1..702e2d6b4 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -99,7 +99,7 @@
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index ef01022ce..64080136f 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -70,7 +70,7 @@
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 29bed1499..ce7b6a884 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -115,7 +115,7 @@
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 2cce8f83a..2b64ceb9d 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -84,7 +84,7 @@
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 225304185..ea9c572d9 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -36,7 +36,7 @@ } $(function() { - init_activity_KindEditor_data(<%= user_activity.id%>,"","87%"); + init_activity_KindEditor_data(<%= user_activity.id%>,null,"87%"); }); <% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %> diff --git a/public/javascripts/init_activity_KindEditor.js b/public/javascripts/init_activity_KindEditor.js index 1e51067ef..bea7dc1e7 100644 --- a/public/javascripts/init_activity_KindEditor.js +++ b/public/javascripts/init_activity_KindEditor.js @@ -6,42 +6,49 @@ function init_editor(params){ var editor = params.kindutil.create(params.textarea, { resizeType : 1,minWidth:"1px",width:"95%", - height:"30px",// == undefined ? "30px":paramsHeight+"px", - minHeight:"30px",// == undefined ? "30px":paramsHeight+"px", + height:"33px",// == undefined ? "30px":paramsHeight+"px", + minHeight:"33px",// == undefined ? "30px":paramsHeight+"px", items:['emoticons'], afterChange:function(){//按键事件 var edit = this.edit; var body = edit.doc.body; edit.iframe.height(paramsHeight); - this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + (paramsHeight == undefined ? 30:paramsHeight), paramsHeight)); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + paramsHeight , paramsHeight)); }, afterBlur:function(){ nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); if(this.edit.html()=="") { - this.edit.html('我要回复'); + this.edit.html('我要回复'); } //params.toolbar_container.hide(); $('#reply_image_' + id).addClass('imageFuzzy'); - //this.resize("95%", null); + if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html())){ + params.submit_btn.hide(); + this.resize("95%", null); + }else if(edit.html().val().trim() != ""){ + params.submit_btn.show(); + } + //params.submit_btn.css("display","none"); }, afterFocus: function(){ var edit = this.edit; var body = edit.doc.body; - if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\#\d*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){ + if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){ edit.html(''); } + params.submit_btn.show(); params.contentmsg.hide(); // params.toolbar_container.show(); $('#reply_image_' + id).removeClass('imageFuzzy'); //edit.iframe.width(paramsWidth); this.resize(paramsWidth, null); - params.submit_btn.show(); + //params.submit_btn.show(); }, afterCreate:function(){ - params.submit_btn.css("display","none"); + params.submit_btn.hide(); var toolbar = $("div[class='ke-toolbar']",params.div_form); toolbar.css('width',24); $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情'); @@ -52,12 +59,10 @@ function init_editor(params){ edit.iframe[0].scroll = 'no'; body.style.overflowY = 'hidden'; //reset height - var edit = this.edit; - var body = edit.doc.body; paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight; edit.iframe.height(paramsHeight); - edit.html('我要回复'); - this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ (paramsHeight == undefined ? 30:paramsHeight) , paramsHeight)); + edit.html('我要回复'); + this.resize(null,Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight));// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight) // params.toolbar_container.hide(); } @@ -74,7 +79,7 @@ function nh_check_field(params){ if(params.content.html()!=params.textarea.html() || params.issubmit==true){ params.textarea.html(params.content.html()); params.content.sync(); - if(params.content.isEmpty() || /^\&\w*\;\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\#\d*\;\"\&\w*\;[\u4e00-\u9fa5]*\&\w*\;\/\w*\&\w*\;$/.test(params.textarea.html())){ + if(params.content.isEmpty() || /^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(params.textarea.html())){ params.contentmsg.html('内容不能为空'); params.contentmsg.css({color:'#ff0000'}); }else{ @@ -152,5 +157,5 @@ function init_activity_KindEditor_data(id){ }); }); - $(".ke-edit").css("height","25px"); + $(".ke-edit").css("height","33px"); } \ No newline at end of file From facd12640a16eaee73d4575f0445e1dfe935bc92 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 21 Sep 2015 16:54:23 +0800 Subject: [PATCH 02/25] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=9A=84=E5=9B=9E=E5=A4=8D=E4=B8=BA0=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E2=80=9C=E5=9B=9E=E5=A4=8D(0)=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_message.html.erb | 15 ++++++++------- app/views/users/_course_news.html.erb | 5 +++-- app/views/users/_project_issue.html.erb | 6 +++--- app/views/users/_project_message.html.erb | 15 ++++++++------- public/stylesheets/new_user.css | 1 + public/stylesheets/public.css | 1 + 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 702e2d6b4..250f385e5 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -45,15 +45,16 @@
+ <% count=0 %> + <% if activity.parent %> + <% count=activity.parent.children.count%> + <% else %> + <% count=activity.children.count%> + <% end %>
-
- <% count=0 %> +
+
回复( - <% if activity.parent %> - <% count=activity.parent.children.count%> - <% else %> - <% count=activity.children.count%> - <% end %> <%= count %> )
<%#=format_date(activity.updated_on)%>
diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 64080136f..456a3a7bd 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -24,9 +24,10 @@
+ <% count=activity.comments.count %>
-
- <% count=activity.comments.count %> +
+
回复(<%= count %>)
diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index ce7b6a884..8ea8804d5 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -63,10 +63,10 @@
+ <% count = activity.journals.count %>
- -
- <% count = activity.journals.count %> +
+
回复(<%= count %>)
<%#= format_date(activity.updated_on) %>
<% if count > 2 %> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 2b64ceb9d..7d810c065 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -36,15 +36,16 @@
+ <% count = 0 %> + <% if activity.parent %> + <% count=activity.parent.children.count%> + <% else %> + <% count=activity.children.count%> + <% end %>
-
- <% count = 0 %> +
+
回复( - <% if activity.parent %> - <% count=activity.parent.children.count%> - <% else %> - <% count=activity.children.count%> - <% end %> <%=count %> )
<%#=format_date(activity.updated_on)%>
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 144589d5b..99260b458 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -568,6 +568,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostReply {width:710px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;} .homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} .borderBottomNone {border-bottom:none !important;} +.topBorder {border-top: 1px solid #e4e4e4;} div.minHeight48{min-height: 48px;} .homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:20px;} .homepagePostReplyBannerTime{width:85px; display:inline-block;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 4f44a8b60..43e77a36d 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -604,6 +604,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostReply {width:720px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;} .homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} .borderBottomNone {border-bottom:none !important;} +.topBorder {border-top: 1px solid #e4e4e4;} .homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:20px;} .homepagePostReplyBannerTime{width:85px; display:inline-block;} .homepagePostReplyBannerMore{width:330px; display:inline-block; text-align:right;} From 8883093b965e3a429e42ee16a5ad8557f6cc0ad8 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 21 Sep 2015 17:05:51 +0800 Subject: [PATCH 03/25] =?UTF-8?q?"=E5=85=B3=E4=BA=8E=E6=88=91=E4=BB=AC"?= =?UTF-8?q?=E7=9A=84=E5=9B=BE=E7=89=87=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/new_user.css | 4 +--- public/stylesheets/public.css | 4 ++-- public/stylesheets/public_new.css | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 99260b458..46ef4a760 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -688,9 +688,7 @@ a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} .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;} .AgreementTxt{text-indent:2em; margin-bottom:15px;} -.AgreementImg{ margin:0px auto; width:619px;} -.AgreementTxt{text-indent: 2em; margin-bottom: 15px;} -.AgreementImg{margin: 0px auto; width: 820px;} +.AgreementImg{ margin:0px auto;} /*底部*/ #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 43e77a36d..34bb71898 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -943,5 +943,5 @@ 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;} +.AgreementTxt{text-indent:2em; margin-bottom:15px;} +.AgreementImg{ margin:0px auto;} diff --git a/public/stylesheets/public_new.css b/public/stylesheets/public_new.css index 7cd0a461c..2d39e75ea 100644 --- a/public/stylesheets/public_new.css +++ b/public/stylesheets/public_new.css @@ -794,4 +794,4 @@ div.flash.warning, .conflict { .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 +.AgreementImg{margin: 0px auto;} \ No newline at end of file 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 04/25] =?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 83e2a4b5bd5b8c26a7e048906083b50d7154e40e Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 22 Sep 2015 09:47:39 +0800 Subject: [PATCH 05/25] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E9=97=AE=E5=8D=B7=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E6=8F=90=E7=A4=BA=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_edit_head.html.erb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/views/poll/_edit_head.html.erb b/app/views/poll/_edit_head.html.erb index 06e162f0d..8eebae5a2 100644 --- a/app/views/poll/_edit_head.html.erb +++ b/app/views/poll/_edit_head.html.erb @@ -22,3 +22,21 @@
<% end%> + 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 06/25] =?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 | 47 +++++----- .../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, 166 insertions(+), 103 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 @@ -
    -
  • - 作品信息 +
      +
    • + 作品名称 + 姓名 + 学号
    • -
    • - 我的评分 + +
    • + 时间 +
    • + +
    • + 我的评分
    \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index 8ca855e9b..119976bbb 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -1,37 +1,51 @@ -
      -
    • - 作品信息 +
        +
      • + 作品名称 + 姓名 + 学号
      • -
      • - <%= 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 => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50"%> + <% 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"%> + <% 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"%> <% 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'} mt19"%> + <%= 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"%> <% 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"%> <% 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'} mt19"%> + <%= 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"%> <% 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"%> <% 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'} mt19"%> + <%= 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"%> <% 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"%> <% 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'} mt19"%> + <%= 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"%> <% 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"%> <% 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'} mt19"%> + <%= 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"%> <% end%>
      \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index d3bac240d..bc9fe2e00 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -1,46 +1,48 @@
        -
      • +
        • -
        • - <% 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 => "linkGrey f14"%> +
        • + <%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %> +
        • +
        • + <% 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 => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> +
        • -
        • -
            -
          • - 姓名:<%= student_work.user.show_name%> +
              +
            • + <%= student_work.user.show_name%>
            • -
            • - 学号: +
            • <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
            • -
            • - 时间: - <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> - 迟交 - <% else%> - <%= format_time student_work.created_at%> - <% end %> -
        • -
        • +
        • + <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> + [迟交] + <% end %> +
        • +
        • <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
        • -
        • +
        • <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
        • <% if @homework.homework_type == 2%> -
        • +
        • <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
        • <% end%> +
        • <%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%> <% unless student_work.student_score.nil?%> @@ -73,4 +75,5 @@
<% 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 @@
    <% is_my_work = student_work.user == User.current%> -
  • +
    • -
    • - <% if is_my_work%> + <% if is_my_work%> +
    • + <%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %> +
    • +
    • <% 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 => "linkGrey f14"%> - <% else%> - <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%> - <% end%> -
    • -
      -
    • -
        -
      • - 姓名: - <% if is_my_work%> +
        + <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%> +
        +
      • +
      • +
          +
        • <%= student_work.user.show_name%> - <% else%> - 匿名 - <% end%> -
        • -
        • - 学号: - <% if is_my_work%> - +
        • +
        • <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> - - <% else%> - -- - <% end%> +
        • +
      • -
      • - 时间: - <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> - 迟交 - <% else%> - <%= format_time student_work.created_at%> - <% end %> + <% else%> +
      • + <%= image_tag(url_to_avatar(""),width:"40", height: "40") %>
      • -
      -
    • +
    • +
      + <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%> +
      +
    • +
    • +
        +
      • + 匿名 +
      • +
      • + -- +
      • +
      +
    • + <% end%> +
  • +
  • + <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> + [迟交] + <% end %> +
  • + + <% my_score = student_work_score(student_work,User.current) %> -
  • +
  • <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
  • -
\ 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 07/25] =?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 @@
    • - <%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey'%> + <%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
    • <% if @homework.student_works.empty?%> @@ -85,43 +85,8 @@
      -
      -
      - - 作品 - - (<%= @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%> +
      + <%= render :partial => "student_work/student_work_list"%>
      diff --git a/app/views/student_work/index.js.erb b/app/views/student_work/index.js.erb new file mode 100644 index 000000000..e46be3164 --- /dev/null +++ b/app/views/student_work/index.js.erb @@ -0,0 +1,2 @@ +$("#homework_student_work_list").html("<%= escape_javascript(render :partial => 'student_work/student_work_list') %>"); +$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>"); \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 4f091560d..f81952125 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -940,17 +940,28 @@ function SearchByName(url,event) { var keycode = (event.keyCode ? event.keyCode : event.which); if(keycode == '13'){ - location.href = url + "&name=" + $("#course_student_name").val() + "&group=" + $("#late_penalty").val(); + $.get( + url, + { + name : $("#course_student_name").val(), + group : $("#late_penalty").val() + }, + function (data) { + } + ); } } function SearchByName_1(url) { - if($("#late_penalty").val() == null){ - location.href = url + "&name=" + $("#course_student_name").val() - } - else{ - location.href = url + "&name=" + $("#course_student_name").val() + "&group=" + $("#late_penalty").val(); - } + $.get( + url, + { + name : $("#course_student_name").val(), + group : $("#late_penalty").val() + }, + function (data) { + } + ); } //新建作业临时弹框 From 660e604045fff4017ee8b1c745ed1345cba6f14a Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 22 Sep 2015 15:54:19 +0800 Subject: [PATCH 08/25] =?UTF-8?q?kindeditor=E7=BC=96=E8=BE=91=E6=A1=86?= =?UTF-8?q?=E7=9A=84=E5=88=97=E8=A1=A8=E7=AC=A6=E5=8F=B7=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/plugins/code/previewcode.css | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index ce3084a7c..f67f04149 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -38,8 +38,11 @@ pre.prettyprint { padding: 2px; border-right: 1px solid #ccc, border-top: 1px solid #ccc } -pre li,ul,ol { - list-style-type: none; +pre li,ol li { + list-style-type: decimal; +} +ul li{ + list-style-type: disc; } /* Specify class=linenums on a pre to get line numbering */ ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ @@ -50,7 +53,7 @@ li.L3, li.L5, li.L6, li.L7, -li.L8 { list-style-type: none } +li.L8 { list-style-type: decimal } /* Alternate shading for lines */ li.L1, li.L3, From a37f39558d81b9820c79b7c90843b3ce220a59f1 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 22 Sep 2015 15:54:50 +0800 Subject: [PATCH 09/25] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=92=8C=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E7=9A=84=E5=88=97=E8=A1=A8=E7=AC=A6=E5=8F=B7=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_show.html.erb | 4 +- app/views/boards/_project_show.html.erb | 4 +- app/views/courses/show.html.erb | 2 +- app/views/homework_common/index.html.erb | 2 +- app/views/issues/show.html.erb | 104 ++++++++++--------- app/views/news/_course_news_list.html.erb | 2 +- app/views/news/_course_show.html.erb | 4 +- app/views/news/_project_news.html.erb | 2 +- app/views/news/_project_show.html.erb | 2 +- app/views/projects/show.html.erb | 6 +- app/views/users/_user_homework_list.html.erb | 2 +- db/schema.rb | 8 +- public/stylesheets/courses.css | 4 +- public/stylesheets/css.css | 3 +- public/stylesheets/new_user.css | 3 + public/stylesheets/project.css | 4 +- public/stylesheets/public.css | 3 + 17 files changed, 87 insertions(+), 72 deletions(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index f117acd7f..db174f30e 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -99,7 +99,7 @@ // } }); -
      +
      <%= topic.content.html_safe %> @@ -165,7 +165,7 @@
      <%= link_to User.current.member_of_course?(@board.course) ? "#{message.author.show_name}(#{message.author.login})" : "#{message.author}", user_path(message.author),:class => 'fl c_orange f14 ' %>
      -
      +
      <%= textAreailizable message,:content,:attachments => message.attachments %>
      diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index bc69e2666..3cfd4ae72 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -92,7 +92,7 @@
      -
      +
      <%= topic.content.html_safe %> @@ -150,7 +150,7 @@
      <%= link_to_user_header message.author,false,:class => 'fl c_orange f14 ' %>
      -
      +
      <%= textAreailizable message,:content,:attachments => message.attachments %>
      diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 6eb722981..eceb29f34 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -7,7 +7,7 @@ <%= image_tag(url_to_avatar(activity.user), :width => "42", :height => "42") %> -
      +
      <%= link_to_user_header(activity.user,false,:class => 'problem_name c_orange fl') %>   <%= activity.course_act_type == "Course" ? "创建了课程" : l(:label_new_activity) %>: diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 2e680d6ea..4bf3d1781 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -37,7 +37,7 @@ $(function(){if($("#bid_description_<%= homework.id%>_content").height()>360){$("#bid_show_more_des_button<%= homework.id%>").show();}});
      -
      +
      <%= homework.description.html_safe %>
      diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 01cbea1c1..41605a826 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,4 +1,4 @@ -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %> +<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg' %>

      <%= l(:label_issue_edit) %>

      @@ -22,25 +22,25 @@

      <%= @issue.author %> <%# if @issue.created_on != @issue.updated_on %> - 添加于 <%= format_time(@issue.created_on).html_safe %> + 添加于 <%= format_time(@issue.created_on).html_safe %> <%# else %> - <%#= format_time(@issue.updated_on).html_safe %> + <%#= format_time(@issue.updated_on).html_safe %> <%# end %>

      'action_menu' %>
      -
      +
      <% if @issue.description? || @issue.attachments.any? -%> <% if @issue.description? %> <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> <%= textAreailizable @issue, :description, :attachments => @issue.attachments %> <% end %> -
      - +
      + + + <%= link_to_attachment_project @issue, :thumbnails => true %>
      <% end -%> <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
      @@ -48,51 +48,61 @@
      <%= issue_fields_rows do |rows| %> -
        -
      •  状态  : 

        <%= @issue.status.name %>

        -
      • -
        - <% unless @issue.disabled_core_fields.include?('assigned_to_id') %> -
      •  指派给  : 

        <%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "--" %> -
      • - <% end %> -
        -
      -
        -
      •  优先级  : 

        <%= @issue.priority.name %> -
      • -
        - <% unless @issue.disabled_core_fields.include?('done_ratio') %> -
      •  % 完成  : 

        <%= @issue.done_ratio %>% -
      • - <% end %> -
        -
      +
        +
      •  状态  : 

        -
          +

          <%= @issue.status.name %>

          + +
          + <% unless @issue.disabled_core_fields.include?('assigned_to_id') %> +
        •  指派给  : 

          + <%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "--" %> +
        • + <% end %> +
          +
        +
          +
        •  优先级  : 

          + <%= @issue.priority.name %> +
        • +
          + <% unless @issue.disabled_core_fields.include?('done_ratio') %> +
        •  % 完成  : 

          + <%= @issue.done_ratio %>% +
        • + <% end %> +
          +
        + +
          <% unless @issue.disabled_core_fields.include?('start_date') %> -
        •  开始  : 

          <%= format_date(@issue.start_date) %>

          -
        • +
        •  开始  : 

          + +

          <%= format_date(@issue.start_date) %>

          +
        • <% end %> -
          +
          <% unless @issue.disabled_core_fields.include?('estimated_hours') %> -
        •  周期  : 

          <%= l_hours(@issue.estimated_hours) %> -
        • +
        •  周期  : 

          + <%= l_hours(@issue.estimated_hours) %> +
        • <% end %> -
          -
        -
          - <% unless @issue.disabled_core_fields.include?('due_date') %> -
        •  计划完成  : 

          <%= format_date(@issue.due_date)? format_date(@issue.due_date) : "--" %> -
        • +
          +
        +
          + <% unless @issue.disabled_core_fields.include?('due_date') %> +
        •  计划完成  : 

          + <%= format_date(@issue.due_date) ? format_date(@issue.due_date) : "--" %> +
        • <% end %> -
          +
          <% unless @issue.disabled_core_fields.include?('fixed_version_id') %> -
        •  目标版本  : 

          <%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %> -
        • +
        •  目标版本  : 

          + <%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %> +
        • <% end %> -
          -
        +
        +
      <% end %> <%#= render_custom_fields_rows(@issue) %> <%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %> @@ -111,7 +121,7 @@

      - + <%= l(:button_submit) %> diff --git a/app/views/news/_course_news_list.html.erb b/app/views/news/_course_news_list.html.erb index da963b3cd..74a70e33d 100644 --- a/app/views/news/_course_news_list.html.erb +++ b/app/views/news/_course_news_list.html.erb @@ -7,7 +7,7 @@ <% newss.each do |news| %>
      <%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %> -
      +
      <%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %> <%= l(:label_release_news) %>: diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 9ae951779..2d8dae59d 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -4,7 +4,7 @@
      <%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %> -
      +

      <%=h @news.title %>

      @@ -51,7 +51,7 @@
      <%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author), :class => "problem_pic fl"%>
      -
      +
      <%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %> <%= format_time(comment.created_on) %> diff --git a/app/views/news/_project_news.html.erb b/app/views/news/_project_news.html.erb index 0cd26382b..efbb74e46 100644 --- a/app/views/news/_project_news.html.erb +++ b/app/views/news/_project_news.html.erb @@ -31,7 +31,7 @@ <% @newss.each do |news| %>
      <%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %> -
      +
      <%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %> <%= l(:label_add_news) %>:<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %> <%=link_to "#{news.comments.all.count}".html_safe, news_path(news.id), :class => "pro_mes_w_news" %>
      diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 6e94f0947..463b0f489 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -14,7 +14,7 @@
      <%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %> -
      +

      <%=h @news.title %>

      <%#= watcher_link(@news, User.current) %> <%= link_to(l(:button_edit), diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index f1b3d9b7b..971794699 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -24,7 +24,7 @@ <% if e.forge_act_type == "Issue" %>
      <%= image_tag(url_to_avatar(act.author), :width => "42", :height => "42") %> -
      +
      <%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to act.author, user_path(act.author), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> : @@ -60,7 +60,7 @@ <% elsif e.forge_act_type == "Message" %>
      <%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %> -
      +
      <%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> : @@ -79,7 +79,7 @@ <% elsif e.forge_act_type == "News" %>
      <%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %> -
      +
      <%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> : diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index 6bc03e33d..cd596e22b 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -41,7 +41,7 @@ <%= l(:label_end_time)%>:<%= homework_common.end_time%>
      -
      +
      <%= homework_common.description.html_safe %>
      diff --git a/db/schema.rb b/db/schema.rb index 1c6760345..767208f9e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -476,13 +476,6 @@ ActiveRecord::Schema.define(:version => 20150918134804) 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 @@ -916,6 +909,7 @@ ActiveRecord::Schema.define(:version => 20150918134804) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.datetime "updated_on" end add_index "news", ["author_id"], :name => "index_news_on_author_id" diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 7c1e590db..39c0c6eb0 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -262,6 +262,8 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;} .ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;} /*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/ +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} /* 创建作品 work */ .Newwork{ width:668px; height:418px;} @@ -637,7 +639,7 @@ a.Reply_pic{ display:block; width:30px; height:30px; padding:2px; border:1px sol a:hover.Reply_pic{border:1px solid #64bdd9;} .Msg_txt{ float:left; width:540px; margin-left:10px;} .Msg_txt p{ } -.talkWrapMsg ul li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;} +.talkWrapMsg > ul > li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;} .talkReply{ width:540px; margin-left:50px; border-top:1px dashed #d9d9d9; padding-top:10px; } .Replybox{ float:left; width:495px; margin-left:5px;} .talk_nextpage{ border:none; width:410px; margin:0 auto;} diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index ebb290597..f6bf63f2c 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -120,7 +120,8 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_distop span{ float:left;} .ping_distop p{ color:#5f5f5f;min-height: 24px;} .ping_disfoot a{ float:right; color:#15bccf; margin-left:5px;} - +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} .ping_distop span a{ float:right; /*width:20px;*/ height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 46ef4a760..1c361c3f9 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1149,3 +1149,6 @@ a:hover.tijiao{ background:#0f99a9;} a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} .link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} + +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} \ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index bee965a90..875f01ba0 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -328,6 +328,8 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;} .ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;} /*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/ +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} /*上传资源弹出框样式*/ .popbox_polls{position:fixed !important;} @@ -862,7 +864,7 @@ a.Reply_pic{ display:block; width:30px; height:30px; padding:2px; border:1px sol a:hover.Reply_pic{border:1px solid #64bdd9;} .Msg_txt{ float:left; width:540px; margin-left:10px;} .Msg_txt p{ } -.talkWrapMsg ul li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;} +.talkWrapMsg > ul > li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;} .talkReply{ width:540px; margin-left:50px; border-top:1px dashed #d9d9d9; padding-top:10px; } .Replybox{ float:left; width:495px; margin-left:5px;} .talk_nextpage{ border:none; width:410px; margin:0 auto;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 34bb71898..8ab9a373f 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -945,3 +945,6 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;} .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;} + +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} \ No newline at end of file From 93804bcfa642e6a61e47b0f1eaff9db14725a4f3 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 22 Sep 2015 16:11:22 +0800 Subject: [PATCH 10/25] =?UTF-8?q?=E5=85=B3=E4=BA=8E=E6=88=91=E4=BB=AC?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/new_user.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 1c361c3f9..9c075efa7 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -688,7 +688,7 @@ a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} .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;} .AgreementTxt{text-indent:2em; margin-bottom:15px;} -.AgreementImg{ margin:0px auto;} +.AgreementImg{ margin:0px auto; width:619px;} /*底部*/ #Footer{background-color:#ffffff; padding-bottom:15px; color:#666666;} /*margin-bottom:10px;*/ From 9d2b58738ebbdc6f8dae9531c92ca3ca6cb203d3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 22 Sep 2015 16:16:55 +0800 Subject: [PATCH 11/25] =?UTF-8?q?=E5=88=86=E7=8F=AD=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 59 ++++++++++++++----- .../student_work/_student_work_list.html.erb | 4 +- app/views/student_work/index.html.erb | 2 +- app/views/student_work/index.js.erb | 2 +- public/javascripts/course.js | 11 +++- 5 files changed, 58 insertions(+), 20 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 53f9adcba..90a0f3ed6 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -77,25 +77,56 @@ class StudentWorkController < ApplicationController @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? @is_evaluation = @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评 @show_all = false - if @is_teacher #老师 || 超级管理员 显示所有列表 - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name - @show_all = true - elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 - @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) - elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 - my_work = @homework.student_works.where(:user_id => User.current.id) - @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} - elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 - my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) - if my_work.empty? - @stundet_works = [] + + course_group = CourseGroup.find_by_id(@group) if @group + if course_group + group_students = course_group.users + if group_students.empty? + student_in_group = '(0)' else - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name + student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')' + end + if @is_teacher #老师 || 超级管理员 显示所有列表 + @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name @show_all = true + elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 + @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) + elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 + my_work = @homework.student_works.where(:user_id => User.current.id) + @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} + elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 + my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) + if my_work.empty? + @stundet_works = [] + else + @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name + @show_all = true + end + else + @stundet_works = [] end else - @stundet_works = [] + if @is_teacher #老师 || 超级管理员 显示所有列表 + @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name + @show_all = true + elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 + @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) + elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 + my_work = @homework.student_works.where(:user_id => User.current.id) + @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} + elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 + my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) + if my_work.empty? + @stundet_works = [] + else + @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name + @show_all = true + end + else + @stundet_works = [] + end end + @score = @b_sort == "desc" ? "asc" : "desc" respond_to do |format| diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index 0046393a4..197fecac9 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -8,9 +8,9 @@ <%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? %> + <%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %> <% end%>
      diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 454f0ad57..9c48d310b 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -56,7 +56,7 @@
      • - <%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%> + <%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
      • <% if @homework.student_works.empty?%> diff --git a/app/views/student_work/index.js.erb b/app/views/student_work/index.js.erb index e46be3164..73b94260d 100644 --- a/app/views/student_work/index.js.erb +++ b/app/views/student_work/index.js.erb @@ -1,2 +1,2 @@ $("#homework_student_work_list").html("<%= escape_javascript(render :partial => 'student_work/student_work_list') %>"); -$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>"); \ No newline at end of file +$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :group => @group, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>"); \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index f81952125..b471ea89e 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -944,7 +944,7 @@ function SearchByName(url,event) url, { name : $("#course_student_name").val(), - group : $("#late_penalty").val() + group : $("#student_work_in_group").val() }, function (data) { } @@ -953,17 +953,24 @@ function SearchByName(url,event) } function SearchByName_1(url) { + //alert($("#student_work_in_group").val()); $.get( url, { name : $("#course_student_name").val(), - group : $("#late_penalty").val() + group : $("#student_work_in_group").val() }, function (data) { } ); } +$(function(){ + $("#student_work_in_group").live("change",function(){ + $("#search_in_student_work").click(); + }); +}); + //新建作业临时弹框 function new_homework_alert(){ alert("您好!课程内直接发布作业的功能正在改进中,请直接点击\n顶部导航栏的“作业”向本课程发送作业。谢谢!如有问\n题,可参见帮助中心。"); From 1e95d5247dc4729b6a42043843e5c311aef0beaf Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 22 Sep 2015 16:21:36 +0800 Subject: [PATCH 12/25] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=A0=8F=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_evaluation_un_title.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index 14079668e..9a21e109b 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -1,6 +1,6 @@
        • - 作品名称 + 作品名称 姓名 学号
        • From 3e58264a28e895558e8946d1801bc6a29e073d31 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 22 Sep 2015 16:27:27 +0800 Subject: [PATCH 13/25] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E7=9A=84=E5=88=97=E8=A1=A8li=E7=9A=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AC=A6=E5=8F=B7=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_homework.html.erb | 2 +- app/views/users/_course_message.html.erb | 4 ++-- app/views/users/_course_news.html.erb | 4 ++-- app/views/users/_project_issue.html.erb | 2 +- app/views/users/_project_message.html.erb | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 366473b52..afd2f142b 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -42,7 +42,7 @@
          截止时间:<%= activity.end_time.to_s %>
      -
      +
      <%= activity.description.html_safe %>
      -
      +
      <% if activity.parent_id.nil? %> <%= activity.content.to_s.html_safe%> <% else %> @@ -87,7 +87,7 @@ <% end %> <%= format_time(reply.created_on) %>
      -
      +
      <%= reply.content.html_safe %>
      diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 456a3a7bd..97f0acb69 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -18,7 +18,7 @@
      发布时间:<%= format_time(activity.created_on) %>
      -
      +
      <%= activity.description.html_safe %>
      @@ -60,7 +60,7 @@ <% end %> <%= format_time(comment.created_on) %>
      -
      <%= comment.comments.html_safe %>
      +
      <%= comment.comments.html_safe %>
    • diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 8ea8804d5..e8bac335c 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -33,7 +33,7 @@ <%=format_time(activity.created_on) %>
    -
    +
    <% if activity.description? %> <%= textAreailizable activity, :description, :attachments => activity.attachments %> <% end %> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 7d810c065..32468f9a0 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -26,7 +26,7 @@
    时间:<%= format_time(activity.created_on) %>
    -
    +
    <% if activity.parent_id.nil? %> <%= activity.content.to_s.html_safe%> <% else %> @@ -74,7 +74,7 @@ <% end %> <%= format_time(reply.created_on) %>
    -
    <%= reply.content.html_safe %>
    +
    <%= reply.content.html_safe %>
    From 50817c3d641c29207ed1c3b565c85dcf82e10767 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 22 Sep 2015 16:52:21 +0800 Subject: [PATCH 14/25] =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=97=B6=20=E8=AE=A1=E7=AE=97=E7=B3=BB=E7=BB=9F=E8=AF=84?= =?UTF-8?q?=E5=88=86=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/student_work_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/student_work_test.rb b/app/models/student_work_test.rb index 1cfb7f8b2..0246ecabf 100644 --- a/app/models/student_work_test.rb +++ b/app/models/student_work_test.rb @@ -45,7 +45,7 @@ class StudentWorkTest < ActiveRecord::Base private def get_success_count self.results.inject(0) do |sum, result| - sum += (result["status"].to_i == 0 ? 1 : 0) + sum += (result["status"] && result["status"].to_i == 0 ? 1 : 0) end || 0 end From 576adfac34834c6d8e6ec55bea039dd16a0dd9a5 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 23 Sep 2015 08:56:48 +0800 Subject: [PATCH 15/25] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=A1=86=E4=B8=AD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0html=E4=BB=A3=E7=A0=81=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/init_activity_KindEditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/javascripts/init_activity_KindEditor.js b/public/javascripts/init_activity_KindEditor.js index bea7dc1e7..c9d8189c2 100644 --- a/public/javascripts/init_activity_KindEditor.js +++ b/public/javascripts/init_activity_KindEditor.js @@ -19,7 +19,7 @@ function init_editor(params){ afterBlur:function(){ nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); if(this.edit.html()=="") { - this.edit.html('我要回复'); + this.edit.html("我要回复"); } //params.toolbar_container.hide(); $('#reply_image_' + id).addClass('imageFuzzy'); @@ -61,7 +61,7 @@ function init_editor(params){ //reset height paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight; edit.iframe.height(paramsHeight); - edit.html('我要回复'); + edit.html("我要回复"); this.resize(null,Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight));// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight) // params.toolbar_container.hide(); From 76afbdec3f4164db4ecb7931ce63c455b91ad2d7 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 23 Sep 2015 09:23:31 +0800 Subject: [PATCH 16/25] =?UTF-8?q?=E9=9A=90=E8=97=8Fkindeditor=E7=9A=84?= =?UTF-8?q?=E2=80=9C=E6=8F=92=E5=85=A5=E4=BB=A3=E7=A0=81=E2=80=9D=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B9=E7=9B=AE=E7=BC=96=E5=8F=B7/?= =?UTF-8?q?=E7=AC=A6=E5=8F=B7=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 5 ++--- public/stylesheets/courses.css | 4 ++-- public/stylesheets/css.css | 4 ++-- public/stylesheets/new_user.css | 4 ++-- public/stylesheets/project.css | 4 ++-- public/stylesheets/public.css | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index e8c28f678..b045a27cc 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -264,7 +264,7 @@ K.options = { minHeight : 100, minChangeSize : 50, zIndex : 811213, - items : ['code', 'emoticons','fontname', + items : ['emoticons','fontname', 'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|', 'formatblock', 'fontsize', '|','indent', 'outdent', '|','imagedirectupload','table', 'media', 'preview',"more" @@ -4986,8 +4986,7 @@ KEditor.prototype = { htmlList.unshift('
    ') htmlList.push('
    ') var htmlListFull = []; - var fullItems = ['code', - 'emoticons','fontname', + var fullItems = ['emoticons','fontname', 'forecolor', 'hilitecolor', 'bold','|', 'justifyleft', 'justifycenter', 'insertorderedlist', 'insertunorderedlist', '|', 'formatblock', 'fontsize', '|', 'indent', 'outdent', '|','imagedirectupload','table', 'media', 'preview', "less", diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 0ea279253..754112b52 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -280,8 +280,8 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;} .ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;} /*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/ -.list_style ol li{list-style-type: decimal;margin-left: 40px;} -.list_style ul li{list-style-type: disc;margin-left: 40px;} +.list_style ol li{list-style-type: decimal;margin-left: 20px;} +.list_style ul li{list-style-type: disc;margin-left: 20px;} /* 创建作品 work */ .Newwork{ width:668px; height:418px;} diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index f6bf63f2c..6114c1b4d 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -120,8 +120,8 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_distop span{ float:left;} .ping_distop p{ color:#5f5f5f;min-height: 24px;} .ping_disfoot a{ float:right; color:#15bccf; margin-left:5px;} -.list_style ol li{list-style-type: decimal;margin-left: 40px;} -.list_style ul li{list-style-type: disc;margin-left: 40px;} +.list_style ol li{list-style-type: decimal;margin-left: 20px;} +.list_style ul li{list-style-type: disc;margin-left: 20px;} .ping_distop span a{ float:right; /*width:20px;*/ height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 9c075efa7..5e049e029 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1150,5 +1150,5 @@ a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-l a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} .link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} -.list_style ol li{list-style-type: decimal;margin-left: 40px;} -.list_style ul li{list-style-type: disc;margin-left: 40px;} \ No newline at end of file +.list_style ol li{list-style-type: decimal;margin-left: 20px;} +.list_style ul li{list-style-type: disc;margin-left: 20px;} \ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 875f01ba0..963b4aeb3 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -328,8 +328,8 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;} .ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;} /*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/ -.list_style ol li{list-style-type: decimal;margin-left: 40px;} -.list_style ul li{list-style-type: disc;margin-left: 40px;} +.list_style ol li{list-style-type: decimal;margin-left: 20px;} +.list_style ul li{list-style-type: disc;margin-left: 20px;} /*上传资源弹出框样式*/ .popbox_polls{position:fixed !important;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 5d528678a..d8285709f 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -951,5 +951,5 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;} .AgreementTxt{text-indent:2em; margin-bottom:15px;} .AgreementImg{ margin:0px auto;} -.list_style ol li{list-style-type: decimal;margin-left: 40px;} -.list_style ul li{list-style-type: disc;margin-left: 40px;} +.list_style ol li{list-style-type: decimal;margin-left: 20px;} +.list_style ul li{list-style-type: disc;margin-left: 20px;} From 3cb125ccbf893197079e508c4551d34a83d350c3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 23 Sep 2015 09:51:30 +0800 Subject: [PATCH 17/25] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=8F=96=E6=B6=88=E5=BC=80=E5=90=AF=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E6=97=A5=E6=9C=9F=E5=92=8C=E5=85=B3=E9=97=AD=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E6=97=A5=E6=9C=9F=E7=9A=84=E8=AE=BE=E7=BD=AE=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E6=95=88=E4=BB=A3=E7=A0=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_homework_detail_manual_form.html.erb | 110 ---------- .../_homework_detail_programing_form.html.erb | 193 ------------------ .../_new_homework_detail_manual_form.html.erb | 74 ------- app/views/homework_common/new.html.erb | 17 -- app/views/homework_common/next_step.html.erb | 30 --- app/views/users/_user_homework_form.html.erb | 8 - 6 files changed, 432 deletions(-) delete mode 100644 app/views/homework_common/_homework_detail_manual_form.html.erb delete mode 100644 app/views/homework_common/_homework_detail_programing_form.html.erb delete mode 100644 app/views/homework_common/_new_homework_detail_manual_form.html.erb delete mode 100644 app/views/homework_common/new.html.erb delete mode 100644 app/views/homework_common/next_step.html.erb diff --git a/app/views/homework_common/_homework_detail_manual_form.html.erb b/app/views/homework_common/_homework_detail_manual_form.html.erb deleted file mode 100644 index 59294f82d..000000000 --- a/app/views/homework_common/_homework_detail_manual_form.html.erb +++ /dev/null @@ -1,110 +0,0 @@ -
      -
    • - - -

      -
    • -
      -
    • - -
      - <% if edit_mode %> - <%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %> - <% else %> - <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - <%= f.kindeditor :description,:editor_id => 'homework_description_editor' %> - <% end %> -
      -
    • -
      -
    • - - <%= render :partial => 'attachments/new_form', :locals => {:container => homework} %> -
    • -
      -
    • - - - <%= calendar_for('homework_end_time')%> -
      -
    • - -
      -
    -
    -

    基本规则设置(总分为100分)

    -
    -
      -
    • - - <%#= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %> - -  分 -
      -
    • -
    • - - <%= f.check_box :homework_type, :class => "mb10 mt5 fl" %> -
      -
    • -
    • - - <%= select_tag :ta_proportion,options_for_select(ta_proportion_option,homework.homework_detail_manual.ta_proportion), {:class => "fl mb10 h26 w70"} %> - × 教辅评分 -   +   - - × 匿评得分 - = 学生得分 -
      -
    • -
    • - - 如果教师对学生作品进行了评分,则教师评分为学生最终得分。 -
      -
    • -
    -
    - -
    -

    学生互评设置

    -
    -
      -
    • - - - <%= calendar_for('evaluation_start_time')%> -
      -
    • -
    • - - - <%= calendar_for('evaluation_end_time')%> -
      -
    • -
    • - - -

      每个学生将收到 3 份待匿评作品

      -
      -
    • - -
    • - - <%= select_tag :absence_penalty,options_for_select(absence_penalty_option,homework.homework_detail_manual.absence_penalty), {:class => "fl mb10 h26 w70"} %> -  分 -

      学生漏评1个作品将扣 <%= homework.homework_detail_manual.absence_penalty%> 

      -
      -
    • -
    -
    \ No newline at end of file diff --git a/app/views/homework_common/_homework_detail_programing_form.html.erb b/app/views/homework_common/_homework_detail_programing_form.html.erb deleted file mode 100644 index 829905327..000000000 --- a/app/views/homework_common/_homework_detail_programing_form.html.erb +++ /dev/null @@ -1,193 +0,0 @@ -
      -
    • - - -

      -
    • -
      -
    • - -
      - <% if edit_mode %> - <%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %> - <% else %> - <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - <%= f.kindeditor :description,:editor_id => 'homework_description_editor' %> - <% end %> -
      -
    • -
      -
    • - - <%= render :partial => 'attachments/new_form', :locals => {:container => homework} %> -
    • -
      -
    • - - - <%= calendar_for('homework_end_time')%> -
      -
    • - - -
    • - - <%#= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %> - -  分 -
      -
    • -
    - -
    -
    -

    编程评测设置

    -
    -
      -
    • - - <%= select_tag :language,options_for_select(programing_languages_options,homework.homework_detail_programing.language.to_i), {:class => "fl mb10 h26 w70",:onchange => "homework_language_change($(this));"} %> -
      -
    • - -
    • - - <%= select_tag :ta_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "fl mb10 h26 w70"} %> - × 教辅评分 -   +   - - × 系统评分 - = 学生得分 -
      -
    • -
    • - - 如果教师对学生作品进行了评分,则教师评分为学生最终得分。 -
      -
    • - -
    • - - -
      -
    • - - <% if edit_mode %> - <% homework.homework_tests.each do |homework_test|%> -
      -
    • - - -
    • -
    • - - -
    • -
    • - - - <% if homework_test.result && !homework_test.result.to_s.empty?%> - <% if homework_test.result == 0%> - 正确 - <% else%> - 错误 - <% end%> - <% else%> - 测试 - <% end%> - -
    • -
      -
      - <% end%> - <% else %> -
      -
    • - - -
    • -
    • - - -
    • -
    • - - - 测试 - -
    • -
      -
      - <% end %> - - "> - - - - - - -
      - 错误信息: - - <% if homework.homework_tests.first && homework.homework_tests.first && homework.homework_tests.first.error_msg %> - <%= homework.homework_tests.first.error_msg%> - <% end%> -
      -
    -
    - - \ No newline at end of file diff --git a/app/views/homework_common/_new_homework_detail_manual_form.html.erb b/app/views/homework_common/_new_homework_detail_manual_form.html.erb deleted file mode 100644 index af5a8bf50..000000000 --- a/app/views/homework_common/_new_homework_detail_manual_form.html.erb +++ /dev/null @@ -1,74 +0,0 @@ -
    -
    -
    -
    发布作业
    -
    -
    -
    - -
    -
    - 导入作业 - -
    - -
    -
    -
    -
    - <% if edit_mode %> - <%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %> - <% else %> - <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - <%= f.kindeditor :description,:editor_id => 'homework_description_editor' %> - <% end %> -
    -
    - -
    - - -
    - 高级功能 -
    -
    -
    - -
    - 发布 - <%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'fr mr10 mt3'%> -
    -
    -
    -
    - -
    - - - diff --git a/app/views/homework_common/new.html.erb b/app/views/homework_common/new.html.erb deleted file mode 100644 index 6fc0fff0e..000000000 --- a/app/views/homework_common/new.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<%= 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'%> - <% end%> -
    -
    diff --git a/app/views/homework_common/next_step.html.erb b/app/views/homework_common/next_step.html.erb deleted file mode 100644 index 7ed852fea..000000000 --- a/app/views/homework_common/next_step.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %> -<%= error_messages_for 'homework_common' %> -
    -

    - <%= l(:label_course_homework_new)%> -

    -
    -<% if @homework_type == "1"%> -
    - <%= 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'%> - <% end%> -
    -<% elsif @homework_type == "2"%> -
    - <%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %> - <%= hidden_field_tag "course",@course.id%> - <%= hidden_field_tag "homework_common[homework_type]","2"%> - <%= render :partial => 'homework_common/homework_detail_programing_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'%> - <% end%> -
    -
    -<% end%> \ No newline at end of file diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index b19125ec6..6e07e7122 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -21,14 +21,6 @@ <%= calendar_for('homework_end_time')%>
    -
    - - <%= calendar_for('evaluation_start_time')%> -
    -
    - - <%= calendar_for('evaluation_end_time')%> -

    From b5af66ffc283c223f156c3c182c706db16109d94 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 23 Sep 2015 09:58:31 +0800 Subject: [PATCH 18/25] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=9A=84js=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/new_user.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 95d85e48c..fb71d75db 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -63,12 +63,12 @@ function submit_homework(id){ else if(!regex_homework_end_time()){ $("#homework_end_time").focus(); } - else if(!regex_evaluation_start()){ - $("#evaluation_start_time").focus() - } - else if(!regex_evaluation_end()){ - $("#evaluation_end_time").focus() - } + //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(); } From afb1a8f53f7e83680086718c27cf20bbdcb631a5 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 23 Sep 2015 09:59:23 +0800 Subject: [PATCH 19/25] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=A1=86=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=8C=89=E9=92=AE=E7=9A=84=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_message.html.erb | 2 +- app/views/users/_course_news.html.erb | 2 +- app/views/users/_project_issue.html.erb | 2 +- app/views/users/_project_message.html.erb | 2 +- public/javascripts/init_activity_KindEditor.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index bed895ee8..fd9ae05e8 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -107,7 +107,7 @@
    - 发送 +

    <% end%> diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 97f0acb69..99e85fc73 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -77,7 +77,7 @@
    - 发送 +

    <% end%> diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index e8bac335c..0b86dc3eb 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -121,7 +121,7 @@
    - 发送 +

    <% end%> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 32468f9a0..2856d6ed1 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -92,7 +92,7 @@
    - 发送 +

    <% end%> diff --git a/public/javascripts/init_activity_KindEditor.js b/public/javascripts/init_activity_KindEditor.js index c9d8189c2..decbbb341 100644 --- a/public/javascripts/init_activity_KindEditor.js +++ b/public/javascripts/init_activity_KindEditor.js @@ -48,7 +48,7 @@ function init_editor(params){ }, afterCreate:function(){ - params.submit_btn.hide(); + //params.submit_btn.hide(); var toolbar = $("div[class='ke-toolbar']",params.div_form); toolbar.css('width',24); $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情'); From 9d474d65281ba0d37a5f32542a52f06a77f9dc61 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 23 Sep 2015 13:54:36 +0800 Subject: [PATCH 20/25] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E9=9D=99=E6=80=81=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_set_evalutation_att.html.erb | 44 +++++++++++++++++++ app/views/users/_user_homework_list.html.erb | 3 ++ app/views/users/user_homeworks.html.erb | 9 +++- public/stylesheets/new_user.css | 11 +++-- 4 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 app/views/homework_common/_set_evalutation_att.html.erb diff --git a/app/views/homework_common/_set_evalutation_att.html.erb b/app/views/homework_common/_set_evalutation_att.html.erb new file mode 100644 index 000000000..1ad8188ef --- /dev/null +++ b/app/views/homework_common/_set_evalutation_att.html.erb @@ -0,0 +1,44 @@ +
    + 匿评设置 +
    + +
    + 开启匿评 +
    + + <%= calendar_for('evaluation_start_time')%> +
    +
    + +
    + +
    + 关闭匿评 +
    + + <%= calendar_for('evaluation_end_time')%> +
    +
    +
    + +
    + 匿评人数 + +
    +
    + +
    + 禁用匿评 + + 禁用后将无法进行学生互评 +
    +
    + +
    + +
    + 取消 +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index cd596e22b..61c9ff8a0 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -60,6 +60,9 @@
  • <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => 0),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
  • +
  • + 匿评设置 +
  • <%= homework_anonymous_comment homework_common %>
  • diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index a169be166..b6f4dd7e0 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -8,8 +8,13 @@ $("#homework_editor").toggle(); } - function checkAllBox(doc){ - + function set_evaluation_att(){ + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att') %>'); + showModal('ajax-modal', '350px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before("" + + ""); + $('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); }
    diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 5e049e029..006947928 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -58,6 +58,12 @@ h4{ font-size:14px; color:#3b3b3b;} .clearfix{clear:both;zoom:1} .break_word{ word-break:break-all; word-wrap: break-word;} .white_space{white-space:nowrap;} +.fontGrey3 {color:#484848;} +a.linkGrey6 {color:#484848 !important;} +a.linkGrey6:hover {color:#ffffff !important;} +.markPopup {width:290px; height:auto; padding:5px 0px 15px 15px; background-color:#ffffff; z-index:1000;} +.markInput {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:140px; color:#3d3c3c;} +.markPercentage {margin:10px 0; border:1px solid #e6e6e6; width:70px; height:30px; outline:none; font-size:12px; color:#3d3c3c;} /* Spacing */ .ml2{ margin-left:2px;} @@ -527,7 +533,7 @@ a.homepageWhite:hover {color:#a1ebff} a.newsGrey {color:#4b4b4b;} a.newsGrey:hover {color:#000000;} a.newsRed {color:red;} -a.newsRed:hovor {color:#888888;} +a.newsRed:hover {color:#888888;} a.replyGrey {color:#888888; display:inline-block;} a.replyGrey:hover {color:#4b4b4b;} a.replyGrey1 {color:#888888;} @@ -768,9 +774,6 @@ div.modal { .ui-widget { font-family: Verdana, sans-serif; font-size: 1.1em; - width: 200px; - height: 14px; - background: #e2e2e2; } .ui-dialog .ui-dialog-content { position: relative; From fa13ccfaa8c509b45708caf23357460ca91ed674 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 23 Sep 2015 15:44:48 +0800 Subject: [PATCH 21/25] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=8A=9F=E8=83=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 132 ++++-------------- .../_set_evalutation_att.html.erb | 83 ++++++----- .../set_evaluation_attr.js.erb | 1 + .../start_evaluation_set.js.erb | 6 + app/views/users/_user_homework_list.html.erb | 2 +- app/views/users/user_homeworks.html.erb | 9 -- config/routes.rb | 2 + public/javascripts/new_user.js | 57 ++++++-- public/stylesheets/new_user.css | 3 +- 9 files changed, 131 insertions(+), 164 deletions(-) create mode 100644 app/views/homework_common/set_evaluation_attr.js.erb create mode 100644 app/views/homework_common/start_evaluation_set.js.erb diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 41d302829..00d814bd3 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -5,9 +5,9 @@ class HomeworkCommonController < ApplicationController layout "base_courses" include StudentWorkHelper - before_filter :find_course, :only => [:index,:new,:create,:next_step] - before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy] - before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment] + before_filter :find_course, :only => [:index,:new,:create] + before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr] + before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr] before_filter :member_of_course, :only => [:index] def index @@ -23,116 +23,11 @@ class HomeworkCommonController < ApplicationController #新建作业,在个人作业列表创建作业 def new render_404 - # @homework_type = "1" - # - # @homework = HomeworkCommon.new - # @homework.safe_attributes = params[:homework_common] - # @homework.late_penalty = 2 - # @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') - # @homework.publish_time = Time.now.strftime('%Y-%m-%d') - # - # if @homework_type == "1" - # #匿评作业相关属性 - # @homework_detail_manual = HomeworkDetailManual.new - # @homework_detail_manual.ta_proportion = 0.6 - # @homework_detail_manual.absence_penalty = 2 - # @homework_detail_manual.evaluation_num = 3 - # @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d') - # @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d') - # @homework.homework_detail_manual = @homework_detail_manual - # elsif @homework_type == "2" - # #编程作业相关属性 - # @homework_detail_programing = HomeworkDetailPrograming.new - # @homework.homework_detail_programing = @homework_detail_programing - # end - # respond_to do |format| - # format.html - # end end #新建作业,在个人作业列表创建作业 def create redirect_to user_homeworks_user_path(User.current.id) - # if params[:homework_common] - # homework = HomeworkCommon.new - # homework.name = params[:homework_common][:name] - # homework.description = params[:homework_common][:description] - # homework.end_time = params[:homework_common][:end_time] - # homework.publish_time = params[:homework_common][:publish_time] - # homework.homework_type = params[:homework_common][:homework_type] - # homework.late_penalty = params[:late_penalty] - # homework.user_id = User.current.id - # homework.course_id = @course.id - # - # homework.save_attachments(params[:attachments]) - # render_attachment_warning_if_needed(homework) - # - # if homework.homework_type == 2 - # homework_detail_programing = HomeworkDetailPrograming.new - # 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} - # question[:input] = [] - # question[:output] = [] - # if params[:input] && params[:output] && params[:result] - # params[:input].each do |k,v| - # if params[:output].include? k - # homework_test = HomeworkTest.new - # homework_test.input = v - # homework_test.output = params[:output][k] - # homework_test.result = params[:result][k] - # homework_test.error_msg = params[:error_msg] - # homework.homework_tests << homework_test - # question[:input] << homework_test.input - # question[:output] << homework_test.output - # end - # end - # end - # - # # uri = URI('http://192.168.80.21:8080/api/questions.json') - # # body = question.to_json - # # res = Net::HTTP.new(uri.host, uri.port).start do |client| - # # request = Net::HTTP::Post.new(uri.path) - # # request.body = body - # # request["Content-Type"] = "application/json" - # # client.request(request) - # # end - # # result = JSON.parse(res.body) - # # homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0 - # - # homework.homework_detail_programing = homework_detail_programing - # else - # #匿评作业相关属性 - # homework_detail_manual = HomeworkDetailManual.new - # homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6 - # homework_detail_manual.comment_status = 1 - # homework_detail_manual.evaluation_start = params[:evaluation_start] - # homework_detail_manual.evaluation_end = params[:evaluation_end] - # homework_detail_manual.evaluation_num = params[:evaluation_num] - # homework_detail_manual.absence_penalty = params[:absence_penalty] - # homework.homework_detail_manual = homework_detail_manual - # end - # - # if homework.save - # homework_detail_programing.save if homework_detail_programing - # homework_detail_manual.save if homework_detail_manual - # respond_to do |format| - # format.html { - # flash[:notice] = l(:notice_successful_create) - # redirect_to homework_common_index_path(:course => @course.id) - # } - # end - # return - # end - # end - # - # respond_to do |format| - # format.html { - # flash[:notice] = l(:notice_failed_create) - # redirect_to new_homework_common_path(:course => @course.id) - # } - # end end def edit @@ -294,6 +189,27 @@ class HomeworkCommonController < ApplicationController end end + #启动匿评参数设置 + def start_evaluation_set + + end + + #设置匿评参数 + def set_evaluation_attr + if @homework_detail_manual + unless params[:evaluation_start].to_s == @homework_detail_manual.evaluation_start.to_s + @homework_detail_manual.evaluation_start = params[:evaluation_start] + end + + unless @homework_detail_manual.evaluation_end.to_s == params[:evaluation_end].to_s + @homework_detail_manual.evaluation_end = params[:evaluation_end] + end + + @homework_detail_manual.evaluation_num = params[:evaluation_num] + @homework_detail_manual.save + end + end + private #获取课程 def find_course diff --git a/app/views/homework_common/_set_evalutation_att.html.erb b/app/views/homework_common/_set_evalutation_att.html.erb index 1ad8188ef..01d9351ee 100644 --- a/app/views/homework_common/_set_evalutation_att.html.erb +++ b/app/views/homework_common/_set_evalutation_att.html.erb @@ -1,44 +1,53 @@
    - 匿评设置 -
    + <%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id},:method => "post",:remote => true) do |f|%> + 匿评设置 +
    -
    - 开启匿评 -
    - - <%= calendar_for('evaluation_start_time')%> -
    -
    +
    + 开启匿评 +
    + + <%= calendar_for('evaluation_start_time')%> +
    +
    +

    +
    +
    -
    +
    + 关闭匿评 +
    + + <%= calendar_for('evaluation_end_time')%> +
    +
    +

    +
    +
    -
    - 关闭匿评 -
    - - <%= calendar_for('evaluation_end_time')%> -
    -
    -
    +
    + 匿评人数 + +
    +

    +
    +
    -
    - 匿评人数 - -
    -
    +
    + 禁用匿评 + + 禁用后将无法进行学生互评 +
    +
    -
    - 禁用匿评 - - 禁用后将无法进行学生互评 -
    -
    - -
    - -
    - 取消 -
    -
    -
    +
    +
    + 确定 +
    +
    + 取消 +
    +
    +
    + <% end%>
    \ No newline at end of file diff --git a/app/views/homework_common/set_evaluation_attr.js.erb b/app/views/homework_common/set_evaluation_attr.js.erb new file mode 100644 index 000000000..d6ab73df5 --- /dev/null +++ b/app/views/homework_common/set_evaluation_attr.js.erb @@ -0,0 +1 @@ +clickCanel(); \ No newline at end of file diff --git a/app/views/homework_common/start_evaluation_set.js.erb b/app/views/homework_common/start_evaluation_set.js.erb new file mode 100644 index 000000000..9d494f908 --- /dev/null +++ b/app/views/homework_common/start_evaluation_set.js.erb @@ -0,0 +1,6 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att') %>'); +showModal('ajax-modal', '350px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + +""); +$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); \ No newline at end of file diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index 61c9ff8a0..2fc2304d1 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -61,7 +61,7 @@ <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => 0),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
  • - 匿评设置 + <%= link_to "匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true%>
  • <%= homework_anonymous_comment homework_common %> diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index b6f4dd7e0..a37709b69 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -7,15 +7,6 @@ homework_description_editor.html(""); $("#homework_editor").toggle(); } - - function set_evaluation_att(){ - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att') %>'); - showModal('ajax-modal', '350px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before("" + - ""); - $('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); - }
    作业
    diff --git a/config/routes.rb b/config/routes.rb index 409a04b20..ba6d161c2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -101,6 +101,8 @@ RedmineApp::Application.routes.draw do get 'start_anonymous_comment' get 'stop_anonymous_comment' get 'alert_anonymous_comment' + get 'start_evaluation_set' + post 'set_evaluation_attr' end collection do post 'next_step' diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index fb71d75db..86456bd8a 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -136,18 +136,36 @@ function search_homework_by_name(url){ ); } +//提交匿评参数设置 +function submit_set_evaluation_attr(end_time){ + if(!regex_evaluation_start(end_time)){ + $("#evaluation_start_time").focus(); + } + else if(!regex_evaluation_end()){ + $("#evaluation_end_time").focus(); + } + else if(!regex_evaluation_num()){ + $("#evaluation_num").focus(); + } + else{ + $('#popbox02 form').submit(); + } +} + //验证匿评开启时间:大于截止时间,或者为空 -function regex_evaluation_start(){ +function regex_evaluation_start(end_time){ var evaluation_start = $.trim($("#evaluation_start_time").val()); if(evaluation_start == ""){ - return true; + $("#homework_evaluation_start_time").text("开启匿评日期不能为空"); + return false; } - var end_time = new Date($.trim($("#homework_end_time").val())); + var end_time = new Date(end_time); var evaluation_start_time = new Date(evaluation_start); if(evaluation_start_time > end_time){ + $("#homework_evaluation_start_time").text(""); return true; }else{ - $("#homework_end_time_span").text("开启匿评日期必须大于截止日期"); + $("#homework_evaluation_start_time").text("开启匿评日期必须大于截止日期"); return false; } } @@ -157,17 +175,40 @@ function regex_evaluation_end(){ var evaluation_start = $.trim($("#evaluation_start_time").val()); var evaluation_end = $.trim($("#evaluation_end_time").val()); if(evaluation_end == ""){ + $("#homework_evaluation_end_time").text("关闭匿评日期不能为空"); 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){ + $("#homework_evaluation_end_time").text(""); return true; }else{ - $("#homework_end_time_span").text("关闭匿评日期必须大于开启匿评日期"); + $("#homework_evaluation_end_time").text("关闭匿评日期必须大于开启匿评日期"); + return false; + } +} + +//验证匿评数量 +function regex_evaluation_num(){ + var evaluation_num = $.trim($("#evaluation_num").val()); + var regex = /^\d+$/; + if(evaluation_num==""){ + $("#evaluation_num_notice").text("匿评人数不能为空"); + return false; + } + else if(regex.test(evaluation_num)){ + if(evaluation_num > 0){ + $("#evaluation_num_notice").html(""); + return true; + } + else{ + $("#evaluation_num_notice").text("匿评人数必须为大于0"); + return false; + } + } + else{ + $("#evaluation_num_notice").text("匿评人数只能为数字"); return false; } } diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 006947928..ed872936e 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -62,7 +62,7 @@ h4{ font-size:14px; color:#3b3b3b;} a.linkGrey6 {color:#484848 !important;} a.linkGrey6:hover {color:#ffffff !important;} .markPopup {width:290px; height:auto; padding:5px 0px 15px 15px; background-color:#ffffff; z-index:1000;} -.markInput {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:140px; color:#3d3c3c;} +.markInput { outline:none; border:1px solid #e6e6e6; height:30px; width:140px; color:#3d3c3c;} .markPercentage {margin:10px 0; border:1px solid #e6e6e6; width:70px; height:30px; outline:none; font-size:12px; color:#3d3c3c;} /* Spacing */ @@ -109,6 +109,7 @@ a.linkGrey6:hover {color:#ffffff !important;} .mb8 {margin-bottom:8px !important;} .mb10{ margin-bottom:10px !important;} .mb12 {margin-bottom:12px !important;} +.mb15{margin-bottom: 15px;} .mb20{ margin-bottom:20px;} .pl15{ padding-left:15px;} .w20{ width:20px;} From 7b37f3a9f40782308579b117067394fefec3d61b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 23 Sep 2015 17:25:38 +0800 Subject: [PATCH 22/25] =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E3=80=81=E5=85=B3=E9=97=AD=E5=8C=BF=E8=AF=84=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=BC=96=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/homework_evaluation.rake | 54 ++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 lib/tasks/homework_evaluation.rake diff --git a/lib/tasks/homework_evaluation.rake b/lib/tasks/homework_evaluation.rake new file mode 100644 index 000000000..691493dc8 --- /dev/null +++ b/lib/tasks/homework_evaluation.rake @@ -0,0 +1,54 @@ +#coding=utf-8 + +namespace :homework_evaluation do + desc "start evaluation" + def get_assigned_homeworks(student_works, n, index) + student_works += student_works + student_works[index + 1 .. index + n] + end + #自动开启匿评的任务 + task :start_evaluation => :environment do + homework_detail_manuals = HomeworkDetailManual.where("evaluation_start = '#{Date.today}'") + homework_detail_manuals.each do |homework_detail_manual| + homework_common = homework_detail_manual.homework_common + if homework_detail_manual.comment_status == 1 #新建状态才可开启匿评 + student_works = homework_common.student_works + if student_works && student_works.size >= 2 + student_works.each_with_index do |work, index| + user = work.user + n = homework_detail_manual.evaluation_num + n = n < student_works.size ? n : student_works.size - 1 + assigned_homeworks = get_assigned_homeworks(student_works, n, index) + assigned_homeworks.each do |h| + student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id) + student_works_evaluation_distributions.save + end + end + homework_detail_manual.update_column('comment_status', 2) + # 匿评开启消息邮件通知 + else + #作业数小于2,启动失败 + end + end + end + end + + #自动关闭匿评的任务 + task :end_evaluation => :environment do + homework_detail_manuals = HomeworkDetailManual.where("evaluation_end = '#{Date.today}'") + homework_detail_manuals.each do |homework_detail_manual| + homework_common = homework_detail_manual.homework_common + if homework_detail_manual.comment_status == 2 #开启匿评状态才可关闭匿评 + #计算缺评扣分 + work_ids = "(" + homework_common.student_works.map(&:id).join(",") + ")" + homework_common.student_works.each do |student_work| + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manuals.absence_penalty : 0 + student_work.save + end + homework_detail_manual.update_column('comment_status', 3) + # 匿评关闭消息邮件通知 + end + end + end +end From d727097ed2b69eb8dda9e78dbcc40012481beb0a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 23 Sep 2015 17:33:06 +0800 Subject: [PATCH 23/25] =?UTF-8?q?1=E3=80=81=E5=B7=B2=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E4=BB=A3=E7=A0=81=E6=B2=A1=E6=9C=89=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E8=AE=BE=E7=BD=AE=E5=8A=9F=E8=83=BD=202=E3=80=81?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=BB=93=E6=9D=9F=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- app/views/homework_common/index.html.erb | 4 ++-- app/views/homework_common/stop_anonymous_comment.js.erb | 2 +- app/views/users/_user_homework_list.html.erb | 2 +- lib/tasks/homework_evaluation.rake | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d7fac9a7d..e100a8fc9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2306,7 +2306,7 @@ module ApplicationHelper when 2 link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'postOptionLink' when 3 - link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束" + # link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束" end else link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "学生提交作业数大于2时才可以启动匿评" diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 4bf3d1781..8799bcab9 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -25,9 +25,9 @@ ( <%= 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,:is_in_course => 1),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %> - <%= link_to(l(:button_edit),edit_homework_common_path(homework,:is_in_course => 1), :class => "fr mr10 work_edit") %> + <%= link_to(l(:button_edit),edit_homework_common_path(homework,:is_in_course => 1), :class => "fr mr10 work_edit ml10") %> + <%= homework_anonymous_comment(homework)%> <% elsif @is_student%> <%= student_anonymous_comment homework %> <%= student_new_homework homework %> diff --git a/app/views/homework_common/stop_anonymous_comment.js.erb b/app/views/homework_common/stop_anonymous_comment.js.erb index 3cbac1bf6..4725d5731 100644 --- a/app/views/homework_common/stop_anonymous_comment.js.erb +++ b/app/views/homework_common/stop_anonymous_comment.js.erb @@ -1,2 +1,2 @@ -$("#<%= @homework.id %>_stop_anonymous_comment").replaceWith('匿评结束'); +$("#<%= @homework.id %>_stop_anonymous_comment").replaceWith(''); alert('关闭成功'); \ No newline at end of file diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index 2fc2304d1..89800b768 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -61,7 +61,7 @@ <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => 0),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
  • - <%= link_to "匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true%> + <%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) if homework_common.homework_detail_manual.comment_status == 1%>
  • <%= homework_anonymous_comment homework_common %> diff --git a/lib/tasks/homework_evaluation.rake b/lib/tasks/homework_evaluation.rake index 691493dc8..af833448d 100644 --- a/lib/tasks/homework_evaluation.rake +++ b/lib/tasks/homework_evaluation.rake @@ -1,7 +1,7 @@ #coding=utf-8 namespace :homework_evaluation do - desc "start evaluation" + desc "start and end evaluation" def get_assigned_homeworks(student_works, n, index) student_works += student_works student_works[index + 1 .. index + n] From ad6fbf6c9bf6a752f631d8fae6152ee4f9ed6ad7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 24 Sep 2015 09:25:56 +0800 Subject: [PATCH 24/25] =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E3=80=81=E5=A7=93=E5=90=8D=E3=80=81=E5=AD=A6?= =?UTF-8?q?=E5=8F=B7=E3=80=81=E6=97=B6=E9=97=B4=E5=88=97=E9=83=BD=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E5=B1=95=E5=BC=80=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student_work/_evaluation_un_work.html.erb | 38 ++++++++++--------- public/javascripts/course.js | 11 ++++++ 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index bc9fe2e00..ff2420a1a 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -3,27 +3,29 @@
    • - <%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %> -
    • -
    • - <% 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 => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> -
      -
    • -
    • -
        -
      • - <%= student_work.user.show_name%> -
      • -
      • - <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> -
      • -
      + <%= link_to(image_tag(url_to_avatar(User.current),:width =>"40",:height => "40"),user_activities_path(User.current.id))%>
    • +
      +
    • + <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> +
      + <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> +
      +
    • +
    • +
        +
      • + <%= student_work.user.show_name%> +
      • +
      • + <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> +
      • +
      +
    • +
  • -
  • +
  • <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  <% 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/public/javascripts/course.js b/public/javascripts/course.js index b471ea89e..07a149adb 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -975,3 +975,14 @@ $(function(){ function new_homework_alert(){ alert("您好!课程内直接发布作业的功能正在改进中,请直接点击\n顶部导航栏的“作业”向本课程发送作业。谢谢!如有问\n题,可参见帮助中心。"); } + +function show_student_work(url){ + $.get( + url, + { + + }, + function (data) { + } + ); +} From f9f51557ddd72d232a84a4cdb7d1188616256068 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 24 Sep 2015 11:31:07 +0800 Subject: [PATCH 25/25] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 67 +++++++++++----------- app/views/layouts/_new_feedback.html.erb | 3 +- public/images/sidebar_bg.png | Bin 9114 -> 9913 bytes public/javascripts/feedback.js | 65 +++++++-------------- public/stylesheets/new_user.css | 17 +++--- public/stylesheets/public.css | 18 +++--- 6 files changed, 73 insertions(+), 97 deletions(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index 07f852914..9fe25ce95 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -1,9 +1,9 @@ @@ -39,7 +39,7 @@ minStatue : true, skin : 'blue', durationTime : 1000 - } + }; var options = $.extend(defaults, options); this.each(function(){ @@ -56,13 +56,13 @@ if(options.minStatue == "true"){ $(".show_btn").css("float", options.float); sideContent.css('width', 0); - show_btn.css('width', 25); + show_btn.css('width', 29); } //close closeBtn.bind("click",function(){ sideContent.animate({width: '0px'},"fast"); - show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast"); + show_btn.stop(true, true).delay(300).animate({ width: '29px'},"fast"); cookiesave('minStatue','true','','',''); }); //show @@ -83,14 +83,10 @@ $(function(){ $("#button1").click(function(){ myTips("<%= l(:label_feedback_success) %>","success"); }); - }); function f_submit() { -// var subject = $("#memo_subject").val(); -// var content = $("#memo_content_1").val(); -// $("#memo_subject").val(subject+":"+ content.substr(0,18)+"..."); $("#new_memo").submit(); } @@ -169,15 +165,15 @@ function cookieget(n)
    <% get_memo %> - <% if @public_forum %> - <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> - <%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %> - <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> - <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %> - - <%= l(:label_submit)%> - <% end %> - <% end %> + <% if @public_forum %> + <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> + <%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %> + <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> + <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %> + + <%= l(:label_submit)%> + <% end %> + <% end %>
    -
    <%= l(:label_submit)%>
    +
  • diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb index db0a3c3ee..136e49b37 100644 --- a/app/views/layouts/_new_feedback.html.erb +++ b/app/views/layouts/_new_feedback.html.erb @@ -30,6 +30,7 @@
    - 在线客服 + <%= l(:label_submit)%> +
    diff --git a/public/images/sidebar_bg.png b/public/images/sidebar_bg.png index 2704727d7d7984e6fb748b28a35ee9e14cf25d84..9ceea0f9176902560fa21d8eddd17a372d761edd 100644 GIT binary patch delta 7003 zcmaJ_Wmr>x*dB~fkdhK9DVq{0Ns$miP?T<~{u1FYl*!U(U7bob#OL_vC%w=^71BE1PKm&IL`?hcA7{*Czb}U+y-aZ5py& zMz~UZuc8!FX4~WUBD3wa$xl&hc1&)Z2>6+>rzdRaQv1Gsq_3KROHE8t*;_cCOVgk7|#E^W-BmulYMWI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public/javascripts/feedback.js index 1bbab1f45..fb3b35ca7 100644 --- a/public/javascripts/feedback.js +++ b/public/javascripts/feedback.js @@ -5,7 +5,7 @@ minStatue : true, skin : 'blue', durationTime : 1000 - } + }; var options = $.extend(defaults, options); this.each(function(){ @@ -13,17 +13,13 @@ var thisBox = $(this), closeBtn = thisBox.find('.close_btn' ), show_btn = thisBox.find('.show_btn' ), - sideContent = thisBox.find('.side_content'), - sideList = thisBox.find('.side_list') - ; + sideContent = thisBox.find('.side_content'); var defaultTop = thisBox.offset().top; //????????top - thisBox.css(options.float, 0); if(options.minStatue == "true"){ - $(".show_btn").css("float", options.float); + show_btn.css("float", options.float); sideContent.css('width', 0); show_btn.css('width', 25); - } //close closeBtn.bind("click",function(){ @@ -37,26 +33,12 @@ sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast"); cookiesave('minStatue','false','','',''); }); - - - }); //end this.each }; })(jQuery); - -$(function(){ - $("#button1").click(function(){ - myTips("<%= l(:label_feedback_success) %>","success"); - }); - -}); - function f_submit() { -// var subject = $("#memo_subject").val(); -// var content = $("#memo_content").val(); -// $("#memo_subject").val(subject+":"+ content.substr(0,18)+"..."); $("#new_memo").submit(); } @@ -68,11 +50,8 @@ function cookiesave(n, v, mins, dn, path) if(!mins) mins = 365 * 24 * 60; if(!path) path = "/"; var date = new Date(); - date.setTime(date.getTime() + (mins * 60 * 1000)); - var expires = "; expires=" + date.toGMTString(); - if(dn) dn = "domain=" + dn + "; "; document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path; @@ -86,34 +65,31 @@ function cookieget(n) var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(name) == 0){ - return c.substring(name.length,c.length);} - + return c.substring(name.length,c.length); + } } return false; } $(function(){ + $(".closeSidebar").click(function(){ + $(".show_btn").css("display","none"); + $("#scrollsidebar").css("display","none"); + return false; + }); + $("#button1").click(function(){ - myTips("<%= l(:label_feedback_success) %>","success"); + myTips("反馈成功","success"); }); -}); - - -$(document).ready(function () { - $(function () { - $("#scrollsidebar").fix({ - float: 'right', //default.left or right - minStatue: cookieget('minStatue'), - skin: 'green', //default.gray or blue - durationTime: 600 - }); + $("#scrollsidebar").fix({ + float: 'right', //default.left or right + minStatue: cookieget('minStatue'), + skin: 'green', //default.gray or blue + durationTime: 600 }); -}); - -$(document).ready(function(){ $("#subject").keydown(function(){ var curLength=$("#subject").val().length; if(curLength>50){ @@ -123,8 +99,7 @@ $(document).ready(function(){ else{ $("#textCount").text(50-$("#subject").val().length) } - }) - $("#subject").keyup(function(){ + }).keyup(function(){ var curLength=$("#subject").val().length; if(curLength>50){ var num=$("#subject").val().substr(0,50); @@ -133,5 +108,5 @@ $(document).ready(function(){ else{ $("#textCount").text(50-$("#subject").val().length) } - }) -}) \ No newline at end of file + }); +}); \ No newline at end of file diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index ed872936e..1022d5aa2 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -711,7 +711,7 @@ html{ overflow-x:hidden;} .scrollsidebar{ position: fixed; bottom:1px; right:1px; background:none; } .side_content{width:154px; height:auto; overflow:hidden; float:left; } .side_content .side_list {width:154px;overflow:hidden;} -.show_btn{ width:0; height:112px; overflow:hidden; float:left; margin-top:190px;cursor:pointer;} +.show_btn{ width:0; height:112px; overflow:hidden; float:left; margin-top:200px; cursor:pointer;} .show_btn span { display:none;} .close_btn{width:24px;height:24px;cursor:pointer;} .side_title,.side_bottom,.close_btn,.show_btn {background:url(../images/sidebar_bg.png) no-repeat; } @@ -721,20 +721,21 @@ html{ overflow-x:hidden;} .close_btn { float:right; display:block; width:21px; height:16px; margin:9px 10px 0 0; _margin:16px 5px 0 0;} .close_btn span { display:none;} .side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;} -.msgserver { margin-top:5px;} -.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -112px; padding-left:22px; height:21px; display:block; } +.msgserver { margin:10px 0 0px 5px;} +.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -110px; padding-left:22px; display:block; height:24px; } .opnionText{box-shadow:none; width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;} -a.opnionButton{ display:block; background:#15bccf; width:130px; height:23px; margin-top:5px; text-align:center; padding-top:3px;} -a:hover.opnionButton{background: #0fa9bb; } +a.opnionButton{ display:block; background:#269ac9; width:130px; height:26px; margin-top:5px; text-align:center; padding-top:0px; color:#fff;} +a.opnionButton:hover{background: #297fb8; } /* blue skin as the default skin */ .side_title {background-position:-195px 0;} .side_center {background:url(../images/blue_line.png) repeat-y center; } .side_bottom {background-position:-195px -50px;} -a.close_btn {background-position:-44px 0;} -a:hover.close_btn {background-position:-66px 0;} +.close_btn {background-position:-44px 0;} +.close_btn:hover {background-position:-66px 0;} .show_btn {background-position:-119px 0;} -.msgserver a {color:#15bccf; } +.msgserver a {color:#269ac9; } .msgserver a:hover { text-decoration:underline; } +.closeSidebar {background:url(../images/sidebar_bg.png) 0px -112px no-repeat; width:28px; height:18px; margin-top:65px; position:absolute;} /***** Ajax indicator ******/ diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d8285709f..3031a964e 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -714,7 +714,7 @@ html{ overflow-x:hidden;} .scrollsidebar{ position: fixed; bottom:1px; right:1px; background:none; } .side_content{width:154px; height:auto; overflow:hidden; float:left; } .side_content .side_list {width:154px;overflow:hidden;} -.show_btn{ width:0; height:112px; overflow:hidden; float:left; margin-top:190px;cursor:pointer;} +.show_btn{ width:0; height:112px; overflow:hidden; float:left; margin-top:200px; cursor:pointer;} .show_btn span { display:none;} .close_btn{width:24px;height:24px;cursor:pointer;} .side_title,.side_bottom,.close_btn,.show_btn {background:url(../images/sidebar_bg.png) no-repeat; } @@ -724,21 +724,21 @@ html{ overflow-x:hidden;} .close_btn { float:right; display:block; width:21px; height:16px; margin:9px 10px 0 0; _margin:16px 5px 0 0;} .close_btn span { display:none;} .side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;} -.msgserver { margin-top:5px;} -/*.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -112px; padding-left:22px; height:21px; display:block; }*/ -.msgserver a { padding-left:4px; height:21px; display:block; } +.msgserver { margin:10px 0 0px 5px;} +.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -110px; padding-left:22px; display:block; height:24px; } .opnionText{box-shadow:none; width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;} -a.opnionButton{ display:block; background:#15bccf; width:130px; height:23px; margin-top:5px; text-align:center; padding-top:3px;} -a:hover.opnionButton{background: #0fa9bb; } +a.opnionButton{ display:block; background:#269ac9; width:130px; height:26px; margin-top:5px; text-align:center; padding-top:0px; color:#fff;} +a.opnionButton:hover{background: #297fb8; } /* blue skin as the default skin */ .side_title {background-position:-195px 0;} .side_center {background:url(../images/blue_line.png) repeat-y center; } .side_bottom {background-position:-195px -50px;} -a.close_btn {background-position:-44px 0;} -a:hover.close_btn {background-position:-66px 0;} +.close_btn {background-position:-44px 0;} +.close_btn:hover {background-position:-66px 0;} .show_btn {background-position:-119px 0;} -.msgserver a {color:#15bccf; } +.msgserver a {color:#269ac9; } .msgserver a:hover { text-decoration:underline; } +.closeSidebar {background:url(../images/sidebar_bg.png) 0px -112px no-repeat; width:28px; height:18px; margin-top:65px; position:absolute;} .hiddent{ overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}