This commit is contained in:
ouyangxuhua 2015-10-23 16:28:40 +08:00
commit 16f0868df3
14 changed files with 74 additions and 42 deletions

View File

@ -6,8 +6,8 @@ class HomeworkCommonController < ApplicationController
include StudentWorkHelper
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 :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set]
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,:score_rule_set]
before_filter :member_of_course, :only => [:index]
def index
@ -215,6 +215,11 @@ class HomeworkCommonController < ApplicationController
end
end
#评分设置
def score_rule_set
end
private
#获取课程
def find_course

View File

@ -457,7 +457,13 @@ class StudentWorkController < ApplicationController
end
end
respond_to do |format|
format.html{redirect_to student_work_index_url(:homework => @homework.id)}
format.html{
if params[:student_path]
redirect_to student_work_index_url(:homework => @homework.id)
else
redirect_to user_homeworks_user_path(User.current.id)
end
}
end
end

View File

@ -76,11 +76,13 @@
}
$("#intro_content_show_<%= activity.id %>").click(function(){
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
$("#intro_content_show_<%= activity.id %>").hide();
$("#intro_content_hide_<%= activity.id %>").show();
});
$("#intro_content_hide_<%= activity.id %>").click(function(){
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= activity.id %>").hide();
$("#intro_content_show_<%= activity.id %>").show();
});

View File

@ -0,0 +1,6 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false}) %>');
showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");

View File

@ -1,4 +1,7 @@
<%= form_for('new_form',:url => {:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id},:method => "post") do |f|%>
<% if student_path %>
<%=hidden_field_tag 'student_path', params[:student_path], :value => student_path %>
<% end %>
<div class="markPopup" id="popbox02">
<span class="uploadText">评分设置</span>
<div class="mt15">

View File

@ -1,35 +1,35 @@
<div class="fl">
<span id="attachments_fields<%= work.id%>" xmlns="http://www.w3.org/1999/html">
</span>
<div class="cl"></div>
<span class="add_attachment" style="font-weight:normal;">
<%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => "_file#{work.id}",
:class => 'file_selector',
:multiple => true,
:onchange => "addInputFiles_board(this, '#{work.id}');",
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all),
:containerid => "#{work.id}"
} %>
<span id="upload_file_count<%= work.id%>">
<%= l(:label_no_file_uploaded) %>
</span>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>
</div>
<div class="fl">
<span id="attachments_fields<%= work.id%>" xmlns="http://www.w3.org/1999/html">
</span>
<div class="cl"></div>
<span class="add_attachment" style="font-weight:normal;">
<%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'sub_btn mb0' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => "_file#{work.id}",
:class => 'file_selector',
:multiple => true,
:onchange => "addInputFiles_board(this, '#{work.id}');",
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all),
:containerid => "#{work.id}"
} %>
<span id="upload_file_count<%= work.id%>">
<%= l(:label_no_file_uploaded) %>
</span>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>
</div>

View File

@ -20,7 +20,7 @@
//设置评分规则
function set_score_rule(){
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework}) %>');
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework,:student_path => true}) %>');
showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +

View File

@ -44,11 +44,13 @@
}
$("#intro_content_show_<%= user_activity.id %>").click(function(){
$("#activity_description_<%= user_activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= user_activity.id%>").toggleClass("lh18");
$("#intro_content_show_<%= user_activity.id %>").hide();
$("#intro_content_hide_<%= user_activity.id %>").show();
});
$("#intro_content_hide_<%= user_activity.id %>").click(function(){
$("#activity_description_<%= user_activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= user_activity.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= user_activity.id %>").hide();
$("#intro_content_show_<%= user_activity.id %>").show();
});

View File

@ -68,6 +68,9 @@
<li>
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
</li>
<li>
<%= link_to("评分设置", score_rule_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) %>
</li>
<li>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) if homework_common.homework_detail_manual.comment_status == 1%>
</li>

View File

@ -21,11 +21,13 @@
}
$("#intro_content_show_<%= homework_common.id%>").click(function(){
$("#homework_description_<%= homework_common.id%>").toggleClass("maxh360");
$("#homework_description_<%= homework_common.id%>").toggleClass("lh18");
$("#intro_content_show_<%= homework_common.id%>").hide();
$("#intro_content_hide_<%= homework_common.id%>").show();
});
$("#intro_content_hide_<%= homework_common.id%>").click(function(){
$("#homework_description_<%= homework_common.id%>").toggleClass("maxh360");
$("#homework_description_<%= homework_common.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= homework_common.id%>").hide();
$("#intro_content_show_<%= homework_common.id%>").show();
});

View File

@ -102,6 +102,7 @@ RedmineApp::Application.routes.draw do
get 'stop_anonymous_comment'
get 'alert_anonymous_comment'
get 'start_evaluation_set'
get 'score_rule_set'
post 'set_evaluation_attr'
end
collection do

View File

@ -158,7 +158,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -85px -150px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/public_icon.png) -27px -577px no-repeat; padding-left:25px; font-size:14px; margin-right:25px;}
.homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
.postAttSize {color:#888888; font-size:12px;}
a.postGrey {color:#484848;}

View File

@ -105,6 +105,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
.mt12 { margin-top:12px;}
.mt15 {margin-top:15px;}
.mt19 {margin-top:19px !important;}
.mb0 {margin-bottom: 0px !important;}
.mb4{ margin-bottom:4px;}
.mb5{ margin-bottom:5px;}
.mb8 {margin-bottom:8px !important;}
@ -501,7 +502,7 @@ input.sendSourceText:hover {background-color:#297fb8;}
.popbox{/* width:300px; *//* height:100px; */position:fixed !important;/* z-index:100; */left:50%;top:50%;margin:-100px 0 0 -150px; /* background:#fff; */ -moz-border-radius:5px; /* -webkit-border-radius:5px; */ /* border-radius:5px; */ /* box-shadow:0px 0px 8px #194a81; */ /* overflow:auto; */}
/*上传资源弹窗*/
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
.uploadText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:140px; display:inline-block;}
.uploadText {font-size:16px; color:#269ac9; line-height:16px; padding-top:15px; width:140px; display:inline-block;}
.uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative;}
.uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#269ac9; border-radius:3px; float:left; margin-right:12px;}
.uploadBox:hover {background-color:#297fb8;}
@ -684,7 +685,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -85px -150px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/public_icon.png) -27px -577px no-repeat; padding-left:25px; font-size:14px; margin-right:25px;}
.homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
.postAttSize {color:#888888; font-size:12px;}
a.postGrey {color:#484848;}

View File

@ -108,6 +108,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mt15 {margin-top:15px;}
.mt19 {margin-top:19px !important;}
.ml70{margin-left: 70px;}
.mb0 {margin-bottom: 0px !important;}
.mb4{ margin-bottom:4px;}
.mb5{ margin-bottom:5px;}
.mb8 {margin-bottom:8px;}