dev_haigong
daiao 6 years ago
commit dcc20138dd

@ -1194,6 +1194,13 @@ class CoursesController < ApplicationController
@exercises = @course.exercises.where("publish_time <= '#{Time.now}'").order("publish_time asc, created_at asc") @exercises = @course.exercises.where("publish_time <= '#{Time.now}'").order("publish_time asc, created_at asc")
@tasks = @course.graduation_tasks.where("publish_time <= '#{Time.now}'").order("publish_time asc, created_at asc") @tasks = @course.graduation_tasks.where("publish_time <= '#{Time.now}'").order("publish_time asc, created_at asc")
@homeworks.where(:homework_type => 4).each do |homework|
items = homework.student_works.where("work_status != 0")
if items.count == 0 && homework.publish_time < Time.now && !@course.is_end
update_shixun_work_status homework
end
end
respond_to do |format| respond_to do |format|
format.xls { format.xls {
send_data(member_to_xls(@homeworks, @exercises, @tasks, @course,@all_members,@course.course_groups), :type => "text/excel;charset=utf-8; header=present", send_data(member_to_xls(@homeworks, @exercises, @tasks, @course,@all_members,@course.course_groups), :type => "text/excel;charset=utf-8; header=present",
@ -2431,8 +2438,8 @@ class CoursesController < ApplicationController
sheet1[count_row,column+=1] = 0 sheet1[count_row,column+=1] = 0
else else
work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score
sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(2) sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(1)
shixun_score += work_score < 0 ? 0 : work_score.round(2) shixun_score += work_score < 0 ? 0 : work_score.round(1)
end end
# current_col += 1 # current_col += 1
end end
@ -2443,8 +2450,8 @@ class CoursesController < ApplicationController
sheet1[count_row,column+=1] = 0 sheet1[count_row,column+=1] = 0
else else
work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score
sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(2) sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(1)
common_score += work_score < 0 ? 0 : work_score.round(2) common_score += work_score < 0 ? 0 : work_score.round(1)
end end
# current_col += 1 # current_col += 1
end end
@ -2455,8 +2462,8 @@ class CoursesController < ApplicationController
sheet1[count_row,column+=1] = 0 sheet1[count_row,column+=1] = 0
else else
work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score
sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(2) sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(1)
group_score += work_score < 0 ? 0 : work_score.round(2) group_score += work_score < 0 ? 0 : work_score.round(1)
end end
# current_col += 1 # current_col += 1
end end
@ -2467,8 +2474,8 @@ class CoursesController < ApplicationController
sheet1[count_row,column+=1] = 0 sheet1[count_row,column+=1] = 0
else else
work_score = exercise_user.first.score.nil? ? 0 : exercise_user.first.score work_score = exercise_user.first.score.nil? ? 0 : exercise_user.first.score
sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(2) sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(1)
exercise_score += work_score < 0 ? 0 : work_score.round(2) exercise_score += work_score < 0 ? 0 : work_score.round(1)
end end
# current_col += 1 # current_col += 1
end end
@ -2480,8 +2487,8 @@ class CoursesController < ApplicationController
sheet1[count_row,column+=1] = 0 sheet1[count_row,column+=1] = 0
else else
work_score = graduation_works.first.work_score.nil? ? 0 : graduation_works.first.work_score work_score = graduation_works.first.work_score.nil? ? 0 : graduation_works.first.work_score
sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(2) sheet1[count_row,column+=1] = work_score < 0 ? 0 : work_score.round(1)
graduation_score += work_score < 0 ? 0 : work_score.round(2) graduation_score += work_score < 0 ? 0 : work_score.round(1)
end end
# current_col += 1 # current_col += 1
end end
@ -2494,7 +2501,7 @@ class CoursesController < ApplicationController
if tasks.count > 0 if tasks.count > 0
sheet1[count_row,column+=1] = graduation_score sheet1[count_row,column+=1] = graduation_score
end end
sheet1[count_row,column+=1] = sum.round(2) sheet1[count_row,column+=1] = sum.round(1)
count_row += 1 count_row += 1
end end
@ -2578,7 +2585,7 @@ class CoursesController < ApplicationController
sheet[count_row,3] = stu.user.user_extensions.student_id sheet[count_row,3] = stu.user.user_extensions.student_id
sheet[count_row,4] = strip_html stu.description sheet[count_row,4] = strip_html stu.description
sheet[count_row,5] = stu.late_penalty sheet[count_row,5] = stu.late_penalty
sheet[count_row,6] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) sheet[count_row,6] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1)
sheet[count_row,7] = format_time(stu.commit_time) sheet[count_row,7] = format_time(stu.commit_time)
count_row += 1 count_row += 1
end end
@ -2613,17 +2620,17 @@ class CoursesController < ApplicationController
sheet[count_row,2] = stu.user.login sheet[count_row,2] = stu.user.login
sheet[count_row,3] = stu.user.user_extensions.student_id sheet[count_row,3] = stu.user.user_extensions.student_id
sheet[count_row,4] = strip_html stu.description sheet[count_row,4] = strip_html stu.description
sheet[count_row,5] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(2) sheet[count_row,5] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(1)
sheet[count_row,6] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(2) sheet[count_row,6] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(1)
if home.anonymous_comment ==0 if home.anonymous_comment ==0
sheet[count_row,7] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(2) sheet[count_row,7] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(1)
sheet[count_row,8] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.absence_penalty sheet[count_row,8] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.absence_penalty
sheet[count_row,9] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty sheet[count_row,9] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty
sheet[count_row,10] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) sheet[count_row,10] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1)
sheet[count_row,11] = format_time(stu.commit_time) sheet[count_row,11] = format_time(stu.commit_time)
else else
sheet[count_row,7] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty sheet[count_row,7] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty
sheet[count_row,8] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) sheet[count_row,8] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1)
sheet[count_row,9] = format_time(stu.commit_time) sheet[count_row,9] = format_time(stu.commit_time)
end end
count_row += 1 count_row += 1
@ -2662,17 +2669,17 @@ class CoursesController < ApplicationController
sheet[count_row,3] = stu.user.user_extensions.student_id sheet[count_row,3] = stu.user.user_extensions.student_id
sheet[count_row,4] = get_group_member_names home.student_works.where(:group_id => stu.group_id).pluck(:user_id) sheet[count_row,4] = get_group_member_names home.student_works.where(:group_id => stu.group_id).pluck(:user_id)
sheet[count_row,5] = strip_html stu.description sheet[count_row,5] = strip_html stu.description
sheet[count_row,6] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(2) sheet[count_row,6] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(1)
sheet[count_row,7] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(2) sheet[count_row,7] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(1)
if home.anonymous_comment ==0 if home.anonymous_comment ==0
sheet[count_row,8] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(2) sheet[count_row,8] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(1)
sheet[count_row,9] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.absence_penalty sheet[count_row,9] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.absence_penalty
sheet[count_row,10] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty sheet[count_row,10] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty
sheet[count_row,11] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) sheet[count_row,11] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1)
sheet[count_row,12] = format_time(stu.commit_time) sheet[count_row,12] = format_time(stu.commit_time)
else else
sheet[count_row,8] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty sheet[count_row,8] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty
sheet[count_row,9] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) sheet[count_row,9] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1)
sheet[count_row,10] = format_time(stu.commit_time) sheet[count_row,10] = format_time(stu.commit_time)
end end
count_row += 1 count_row += 1
@ -2704,7 +2711,7 @@ class CoursesController < ApplicationController
sheet[count_row,3] = stu.user.user_extensions.student_id sheet[count_row,3] = stu.user.user_extensions.student_id
sheet[count_row,4] = stu.objective_score == -1 ? "0.0" : format("%.1f",stu.objective_score) sheet[count_row,4] = stu.objective_score == -1 ? "0.0" : format("%.1f",stu.objective_score)
sheet[count_row,5] = stu.subjective_score == -1 ? "0.0" : format("%.1f",stu.subjective_score) sheet[count_row,5] = stu.subjective_score == -1 ? "0.0" : format("%.1f",stu.subjective_score)
sheet[count_row,6] = stu.score.nil? ? '--' : stu.score.round(2) sheet[count_row,6] = stu.score.nil? ? '--' : stu.score.round(1)
sheet[count_row,7] = stu.commit_status == 0 ? l(:excel_no_answer) : format_time(stu.start_at) sheet[count_row,7] = stu.commit_status == 0 ? l(:excel_no_answer) : format_time(stu.start_at)
count_row += 1 count_row += 1
end end
@ -2745,12 +2752,12 @@ class CoursesController < ApplicationController
sheet[count_row,column+=1] = get_group_member_names task.graduation_works.where(:group_id => stu.group_id).pluck(:user_id) sheet[count_row,column+=1] = get_group_member_names task.graduation_works.where(:group_id => stu.group_id).pluck(:user_id)
end end
sheet[count_row,column+=1] = strip_html stu.description sheet[count_row,column+=1] = strip_html stu.description
sheet[count_row,column+=1] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(2) sheet[count_row,column+=1] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(1)
if task.cross_comment if task.cross_comment
sheet[count_row,column+=1] = stu.cross_score.nil? ? l(:label_without_score) : stu.cross_score.round(2) sheet[count_row,column+=1] = stu.cross_score.nil? ? l(:label_without_score) : stu.cross_score.round(1)
end end
sheet[count_row,column+=1] = stu.late_penalty sheet[count_row,column+=1] = stu.late_penalty
sheet[count_row,column+=1] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2) sheet[count_row,column+=1] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(1)
sheet[count_row,column+=1] = format_time(stu.commit_time) sheet[count_row,column+=1] = format_time(stu.commit_time)
count_row += 1 count_row += 1
end end

@ -464,7 +464,7 @@ class MyshixunsController < ApplicationController
render :json => {:data => "success"} render :json => {:data => "success"}
end end
rescue Exception => e rescue Exception => e
render :json => {:data => "failed"} render :json => {:data => "failed, exception_message: #{e}"}
end end
end end

@ -10,13 +10,12 @@
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/edu-common','educoder/edu-main','educoder/edu-all', 'css/edu-public', 'css/font-awesome', 'css/edu-class', 'css/magic-check'%> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/edu-common','educoder/edu-main','educoder/edu-all', 'css/edu-public', 'css/font-awesome', 'css/edu-class', 'css/magic-check'%>
<%#= javascript_heads %> <%= javascript_heads %>
<%= javascript_include_tag "edu/application",'educoder/edu_application'%> <%= javascript_include_tag "edu/application", 'educoder/edu_application'%>
</head> </head>
<body onload="prettyPrint();" style="height: 100%; background: #fff;"> <body style="height: 100%; background: #fff;">
<div class="newContainer" style="width: 1000px;"> <!-- 页面全部内容 --> <div class="newContainer" style="width: 1000px;"> <!-- 页面全部内容 -->
<div class="clearfix" style="width: 1000px;"> <!-- 主题部分 --> <div class="clearfix" style="width: 1000px;"> <!-- 主题部分 -->
<%= render_flash_messages %>
<%= yield %> <%= yield %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

@ -36,6 +36,14 @@
</div> </div>
</div> </div>
<% end %> <% end %>
<div class="mt20 mb20" style="text-align:center;">
<div class="pages_user_show" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @authorizations_pages, @authorizations_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<% else %> <% else %>
<%= render :partial => "welcome/no_data" %> <%= render :partial => "welcome/no_data" %>
<% end %> <% end %>

@ -27,6 +27,15 @@
</div> </div>
<% end %> <% end %>
<div class="mt20 mb20" style="text-align:center;">
<div class="pages_user_show" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @authorizations_pages, @authorizations_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<!--<div style="text-align:center;">--> <!--<div style="text-align:center;">-->
<!--<div class="pages_right_min" style="width:auto; display:inline-block;">--> <!--<div class="pages_right_min" style="width:auto; display:inline-block;">-->
<!--<ul id="homework_pository_ref_pages">--> <!--<ul id="homework_pository_ref_pages">-->

@ -38,7 +38,7 @@
<td><%= user.try(:authentication_status) %></td> <td><%= user.try(:authentication_status) %></td>
<td><%= user.try(:professional_status) %></td> <td><%= user.try(:professional_status) %></td>
<td ><span class="edu-txt-w140 task-hide2" title="<%= user.try(:user_extensions).try(:school).try(:name) %>"><%= user.try(:user_extensions).try(:school).try(:name).blank? ? "--" : user.try(:user_extensions).try(:school) %></span></td> <td ><span class="edu-txt-w140 task-hide2" title="<%= user.try(:user_extensions).try(:school).try(:name) %>"><%= user.try(:user_extensions).try(:school).try(:name).blank? ? "--" : user.try(:user_extensions).try(:school) %></span></td>
<td ><span class="edu-txt-w140 task-hide2"><%= user.try(:user_extensions).department ? user.try(:user_extensions).try(:department).try(:name).to_s : '--' %></span></td> <td ><span class="edu-txt-w140 task-hide2"><%= user.try(:user_extensions).try(:department) ? user.try(:user_extensions).try(:department).try(:name).to_s : '--' %></span></td>
<td><%= user.last_login_on.blank? ? "--" : (format_time user.last_login_on) %></td> <td><%= user.last_login_on.blank? ? "--" : (format_time user.last_login_on) %></td>
<td><%= identity_authentication_status(user) %></td> <td><%= identity_authentication_status(user) %></td>
<td class="homepage_teacher"> <td class="homepage_teacher">

@ -93,7 +93,7 @@
<%#= render :partial => "student_work/echart_of_shixun_skills" %> <%#= render :partial => "student_work/echart_of_shixun_skills" %>
</div> </div>
</div>--> </div>-->
<% if true %> <% unless params[:pdf] %>
<div class="bor-grey-e mt20"> <div class="bor-grey-e mt20">
<p class="pt10 pb10 pl15 pr15 clearfix bor-bottom-greyE"> <p class="pt10 pb10 pl15 pr15 clearfix bor-bottom-greyE">
<span class="fl font-bd">图形统计</span> <span class="fl font-bd">图形统计</span>

@ -303,7 +303,7 @@ class Comments extends Component {
<div className="comment_content clearfix" id={`reply_content_${item.id}`}> <div className="comment_content clearfix" id={`reply_content_${item.id}`}>
<div className="color-grey-3 break_word_comments" id={`reply_content_${item.id}`}> <div className="color-grey-3 break_word_comments" id={`reply_content_${item.id}`}>
{ item.hidden && item.admin === false && item.manager === false { item.hidden && item.admin === false && (item.manager === false || item.manager == undefined)
? <p className="color-orange font-16">违规评论已被屏蔽</p> ? <p className="color-orange font-16">违规评论已被屏蔽</p>
: <div dangerouslySetInnerHTML={{__html: _content}}></div> : <div dangerouslySetInnerHTML={{__html: _content}}></div>
} }

Loading…
Cancel
Save