Merge branch 'cxt_course' into develop

Conflicts:
	app/views/users/_course_message.html.erb
chenlw_dev
huang 9 years ago
commit a602a6aa63

@ -89,7 +89,7 @@ class HomeworkCommonController < ApplicationController
homework_detail_manual.comment_status = 1
end
eval_start = homework_detail_manual.evaluation_start
if eval_start <= @homework.end_time && homework_detail_manual.comment_status <= 1
if eval_start.nil? || (eval_start <= @homework.end_time && homework_detail_manual.comment_status <= 1)
homework_detail_manual.evaluation_start = @homework.end_time + 7
homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
end

@ -791,7 +791,7 @@ class StudentWorkController < ApplicationController
if homework_detail_manual.ta_proportion.to_s != params[:ta_proportion].to_s || @homework.teacher_priority.to_s != teacher_priority.to_s || (homework_detail_programing && homework_detail_programing.ta_proportion.to_s != params[:sy_proportion].to_s)
homework_detail_manual.ta_proportion = params[:ta_proportion]
homework_detail_programing.ta_proportion = params[:sy_proportion] if homework_detail_programing
@homework.teacher_priority = teacher_priority
@homework.update_column('teacher_priority', teacher_priority)
homework_detail_manual.save if homework_detail_manual
homework_detail_programing.save if homework_detail_programing
@ -1174,8 +1174,12 @@ class StudentWorkController < ApplicationController
final_score = final_ta_score + final_s_score
student_work.final_score = format("%.2f",final_score.to_f)
end
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
if student_work.final_score
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
else
student_work.work_score = nil
end
end
else #不考虑教师评分
if student_work.teaching_asistant_score.nil?
@ -1189,8 +1193,12 @@ class StudentWorkController < ApplicationController
final_score = final_ta_score + final_s_score
student_work.final_score = format("%.2f",final_score.to_f)
end
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
if student_work.final_score
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
else
student_work.work_score = nil
end
end
elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业-----设定:系统评分必定不为空
if homework.teacher_priority == 1 #教师优先
@ -1225,8 +1233,12 @@ class StudentWorkController < ApplicationController
final_score = final_sy_score + final_ts_score + final_st_score
student_work.final_score = format("%.2f",final_score.to_f)
end
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
if student_work.final_score
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
else
student_work.work_score = nil
end
end
else #不考虑教师评分
if student_work.teaching_asistant_score.nil? #教辅未评分
@ -1256,8 +1268,12 @@ class StudentWorkController < ApplicationController
final_score = final_sy_score + final_ts_score + final_st_score
student_work.final_score = format("%.2f",final_score.to_f)
end
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
if student_work.final_score
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
else
student_work.work_score = nil
end
end
end
end

@ -477,8 +477,8 @@ class UsersController < ApplicationController
ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:send_id].to_i)
if ah.empty?
@status = 2
elsif ah.first.status == 1
@status = 1
elsif ah.first.status != 2
@status = ah.first.status
end
end
if !params[:search].nil?

@ -63,11 +63,17 @@ class StudentWork < ActiveRecord::Base
final_score = final_ta_score + final_s_score
student_work.final_score = format("%.2f",final_score.to_f)
end
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
if student_work.final_score
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
else
student_work.work_score = nil
end
end
else #不考虑教师评分
if student_work.teaching_asistant_score.nil?
if student_work.student_score.nil? && student_work.teaching_asistant_score.nil?
student_work.final_score = student_work.teacher_score
elsif student_work.teaching_asistant_score.nil?
student_work.final_score = student_work.student_score
elsif student_work.student_score.nil?
student_work.final_score = student_work.teaching_asistant_score
@ -78,8 +84,12 @@ class StudentWork < ActiveRecord::Base
final_score = final_ta_score + final_s_score
student_work.final_score = format("%.2f",final_score.to_f)
end
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
if student_work.final_score
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
else
student_work.work_score = nil
end
end
elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业-----设定:系统评分必定不为空
if homework.teacher_priority == 1 #教师优先
@ -114,9 +124,13 @@ class StudentWork < ActiveRecord::Base
final_score = final_sy_score + final_ts_score + final_st_score
student_work.final_score = format("%.2f",final_score.to_f)
end
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
end
if student_work.final_score
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
else
student_work.work_score = nil
end
end
else #不考虑教师评分
if student_work.teaching_asistant_score.nil? #教辅未评分
if student_work.student_score.nil?
@ -145,8 +159,12 @@ class StudentWork < ActiveRecord::Base
final_score = final_sy_score + final_ts_score + final_st_score
student_work.final_score = format("%.2f",final_score.to_f)
end
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
if student_work.final_score
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
else
student_work.work_score = nil
end
end
end
end

@ -97,11 +97,19 @@
</div>
<div class="cl"></div>
<div class="homepagePostReply">
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= @comments.count>0 ? "#{@comments.count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=@news.id %>">
<% if @news.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(@news) > 0 ? "#{get_praise_num(@news)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@news, :user_activity_id=>@news.id,:type=>"activity"}%>
<% end %>
</span>
</div>
</div>
<% unless @comments.empty? %>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复(<%=@comments.count %></div>
<div class="homepagePostReplyBannerTime"></div>
</div>
<div class="" id="reply_div_<%=@news.id %>">
<% @comments.each_with_index do |reply,i| %>
<script type="text/javascript">
@ -127,13 +135,20 @@
<div style="margin-top: -7px; margin-bottom: 5px">
<%= format_time(reply.created_on) %>
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
<span id="reply_praise_count_<%=reply.id %>">
<% if reply.author == User.current %>
<span class="fr newsGrey" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %>
</span>
<%= link_to_if_authorized_course(
l(:button_delete),
{:controller => 'comments',
:action => 'destroy', :id => @news,
:comment_id => reply},
:method => :delete,
:class => 'fr newsGrey',
:class => 'fr newsGrey mr10',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) %>

@ -34,4 +34,9 @@
</div>
<div class="cl"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -211,7 +211,7 @@
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
更新时间:<%=time_from_now time %>
更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>
</div>
</div>
<% if i == 9 && projects.count > 10 %>
@ -372,4 +372,7 @@
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
$("#moreProject_<%=user_activity_id %>").show();
});
$(function(){
user_card_show_hide();
});
</script>

@ -157,3 +157,8 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -121,3 +121,8 @@
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -56,3 +56,8 @@
</div>
</div>
<% end %>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -139,3 +139,8 @@
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -159,3 +159,8 @@
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -143,4 +143,7 @@
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
$(function(){
user_card_show_hide();
});
</script>

@ -36,4 +36,9 @@
</div>
<div class="cl"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -133,3 +133,8 @@
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -152,4 +152,7 @@
target.eq(2).show();
}
}
$(function(){
user_card_show_hide();
});
</script>

@ -36,4 +36,9 @@
</div>
<div class="cl"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -120,4 +120,9 @@
<div class="cl"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -38,4 +38,9 @@
</div>
<div class="cl"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -34,4 +34,9 @@
</div>
<div class="cl"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -226,7 +226,7 @@
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
更新时间:<%=time_from_now time %>
更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>
</div>
</div>
<% if i == 9 && projects.count > 10 %>
@ -388,4 +388,7 @@
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
$("#moreProject_<%=user_activity_id %>").show();
});
$(function(){
user_card_show_hide();
});
</script>

@ -107,4 +107,9 @@
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -174,4 +174,9 @@
</div>
<% end %>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -146,3 +146,8 @@
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

@ -55,3 +55,8 @@
</div>
</div>
<% end %>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save