Merge branch 'cxt_course' into develop
Conflicts: app/views/users/_homework_repository.html.erb public/stylesheets/new_user.css
This commit is contained in:
commit
df1c70880a
|
@ -11,6 +11,7 @@ class HomeworkCommonController < ApplicationController
|
|||
before_filter :member_of_course, :only => [:index]
|
||||
|
||||
def index
|
||||
update_homework_time(@course.homework_commons)
|
||||
@new_homework = HomeworkCommon.new
|
||||
@new_homework.homework_detail_manual = HomeworkDetailManual.new
|
||||
@new_homework.course = @course
|
||||
|
@ -400,4 +401,42 @@ class HomeworkCommonController < ApplicationController
|
|||
student_works += student_works
|
||||
student_works[index + 1 .. index + n]
|
||||
end
|
||||
|
||||
def update_homework_time homeworks
|
||||
unless homeworks.nil?
|
||||
homeworks.each do |h|
|
||||
if h.homework_type == 3
|
||||
student_works = h.student_works.where("project_id != 0")
|
||||
time = h.updated_at
|
||||
unless student_works.nil?
|
||||
student_works.each do |s|
|
||||
project = Project.find s.project_id
|
||||
unless project.nil? && project.gpid.nil?
|
||||
begin
|
||||
# gitlab端获取默认分支
|
||||
g = Gitlab.client
|
||||
default_branch = g.project(project.gpid).default_branch
|
||||
changesets = g.commits(project.gpid, :ref_name => default_branch)
|
||||
changesets_latest_coimmit = changesets[0]
|
||||
unless changesets[0].blank?
|
||||
if time < changesets_latest_coimmit.created_at
|
||||
time = changesets_latest_coimmit.created_at
|
||||
end
|
||||
end
|
||||
rescue
|
||||
logger.error("############## ==> update homework project time")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
puts h.updated_at
|
||||
puts time
|
||||
s_time = time
|
||||
if format_time(time) > format_time(h.updated_at)
|
||||
h.update_attribute(:updated_at, s_time)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1147,7 +1147,7 @@ class StudentWorkController < ApplicationController
|
|||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||
sheet1.row(0).default_format = blue
|
||||
if @homework.homework_type == 1 #匿评作业
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),l(:excel_homework_des),
|
||||
l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
items.each do |homework|
|
||||
|
@ -1157,15 +1157,16 @@ class StudentWorkController < ApplicationController
|
|||
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
||||
sheet1[count_row,4] = homework.user.mail
|
||||
sheet1[count_row,5] = homework.name
|
||||
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
|
||||
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
|
||||
sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,10] = format_time(homework.created_at)
|
||||
sheet1[count_row,6] = homework.description
|
||||
sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
|
||||
sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
|
||||
sheet1[count_row,9] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,11] = format_time(homework.created_at)
|
||||
count_row += 1
|
||||
end
|
||||
elsif @homework.homework_type == 2 #编程作业
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),l(:excel_homework_des),
|
||||
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
items.each do |homework|
|
||||
|
@ -1175,12 +1176,13 @@ class StudentWorkController < ApplicationController
|
|||
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
||||
sheet1[count_row,4] = homework.user.mail
|
||||
sheet1[count_row,5] = homework.name
|
||||
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
|
||||
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
|
||||
sheet1[count_row,8] = homework.system_score.nil? ? l(:label_without_score) : format("%.2f",homework.system_score)
|
||||
sheet1[count_row,9] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,11] = format_time(homework.created_at)
|
||||
sheet1[count_row,6] = homework.description
|
||||
sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
|
||||
sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
|
||||
sheet1[count_row,9] = homework.system_score.nil? ? l(:label_without_score) : format("%.2f",homework.system_score)
|
||||
sheet1[count_row,10] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,11] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,12] = format_time(homework.created_at)
|
||||
count_row += 1
|
||||
end
|
||||
end
|
||||
|
|
|
@ -396,6 +396,19 @@ class UsersController < ApplicationController
|
|||
end
|
||||
# end
|
||||
|
||||
#引用作业请求弹框
|
||||
def apply_homework
|
||||
if User.current.logged?
|
||||
@homework = HomeworkCommon.find params[:homework_id]
|
||||
@state = 2
|
||||
else
|
||||
@state = 1
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#申请引用非公开作业
|
||||
def apply_for_homework
|
||||
if User.current.logged?
|
||||
|
@ -405,7 +418,7 @@ class UsersController < ApplicationController
|
|||
if ah.empty?
|
||||
ApplyHomework.create(:user_id => params[:id].to_i, :homework_common_id => params[:homework_id].to_i, :status => 1)
|
||||
Mailer.run.apply_for_homework_request(homework, User.current)
|
||||
CourseMessage.create(:user_id => homework.user_id, :course_id => homework.course.id, :viewed => false,:course_message_id=>params[:homework_id].to_i,:course_message_type=>'HomeworkCommon',:status=>5,:apply_user_id=>params[:id].to_i)
|
||||
CourseMessage.create(:user_id => homework.user_id, :course_id => homework.course.id, :viewed => false,:course_message_id=>params[:homework_id].to_i,:course_message_type=>'HomeworkCommon',:status=>5,:apply_user_id=>params[:id].to_i,:content=>params[:content])
|
||||
@state = 2
|
||||
@ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", params[:id].to_i, params[:homework_id].to_i).first
|
||||
@homework = homework
|
||||
|
@ -452,7 +465,7 @@ class UsersController < ApplicationController
|
|||
user_course_ids = @user.courses.empty? ? "(-1)" :"(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
|
||||
|
||||
#判断当前用户在当前课程的身份
|
||||
visibleCourse = @user.courses.empty? ? [] : @user.courses.visible
|
||||
visibleCourse = @user.courses.empty? ? [] : @user.courses.where("is_delete = 0").visible
|
||||
homework_ids = []
|
||||
visibleCourse.each do |course|
|
||||
homeworks = HomeworkCommon.where("course_id = #{course.id} and publish_time <= '#{Date.today}'")
|
||||
|
@ -473,7 +486,7 @@ class UsersController < ApplicationController
|
|||
|
||||
def choose_user_course
|
||||
homework = HomeworkCommon.find params[:send_id].to_i
|
||||
if homework.course.is_public == 0 && homework.user_id != User.current.id
|
||||
if homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course)
|
||||
ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:send_id].to_i)
|
||||
if ah.empty?
|
||||
@status = 2
|
||||
|
@ -622,7 +635,21 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def show_homework_detail
|
||||
@homework = HomeworkCommon.find params[:homework].to_i
|
||||
homework = HomeworkCommon.find params[:homework].to_i
|
||||
if homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course)
|
||||
ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:homework].to_i)
|
||||
if ah.empty?
|
||||
@status = 2
|
||||
@homework = nil
|
||||
elsif ah.first.status != 2
|
||||
@status = ah.first.status
|
||||
@homework = nil
|
||||
elsif ah.first.status == 2
|
||||
@homework = homework
|
||||
end
|
||||
else
|
||||
@homework = homework
|
||||
end
|
||||
@is_import = params[:is_import]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<li class="fl">
|
||||
<input name="outline_id" type="radio" value="<%= article.id%>" class="courseSendCheckbox"/>
|
||||
</li>
|
||||
<li class="blogTitle fl"><%= article.title%></li>
|
||||
<li class="blogTitle fl mw220"><%= article.title%></li>
|
||||
</ul>
|
||||
<div class="homeworkPublishTime">发布时间:<%= format_date(article.created_at)%></div>
|
||||
<% end %>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<p id="hint_message_<%=work.id %>" style="margin-left: 65px;"></p>
|
||||
<li >
|
||||
<span class="tit_fb mt2"> 评分:</span>
|
||||
<input type="number" name="score" id="score_<%= work.id%>" value="<%= score.nil? ? 60 : score.score%>" min="0" max="100" size="4" data-units="dollars" />
|
||||
<input type="number" name="score" id="score_<%= work.id%>" value="<%= score.nil? ? 0 : score.score%>" min="0" max="100" size="4" data-units="dollars" />
|
||||
<span class=" ml5">分</span>
|
||||
<div class="cl"></div></li>
|
||||
<li >
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
|
||||
<% end %>
|
||||
<% when '6' %>
|
||||
<% if obj.author_id == User.current.id || User.current.admin?%>
|
||||
<% if obj.author_id == User.current.id || User.current.admin? || (obj.container_type == 'Course' && User.current.allowed_to?(:as_teacher,obj.course)) %>
|
||||
<% select_tag_name ||= ""%>
|
||||
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag_new", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag, :select_tag_name => select_tag_name %> </span>
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<div>
|
||||
<div class="ni_con">
|
||||
<p class="mt30">
|
||||
<% if state == 2 %>
|
||||
请求已发送至<%=homework.user.show_name %>老师,希望他同意与你分享:)
|
||||
<% elsif state == 3 %>
|
||||
您已发送过分享请求,请勿重复发送。
|
||||
<% end %>
|
||||
</p>
|
||||
<div class="ni_btn">
|
||||
<a href="javascript:" class="tijiao" onclick="hideModal();" style="margin-bottom: 10px; margin-left: 60px; color: #fff;" >
|
||||
确 定
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,27 @@
|
|||
<div>
|
||||
<div class="ni_con">
|
||||
<h2>请求分享</h2>
|
||||
<p>
|
||||
请求说明(可选):
|
||||
<textarea type="text" id="apply_content" class="apply_content mt10" style="outline:none;"></textarea>
|
||||
</p>
|
||||
<div class="ni_btn">
|
||||
<a href="javascript:" class="tijiao" onclick="apply_to();" style="margin-bottom: 20px; margin-left: 60px; color: #fff">
|
||||
确 定
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function apply_to() {
|
||||
url = '/users/<%=User.current.id %>/apply_for_homework?homework_id=<%=homework.id %>&content='+$("#apply_content").val();
|
||||
$.get(
|
||||
url,
|
||||
{
|
||||
|
||||
},
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
}
|
||||
</script>
|
|
@ -8,7 +8,7 @@
|
|||
function (data) {
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class="h450">
|
||||
|
@ -37,11 +37,10 @@
|
|||
<li class="subject-list-publisher fl hidden"><%= homework.user.show_name %></li>
|
||||
<li class="subject-list-count fl" id="subject_count_homework_<%=homework.id %>"><%= homework.quotes %></li>
|
||||
<li class="fl subject-list-date"><%=format_date homework.publish_time %></li>
|
||||
<% if homework.course && homework.course.is_public == 0 && homework.user_id != User.current.id %>
|
||||
<li class="fl subject-list-option" id="homework_apply_status_<%=homework.id %>">
|
||||
<% if homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course) %> <li class="fl subject-list-option" id="homework_apply_status_<%=homework.id %>">
|
||||
<% ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, homework.id).first %>
|
||||
<% if ah.nil? %>
|
||||
<%= link_to("提交申请", apply_for_homework_user_path(User.current.id,:homework_id => homework.id), :remote => true) %>
|
||||
<%= link_to("请求分享", apply_homework_user_path(User.current.id,:homework_id => homework.id), :class => 'green_btn_share c_white', :remote => true) %>
|
||||
<% elsif ah.status == 1 %>
|
||||
待审核
|
||||
<% elsif ah.status == 2 %>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="subjectDetail fl mt10">
|
||||
<div class="subjectInfo">题目信息</div>
|
||||
<div class="subject-content-wrapper">
|
||||
<% if homework.nil? %>
|
||||
<% if homework.nil? && status == 0 %>
|
||||
<span id="homework_notice_span"><span class="center db">本题库遵循创作共用许可证</span><br>
|
||||
|
||||
教师给学生出题本质上是一种创作行为,题目的作者通常为此付出大量时间和精力。好的题目不仅能加深学生对知识点的理解,还能激发学生兴趣,提升学习效率。为此,本网站的题库许可证基于创作共用许可证( Creative Commons License )建立,其核心条款包括:<br/><br/>
|
||||
|
@ -14,6 +14,14 @@
|
|||
|
||||
对此许可证的支持或反对,请在网站中留言,我们不断完善,谢谢!
|
||||
</span>
|
||||
<% elsif homework.nil? && status == 1 %>
|
||||
<span class="c_red">您选中的作业目前为私有作业,您的分享请求已发送至老师,请耐心等待老师的同意。</span>
|
||||
<% elsif homework.nil? && status == 2 %>
|
||||
<span class="c_red">您选中的作业目前为私有作业,请点击“请求分享”按钮向题目的作者发送分享请求吧!<br/>
|
||||
祝您成功:)
|
||||
</span>
|
||||
<% elsif homework.nil? && status == 3 %>
|
||||
<span class="c_red">您选中的作业目前为私有作业,您的分享请求已被老师拒绝,暂时不可查看作业详情。</span>
|
||||
<% else %>
|
||||
<div class="subjectIntro mb15">标题:<%=homework.name %><br />
|
||||
来源:<%=homework.course.name %><br />
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<div>
|
||||
<div class="ni_con">
|
||||
<p class="mt30">
|
||||
<% if status == 1 %>
|
||||
您的分享请求暂未通过审核,暂时不可发送至课程。
|
||||
<% elsif status == 2 %>
|
||||
您选中的作业目前为私有作业,请点击“请求分享”按钮向题目的作者发送分享请求吧!祝您成功:)
|
||||
<% elsif status == 3 %>
|
||||
您的分享请求已被老师拒绝,不可发送至课程。
|
||||
<% end %>
|
||||
</p>
|
||||
<div class="ni_btn">
|
||||
<a href="javascript:" class="tijiao" onclick="hideModal();" style="margin-bottom: 10px; margin-left: 60px; color: #fff;" >
|
||||
确 定
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -237,7 +237,8 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您有了新的引用作业申请:</span>
|
||||
</li>
|
||||
<li class="homepageHomeworkContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<span title='<%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"" %>' class ='#{ma.viewed==0 ? "newsBlack" : "newsGrey"}'><%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"" %></span>
|
||||
<% content = ma.content.nil? ? '' : ':'+ ma.content.to_s %>
|
||||
<span title='<%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}" %>' class ='#{ma.viewed==0 ? "newsBlack" : "newsGrey"}'><%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}" %></span>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn") %>
|
||||
<% else %>
|
||||
<%if(user.watched_by?(User.current))%>
|
||||
<%= link_to "取消关注",Setting.host_name + "/watch?object_type=user&object_id="+user.id.to_s + "&target_id="+user.id.to_s,:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%>
|
||||
<%= link_to "取消关注",watch_path(:host=> Setting.host_name,:object_type=> 'user',:object_id=>user.id.to_s,:target_id=>user.id.to_s),:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%>
|
||||
<% else %>
|
||||
<%= link_to "添加关注",Setting.host_name + "/watch?object_type=user&object_id="+user.id.to_s + "&target_id="+user.id.to_s,:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%>
|
||||
<%= link_to "添加关注",watch_path(:host=> Setting.host_name,:object_type=> 'user',:object_id=>user.id.to_s,:target_id=>user.id.to_s),:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -1,8 +1,12 @@
|
|||
<% if @state == 1 %>
|
||||
alert("您还未登录");
|
||||
<% elsif @state == 2 %>
|
||||
alert("申请成功,请等待审核");
|
||||
$("#homework_apply_status_<%=@homework.id %>").html("待审核");
|
||||
<% elsif @state == 3 %>
|
||||
alert("您已经发送过申请了,请耐心等待");
|
||||
hideModal();
|
||||
alert("您还未登录");
|
||||
<% elsif @state == 2 || @state == 3 %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/apply_for_homework', :locals => {:homework => @homework, :state => @state}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
$("#homework_apply_status_<%=@homework.id %>").html("待审核");
|
||||
<% end %>
|
|
@ -0,0 +1,10 @@
|
|||
<% if @state == 1 %>
|
||||
alert("您还未登录");
|
||||
<% elsif @state == 2 %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/apply_homework', :locals => {:homework => @homework}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
<% end %>
|
|
@ -1,9 +1,10 @@
|
|||
<% if @status == 1 %>
|
||||
alert("您的申请尚未通过审核,暂时不可发送至课程");
|
||||
<% elsif @status == 2 %>
|
||||
alert("该作业是私有的,请先提交申请并通过审核后再发送");
|
||||
<% elsif @status == 3 %>
|
||||
alert("您的申请已被拒绝,不可发送至课程");
|
||||
<% if @status == 1 || @status == 2 || @status == 3 %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_notice', :locals => {:status => @status}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
<% else %>
|
||||
<% if params[:is_observe].nil? %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% if @is_import.to_i == 1 %>
|
||||
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>@homework}) %>");
|
||||
<% else %>
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>@homework}) %>");
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>@homework,:status=>@status}) %>");
|
||||
<% end %>
|
|
@ -6,7 +6,7 @@ $("#homework_search_input").html("<%=escape_javascript(render :partial=>'homewor
|
|||
<% else %>
|
||||
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>''})%>');
|
||||
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil, :status => 0}) %>");
|
||||
$("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_repository_search', :locals=>{:type=>@type,:is_import=>@is_import,:property=>@property}) %>");
|
||||
$("#homework_type_all").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 0) %>');
|
||||
$("#homework_type_nor").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>');
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
<%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %>
|
||||
</div>
|
||||
<div id="homework_repository_detail">
|
||||
<%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %>
|
||||
<%=render :partial => 'homework_repository_detail', :locals => {:homework => nil, :status => 0} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*$("#homework_repository").html('<%#= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');*/
|
||||
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => 0,:property => @property,:search=>''})%>');
|
||||
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil, :status => 0}) %>");
|
||||
|
|
|
@ -5,5 +5,5 @@ $("#homework_detail_information").html("<%=escape_javascript(render :partial =>
|
|||
<% else %>
|
||||
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>@search})%>');
|
||||
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
|
||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil, :status => 0}) %>");
|
||||
<% end %>
|
|
@ -1864,6 +1864,7 @@ zh:
|
|||
excel_student_id: 学号
|
||||
excel_mail: 电子邮箱
|
||||
excel_homework_name: 作品名
|
||||
excel_homework_des: 作品描述
|
||||
excel_t_score: 教师评分
|
||||
excel_ta_score: 教辅评分
|
||||
excel_n_score: 匿名评分
|
||||
|
|
|
@ -548,6 +548,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'user_feedback4show', :to => 'users#user_feedback4show', :via => :get
|
||||
match 'user_visitorlist', :to => 'users#user_visitorlist', :via => :get
|
||||
match 'apply_for_homework', :to => 'users#apply_for_homework', :via => :get
|
||||
match 'apply_homework', :to => 'users#apply_homework', :via => :get
|
||||
match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
|
||||
match 'student_homeworks', :to => 'users#student_homeworks', :via => :get
|
||||
get 'user_import_homeworks'
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
namespace :homework_update do
|
||||
desc "update homework updated_at"
|
||||
task :update_homework => :environment do
|
||||
stu_pro = StudentWork.where("project_id != 0")
|
||||
|
||||
end
|
||||
end
|
|
@ -1501,6 +1501,9 @@ a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../i
|
|||
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
|
||||
a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;}
|
||||
|
||||
.green_btn_share{ background:#28be6c; padding:2px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;}
|
||||
|
||||
/* 代码查重弹框 */
|
||||
a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
|
||||
a:hover.Blue-btn{ background:#3598db; color:#fff;}
|
||||
|
|
|
@ -181,6 +181,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.h70{ height:70px;}
|
||||
.h150{ height:150px;}
|
||||
.p10 {padding-left:10px; padding-right:10px;}
|
||||
.mw220 {max-width: 220px !important;}
|
||||
.mw360 {max-width: 360px !important;}
|
||||
.mw380 {max-width: 380px !important;}
|
||||
.mw400 {max-width: 400px !important;}
|
||||
|
|
Loading…
Reference in New Issue