Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
This commit is contained in:
commit
16bba76f61
|
@ -63,6 +63,33 @@ class AdminController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#精品课程下的全部课程
|
||||
def excellent_all_courses
|
||||
@name = params[:name]
|
||||
@courses = Course.like(@name).order('created_at desc')
|
||||
@courses = paginateHelper @courses,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#设为精品
|
||||
def set_excellent_course
|
||||
@course = Course.find params[:id]
|
||||
unless @course.nil?
|
||||
if @course.is_excellent == 1 || @course.excellent_option == 1
|
||||
@course.update_column('is_excellent', 0)
|
||||
@course.update_column('excellent_option', 0)
|
||||
else
|
||||
@course.update_column('is_excellent', 1)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#管理员界面课程资源列表
|
||||
def course_resource_list
|
||||
|
||||
|
@ -559,7 +586,8 @@ class AdminController < ApplicationController
|
|||
|
||||
#代码测试列表
|
||||
def code_work_tests
|
||||
@code_work_tests = StudentWorkTest.find_by_sql("select a.* ,b.id as homeworkid,d.language from student_work_tests as a , homework_commons as b ,student_works as c, homework_detail_programings as d where a.student_work_id = c.id and b.id = c.homework_common_id and c.homework_common_id = d.homework_common_id order by a.created_at desc")
|
||||
@code_work_tests = StudentWorkTest.find_by_sql("select status,results,created_at, student_work_id from student_work_tests order by id desc ")
|
||||
#@code_work_tests = StudentWorkTest.find_by_sql("select a.status,a.results,a.created_at ,b.id as homeworkid,d.language from student_work_tests as a , homework_commons as b ,student_works as c, homework_detail_programings as d where a.student_work_id = c.id and b.id = c.homework_common_id and c.homework_common_id = d.homework_common_id order by a.id desc ")
|
||||
#@code_work_tests = StudentWorkTest.order('created_at desc')
|
||||
@code_work_tests = paginateHelper @code_work_tests,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
|
|
|
@ -187,7 +187,7 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
@canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1'
|
||||
@is_remote = true
|
||||
|
||||
@members = student_homework_score(0,0, 10,"desc")
|
||||
@course_groups = @course.course_groups
|
||||
end
|
||||
|
||||
|
@ -209,7 +209,7 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
@is_remote = true
|
||||
|
||||
@members = student_homework_score(0,0, 10,"desc")
|
||||
@course_groups = @course.course_groups
|
||||
end
|
||||
|
||||
|
@ -334,7 +334,7 @@ class CoursesController < ApplicationController
|
|||
|
||||
def export_course_member_excel
|
||||
@all_members = student_homework_score(0,0,0,"desc")
|
||||
@homeworks = @course.homework_commons.order("created_at desc")
|
||||
@homeworks = @course.homework_commons.order("created_at asc")
|
||||
filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}";
|
||||
|
||||
respond_to do |format|
|
||||
|
@ -942,6 +942,12 @@ class CoursesController < ApplicationController
|
|||
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
|
||||
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
|
||||
if !@is_teacher
|
||||
render_403
|
||||
return
|
||||
end
|
||||
|
||||
@homework = HomeworkCommon.find params[:homework]
|
||||
#order("#{@order} #{@b_sort}"
|
||||
@student_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("simi_value desc"),@name
|
||||
|
@ -962,10 +968,19 @@ class CoursesController < ApplicationController
|
|||
src_id = params[:src_id]
|
||||
dst_id = params[:dst_id]
|
||||
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
|
||||
if !@is_teacher
|
||||
render_403
|
||||
return
|
||||
end
|
||||
|
||||
src_work = StudentWork.where("id =?", src_id).first
|
||||
|
||||
@homework = HomeworkCommon.find params[:homework_id]
|
||||
|
||||
@simi_value = src_work.simi_value.to_i
|
||||
|
||||
@src_code = src_work.description
|
||||
src_user = User.where("id =?", src_work.user_id).first
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@ class HomeworkCommonController < ApplicationController
|
|||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
if @is_teacher
|
||||
@homeworks = @course.homework_commons.order("updated_at desc").limit(10).offset(@page * 10)
|
||||
@homework_commons = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10)
|
||||
@homework_commons = @course.homework_commons.order("created_at desc")
|
||||
else
|
||||
@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_at desc").limit(10).offset(@page * 10)
|
||||
@homework_commons = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10)
|
||||
@homework_commons = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc")
|
||||
end
|
||||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||
@is_new = params[:is_new]
|
||||
|
|
|
@ -254,14 +254,11 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
logger.debug "time3 is #{Time.now.usec} "
|
||||
result['results'].each do |key,value|
|
||||
if value['simiworkid'].to_i > 0
|
||||
@student_work = StudentWork.where("id =?", key.to_i).first
|
||||
@student_work.update_column('simi_id', value['simiworkid'].to_i)
|
||||
@student_work.update_column('simi_value', value['simivalue'].to_i)
|
||||
end
|
||||
# sqlstr = "update student_works set simi_id=#{value['simiworkid']},simi_value=#{value['simivalue']} where id=#{key.to_i} "
|
||||
# dbh.execute(sqlstr)
|
||||
|
||||
end
|
||||
logger.debug "time4 is #{Time.now.usec} "
|
||||
end
|
||||
|
@ -281,7 +278,7 @@ class StudentWorkController < ApplicationController
|
|||
if @homework.simi_time != nil
|
||||
resultObj[:comparetime] = Time.parse(@homework.simi_time.to_s).strftime("%Y-%m-%d %H:%M")
|
||||
else
|
||||
resultObj[:comparetime] = @homework.simi_time
|
||||
resultObj[:comparetime] = 0
|
||||
end
|
||||
|
||||
render :json => resultObj
|
||||
|
|
|
@ -145,7 +145,7 @@ class Member < ActiveRecord::Base
|
|||
|
||||
#当前课程的作业列表
|
||||
def homework_common_list
|
||||
HomeworkCommon.where(:course_id => self.course_id)
|
||||
HomeworkCommon.where("course_id = ? and publish_time is not null and publish_time <= '#{Date.today}'", self.course_id)
|
||||
end
|
||||
|
||||
#当前学生在指定作业内的得分
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<%= link_to(course.name, course_path(course.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= studentCount(course) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.homework_commons.count%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= student_works_num(course) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= visable_attachemnts_incourse(course).count%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", course.boards.first.id, nil).count %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.course_activities.count%>
|
||||
</td>
|
||||
<td class="buttons">
|
||||
<%= link_to( course.is_excellent == 1 || course.excellent_option == 1 ? "取消精品" : "设为精品", { :controller => 'admin', :action => 'set_excellent_course', :id => course.id },:remote=>true, :class => 'icon-del') %>
|
||||
</td>
|
|
@ -0,0 +1,7 @@
|
|||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to '精品课程', {:action => 'excellent_courses'}, class: "#{current_page?(excellent_courses_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to '全部课程', {:action => 'excellent_all_courses'}, class: "#{current_page?(excellent_all_courses_path)? 'selected' : nil }" %></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
|
@ -37,53 +37,57 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<% @code_work_tests.each do |test| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center; " title='<%=test.homeworkid%>'>
|
||||
<%=link_to(test.homeworkid, student_work_index_path(:homework => test.homeworkid))%>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<% if test.status != -2 && test.results.first['user_wait'] %>
|
||||
<% wait_time = 0 %>
|
||||
<% test.results.each do |result| wait_time = wait_time + result['user_wait'] end %>
|
||||
<%=(wait_time/test.results.count).to_s+"毫秒" %>
|
||||
<% infos = StudentWorkTest.find_by_sql("select a.homework_common_id as homeworkid,b.language from student_works as a, homework_detail_programings as b where a.id = #{test.student_work_id} and a.homework_common_id = b.homework_common_id
|
||||
").first %>
|
||||
<% if infos != nil %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center; " title='<%=infos.homeworkid%>'>
|
||||
<%=link_to(infos.homeworkid, student_work_index_path(:homework => infos.homeworkid))%>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<% if test.status != -2 && test.results.first['user_wait'] %>
|
||||
<% wait_time = 0 %>
|
||||
<% test.results.each do |result| wait_time = wait_time + result['user_wait'] end %>
|
||||
<%=(wait_time/test.results.count).to_s+"毫秒" %>
|
||||
<% else %>
|
||||
<%="未记录"%>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=%W(C C++ Python Java).at(infos.language.to_i - 1)%>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=Time.parse(test.created_at.to_s).strftime("%Y-%m-%d %H:%M:%S")%>
|
||||
</td>
|
||||
<td align="center">
|
||||
<% if test.status == 0 %>
|
||||
<%= "答题正确" %>
|
||||
<% elsif test.status == -2 %>
|
||||
<%= "编译错误" %>
|
||||
<% elsif test.status == 2 || test.results.last['status'] == 2 %>
|
||||
<%= "超时" %>
|
||||
<% else %>
|
||||
<%="未记录"%>
|
||||
<%= "答题错误" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=%W(C C++ Python Java).at(test.language.to_i - 1)%>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=Time.parse(test.created_at.to_s).strftime("%Y-%m-%d %H:%M:%S")%>
|
||||
</td>
|
||||
<td align="center">
|
||||
<% if test.status == 0 %>
|
||||
<%= "答题正确" %>
|
||||
<% elsif test.status == -2 %>
|
||||
<%= "编译错误" %>
|
||||
<% elsif test.status == 2 || test.results.last['status'] == 2 %>
|
||||
<%= "超时" %>
|
||||
<% else %>
|
||||
<%= "答题错误" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<% if test.status != -2 %>
|
||||
<%=test.results.count%>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<% if test.status != -2 %>
|
||||
<%test.results = test.results.sort_by {|result| result['time_used'] }%>
|
||||
<%=test.results.first['time_used'] == 0 ? "1毫秒":test.results.first['time_used'].to_s+"毫秒"%>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<% if test.status != -2 %>
|
||||
<%=test.results.last['time_used'] == 0 ? "1毫秒":test.results.last['time_used'].to_s+"毫秒"%>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
<td class="center">
|
||||
<% if test.status != -2 %>
|
||||
<%=test.results.count%>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<% if test.status != -2 %>
|
||||
<%test.results = test.results.sort_by {|result| result['time_used'] }%>
|
||||
<%=test.results.first['time_used'] == 0 ? "1毫秒":test.results.first['time_used'].to_s+"毫秒"%>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<% if test.status != -2 %>
|
||||
<%=test.results.last['time_used'] == 0 ? "1毫秒":test.results.last['time_used'].to_s+"毫秒"%>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -13,9 +13,7 @@
|
|||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<a class="icon icon-reload" onclick="$('#name').val('')" style="cursor: pointer;text-decoration: none;">
|
||||
<%= l(:button_clear)%>
|
||||
</a>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'courses'},:remote => true, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', :media => 'all' %>
|
||||
<h3>
|
||||
精品课程列表
|
||||
</h3>
|
||||
<%= render 'tab_excellent_courses' %>
|
||||
|
||||
<h3>
|
||||
全部课程列表
|
||||
</h3>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
课程:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'excellent_all_courses'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 25px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
课程名
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
主讲老师
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
学生数
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
作业数
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
作品数
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
资源数
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
帖子数
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
动态数
|
||||
</th>
|
||||
<th style="width: 40px;">
|
||||
</tr>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @courses.each do |course| %>
|
||||
<tr class="<%= cycle("odd", "even") %>" id="tr_<%= course.id %>">
|
||||
<%= render :partial => 'course_detail_tr', :locals => {:course => course} %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_excellent_courses_list)) -%>
|
|
@ -1,3 +1,9 @@
|
|||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', :media => 'all' %>
|
||||
<h3>
|
||||
<%=l(:label_excellent_courses_list)%>
|
||||
</h3>
|
||||
<%= render 'tab_excellent_courses' %>
|
||||
|
||||
<h3>
|
||||
<%=l(:label_excellent_courses_list)%>
|
||||
</h3>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#tr_<%=@course.id %>").html("<%=escape_javascript(render :partial => 'course_detail_tr', :locals => {:course => @course}) %>");
|
|
@ -1,8 +1,6 @@
|
|||
<div class="blue-border-box">
|
||||
<div class="box-con">
|
||||
<%if @homework.simi_time != nil %>
|
||||
<h4 id = "compare-tips-1"><%="您上次查重的时间为"+Time.parse(@homework.simi_time.to_s).strftime("%Y-%m-%d %H:%M")%></h4>
|
||||
<%end%>
|
||||
<h4 id = "compare-tips-1"></h4>
|
||||
<div class="box-con-a">
|
||||
<a href="javascript:void(0);" class="Blue-btn fl " onclick = "compare_code_btn(<%=homework.id%>,<%=courseid%>)">重新查重</a>
|
||||
<a href="javascript:void(0);" class="Blue-btn fl " onclick = "see_last_compare_code(<%=courseid%>,<%=homework.id%>)">查看结果</a>
|
||||
|
@ -39,7 +37,7 @@
|
|||
console.log(data);
|
||||
|
||||
if (data.status == 0) {
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_2',:locals => {:des=>"查重完成是否立即查看结果?",:status=>1, :homework=> homework,:courseid=> courseid})%>');
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_2',:locals => {:des=>"查重完成,是否立即查看结果?",:status=>1, :homework=> homework,:courseid=> courseid})%>');
|
||||
showModal('ajax-modal', '580px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 560px;' class='resourceClose'></a>");
|
||||
|
|
|
@ -8,8 +8,13 @@
|
|||
<% end %>
|
||||
|
||||
<article>
|
||||
<h3 style="float:left; width:50%; text-align:center;"><%=src_name%></h3>
|
||||
<h3 style="float:left; width:50%; text-align:center;"><%=dst_name%></h3><div class="cl"></div>
|
||||
<h3 style="float:left; width:47%; text-align:center;"><%=src_name%></h3>
|
||||
<% if @simi_value.to_i >= 90 %>
|
||||
<h6 style="color:red;float:left; width:6%; text-align:center;">相似度<%=@simi_value.to_i%>%</h3>
|
||||
<% else %>
|
||||
<h6 style="float:left; width:6%; text-align:center;">相似度<%=@simi_valu.to_i%>%</h3>
|
||||
<% end %>
|
||||
<h3 style="float:left; width:47%; text-align:center;"><%=dst_name%></h3><div class="cl"></div>
|
||||
<pre id = "program-src_1" style = "display: none" ><%= src_code if src_code%></pre>
|
||||
<pre id = "program-src_2" style = "display: none" ><%= dst_code if dst_code%></pre>
|
||||
<div class = "program-compare-code" id=program-compare-code></div>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><span class="c_blue03 w280">作业积分(总分)</span><span class="c_red w70"><%= (@member_score.student_work_score_sum).first.score %></span></li>
|
||||
<li><span class="c_blue03 w280">作业积分(总分)</span><span class="c_red w70"><%= format("%0.2f",(@member_score.student_work_score_sum).first.score) %></span></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @members})%>");
|
|
@ -2,16 +2,17 @@
|
|||
<h2 class="conbox-h2">查重结果</h2>
|
||||
<div class="chabox">
|
||||
<ul class="chabox-header">
|
||||
<li class="chabox-w-500" style = "width:413px" >全部作品</li>
|
||||
<li class="chabox-w-500" style = "width:585px" >对比作品</li>
|
||||
<li class="chabox-w-500" style = "width:438px" >被查作品</li>
|
||||
<li class="chabox-w-500" style = "width:560px" >疑被抄袭作品</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="chabox-top">
|
||||
<li class="chabox-w-151" >作品名称</li>
|
||||
<li class="chabox-w-40 " >序号</li>
|
||||
<li class="chabox-w-401" >作品名称</li>
|
||||
<li>姓名</li>
|
||||
<li>学号 </li>
|
||||
<li class="chabox-r-line">时间 </li>
|
||||
<li class="chabox-w-151">作品名称</li>
|
||||
<li class="chabox-w-401">作品名称</li>
|
||||
<li>姓名</li>
|
||||
<li>学号 </li>
|
||||
<li class="chabox-r-line">时间 </li>
|
||||
|
@ -20,38 +21,39 @@
|
|||
</ul>
|
||||
|
||||
<%if @homework.homework_type == 2 %>
|
||||
<% @student_works.each do |student_work|%>
|
||||
<% @student_works.each_with_index do |student_work,index|%>
|
||||
<ul class="chabox-con" id = "chabox-con-<%=student_work.id%>" >
|
||||
<li class="chabox-w-40 chabox-txt-left" ><%=index+1%></li>
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
|
||||
<li class="chabox-w-151" ><%=student_work_name%></li>
|
||||
<li class="chabox-w-401 chabox-txt-left" style =" text-align:left; text-indent:1em; " ><%=student_work_name%></li>
|
||||
<li><%=student_work.user.show_name%></li>
|
||||
<li><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> </li>
|
||||
<li class="chabox-r-line"><%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%></li>
|
||||
<% if student_work.simi_id > 0 && @works_hash[student_work.simi_id] %>
|
||||
<% simi_student_work = @works_hash[student_work.simi_id] %>
|
||||
<% if student_work.simi_id.to_i > 0 && @works_hash[student_work.simi_id.to_i] %>
|
||||
<% simi_student_work = @works_hash[student_work.simi_id.to_i] %>
|
||||
<% simi_student_work_name = simi_student_work.name.nil? || simi_student_work.name.empty? ? simi_student_work.user.show_name + '的作品' : simi_student_work.name%>
|
||||
<li class="chabox-w-151"><%=simi_student_work_name%></li>
|
||||
<li class="chabox-w-401 chabox-txt-left" style =" text-align:left; text-indent:1em; " ><%=simi_student_work_name%></li>
|
||||
<li><%=simi_student_work.user.show_name%></li>
|
||||
<li><%= simi_student_work.user.user_extensions.nil? ? "--" : simi_student_work.user.user_extensions.student_id%></li>
|
||||
<li class="chabox-r-line"><%= Time.parse(format_time(simi_student_work.created_at)).strftime("%m-%d %H:%M")%></li>
|
||||
<% if student_work.simi_value >= 90 %>
|
||||
<li style = "color:red" ><%=student_work.simi_value%>%</li>
|
||||
<% if student_work.simi_value.to_i >= 90 %>
|
||||
<li style = "color:red" ><%=student_work.simi_value.to_i%>%</li>
|
||||
<% else %>
|
||||
<li ><%=student_work.simi_value%>%</li>
|
||||
<li ><%=student_work.simi_value.to_i%>%</li>
|
||||
<% end %>
|
||||
|
||||
<!--@works_hash[student_work.id].description -->
|
||||
<!--<li ><a href="javascript:void(0);" target="_blank" class="cha-btn" onclick = "show_code_compare()">查看</a>-->
|
||||
<li >
|
||||
<%= link_to("查看", show_comparecode_course_path(:homework_id => @homework.id,:src_id => student_work.id,:dst_id => student_work.simi_id),:class => "cha-btn",:remote => true ) %>
|
||||
<%= link_to("查看", show_comparecode_course_path(:homework_id => @homework.id,:src_id => student_work.id,:dst_id => student_work.simi_id.to_i),:class => "cha-btn",:remote => true ) %>
|
||||
</li>
|
||||
<%else%>
|
||||
<li class="chabox-w-151">无</li>
|
||||
<li class="chabox-w-401">无</li>
|
||||
<li>--</li>
|
||||
<li>--</li>
|
||||
<li class="chabox-r-line">--</li>
|
||||
<li >--</li>
|
||||
<li > </li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<%end%>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/show_compare_code' ,:locals => {:src_code=> @src_code,:src_name=> @src_username,:dst_name=> @dst_username, :dst_code=> @dst_code,})%>');
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/show_compare_code' ,:locals => {:src_code=> @src_code,:src_name=> @src_username,:dst_name=> @dst_username, :dst_code=> @dst_code, :simivalue=> @simi_value })%>');
|
||||
showModal('ajax-modal', '1250px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 1235px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","20%").css("left","20%").css("position","absolute");
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 1235px; margin-top:-18px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","20%").css("padding-top","20px").css("position","fixed");
|
||||
//$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px").css("padding-top","10px");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
|
||||
function closeModal(){
|
||||
hideModal($(".program-compare-code"));
|
||||
|
|
|
@ -2,3 +2,4 @@
|
|||
* Created by Administrator on 2014/12/3.
|
||||
*/
|
||||
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @members})%>");
|
|
@ -43,8 +43,8 @@
|
|||
<div id="menu_r" class="NewsBannerName" style="margin-bottom: -10px;">
|
||||
<ul class="menu_r b_w" style="padding-left: 0px; margin-top: -5px;">
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="parent" style="font-size:16px; color:#4b4b4b; font-weight: normal; padding-left: 0px;">作业</a>
|
||||
<ul>
|
||||
<a href="javascript:void(0);" class="menu_arrow" style="font-size:16px; color:#4b4b4b; font-weight: normal; padding-left: 0px;">作业</a>
|
||||
<ul style="max-height:240px; overflow-y:auto; overflow-x:hidden;">
|
||||
<% @homework_commons.each_with_index do |homework_common,index |%>
|
||||
<li class="pr10">
|
||||
<%= link_to "作业#{@homework_commons.count - index}:#{homework_common.name}",student_work_index_path(:homework => homework_common.id)%>
|
||||
|
|
|
@ -209,7 +209,7 @@
|
|||
<% end%>
|
||||
<% end%>
|
||||
</div>
|
||||
<% if @user.courses.visible.count > 0
|
||||
<%# if @user.courses.visible.count > 0
|
||||
course_order_ids = "(" +
|
||||
CourseActivity.find_by_sql("SELECT c.course_id, updated_at FROM
|
||||
(SELECT ca.course_id, MAX(ca.updated_at) AS updated_at FROM course_activities ca WHERE ca.course_id IN (" + @user.courses.visible.select('courses.id').map{|c| c.id}.join(',') + ")
|
||||
|
@ -221,7 +221,11 @@
|
|||
|
||||
end
|
||||
%>
|
||||
<%# courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
|
||||
<% if @user.courses.visible.count > 0
|
||||
courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)
|
||||
else
|
||||
courses = []
|
||||
end %>
|
||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
|
||||
|
@ -234,7 +238,7 @@
|
|||
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :style => "margin-right:10px;", :title => "新建项目"%>
|
||||
<% end%>
|
||||
</div>
|
||||
<% if @user.projects.visible.count > 0
|
||||
<%# if @user.projects.visible.count > 0
|
||||
project_order_ids = "(" +
|
||||
ForgeActivity.find_by_sql("SELECT p.project_id, p.updated_at FROM
|
||||
(SELECT fa.project_id, MAX(fa.updated_at) AS updated_at FROM forge_activities fa WHERE fa.project_id IN (" + @user.projects.visible.select('projects.id').map{|p| p.id}.join(',') + ")
|
||||
|
@ -246,7 +250,12 @@
|
|||
end
|
||||
%>
|
||||
|
||||
<%# projects = @user.projects.visible.select("projects.*, (SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
|
||||
<% if @user.projects.visible.count > 0
|
||||
projects = @user.projects.visible.select("projects.*, (SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)
|
||||
else
|
||||
projects = []
|
||||
end
|
||||
%>
|
||||
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" id="homepageLeftMenuForge">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
if (data.status == 0) {
|
||||
var homework_simi_time = data.comparetime;
|
||||
|
||||
if (!homework_simi_time){
|
||||
if (homework_simi_time == 0){
|
||||
//没进行过代码查重则直接查重
|
||||
test_repeat();
|
||||
}
|
||||
|
|
|
@ -952,7 +952,9 @@ RedmineApp::Application.routes.draw do
|
|||
match 'admin', :to => 'admin#index', :via => :get
|
||||
match 'admin/projects', :via => :get
|
||||
get 'admin/courses'
|
||||
get 'admin/excellent_courses'
|
||||
get 'admin/excellent_courses', as: :excellent_courses
|
||||
get 'admin/excellent_all_courses', as: :excellent_all_courses
|
||||
match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course'
|
||||
get 'admin/course_resource_list'
|
||||
get 'admin/project_resource_list'
|
||||
match 'admin/users', :via => :get
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
class AddSimiIdToStudentWorks < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :student_works, :simi_id, :integer, :default => false
|
||||
add_column :student_works, :simi_value, :integer, :default => false
|
||||
end
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
class AddSimiIdToStudentWorks < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :student_works, :simi_id, :integer
|
||||
add_column :student_works, :simi_value, :integer
|
||||
end
|
||||
end
|
|
@ -2850,19 +2850,21 @@ img.school_avatar {
|
|||
a.btn_message_free{ background:#15BCCF; display:block; text-align:center; color:#fff; padding:3px 0; width:60px; margin-bottom:10px;margin-left: 58px;}
|
||||
|
||||
/*20160401袁可------------------ 查重结果样式*/
|
||||
.conbox{ width:1000px; margin:0 auto; border:1px solid #f0f0f0; background:#fff;}
|
||||
.conbox{ width:1000px; margin:0 auto; border:3px solid #f0f0f0; background:#fff;}
|
||||
.conbox-h2{ font-size:16px; padding:10px 0; padding-left:25px;}
|
||||
.chabox{ width:1000px;}
|
||||
.chabox ul li{ float:left; width:87px; text-align:center; display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
|
||||
.chabox ul li.chabox-w-151{ width:151px; display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
|
||||
.chabox ul li{ float:left; width:82px; text-align:center; display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
|
||||
.chabox ul li.chabox-w-401{ width:151px; display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
|
||||
.chabox ul li.chabox-r-line{ border-right:1px solid #D1D1D1;}
|
||||
.chabox-top{ width:1000px; }
|
||||
.chabox-top li{ font-size:14px; font-weight:bold; line-height:40px; height:40px; background:#E4E4E4; color:#000;}
|
||||
.chabox-con li{font-size:12px; line-height:35px; height:35px; color:#000; border-bottom:1px solid #DFDFDF;}
|
||||
.chabox-con li{font-size:12px; line-height:35px; height:35px; color:#888; border-bottom:1px solid #DFDFDF;}
|
||||
a.cha-btn{ display:block; width:50px; height:20px; line-height:20px; margin:0 auto; border:1px solid #269ac9; color:#269ac9;-webkit-border-radius: 3px;border-radius:3px; margin-top:8px;}
|
||||
a:hover.cha-btn{ background:#269ac9; color:#fff;}
|
||||
.chabox-header li{ font-size:14px; font-weight:bold; line-height:40px; height:40px; border-top:1px solid #E4E4E4; border-right:1px solid #E4E4E4; color:#000;}
|
||||
.chabox ul li.chabox-w-500{ width:499px;}
|
||||
.chabox ul li.chabox-w-40{ width:39px; border-right:1px solid #D1D1D1;}
|
||||
.chabox ul li.chabox-txt-left{ text-align:left;text-indent:1em; }
|
||||
|
||||
.contrast-box{ width:1200px;box-shadow: 0 0 5px #6B6B6B; background:#fff; margin:0 auto; }
|
||||
.contrast-con{ width:599px; border-right:1px solid #D1D1D1; float:left;}
|
||||
|
|
|
@ -737,6 +737,8 @@ div#menu_r ul a.parent {background: url(../images/item.png) -30px -30px no-rep
|
|||
div#menu_r ul a.parent:hover {background: url(../images/item.png) -30px -60px no-repeat;}
|
||||
div#menu_r ul ul a.parent {background: url(../images/item.png) -20px 6px no-repeat;}
|
||||
div#menu_r ul ul a.parent:hover {background: url(../images/item.png) -20px -11px no-repeat;}
|
||||
.menu_arrow {background: url(../images/sort_desc.png) 40px 17px no-repeat; width:50px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
.menu_arrow:hover {background: url(../images/sort_asc.png) 40px 17px no-repeat;}
|
||||
/* menu::level1 */
|
||||
div#menu_r a { padding: 5px 12px 0 10px;line-height: 30px; color: #fff;}
|
||||
/*div#menu_r li { background: url(images/main-delimiter.png) 98% 4px no-repeat; }*/
|
||||
|
|
Loading…
Reference in New Issue