|
|
|
@ -15,35 +15,36 @@
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
|
|
|
|
$(".white-panel li").click(function(){
|
|
|
|
|
$(function () {
|
|
|
|
|
$(".white-panel li").click(function () {
|
|
|
|
|
$(".white-panel li").removeClass("active");
|
|
|
|
|
$(this).addClass("active");
|
|
|
|
|
var n=$(this).attr("index");
|
|
|
|
|
var n = $(this).attr("index");
|
|
|
|
|
|
|
|
|
|
if($(this).find("a").html().trim()=="作业问答"){
|
|
|
|
|
if ($(this).find("a").html().trim() == "作业问答") {
|
|
|
|
|
$.get("<%= homework_discuss_student_work_index_path(:homework => @homework.id) %>");
|
|
|
|
|
}
|
|
|
|
|
if($(this).find("a").html().trim()=="设置"){
|
|
|
|
|
if ($(this).find("a").html().trim() == "设置") {
|
|
|
|
|
$.get("<%= homework_setting_student_work_index_path(:homework => @homework.id, :is_new => @is_new) %>");
|
|
|
|
|
}
|
|
|
|
|
if($(this).find("a").html().trim()=="查重结果"){
|
|
|
|
|
if ($(this).find("a").html().trim() == "查重结果") {
|
|
|
|
|
$.get("<%= code_review_results_student_work_index_path(:homework => @homework.id) %>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(".edu-tab-con").addClass("undis");
|
|
|
|
|
$("#edu-tab-con-"+n).removeClass("undis");
|
|
|
|
|
$("#edu-tab-con-" + n).removeClass("undis");
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="edu-class-container">
|
|
|
|
|
<p class="mb10">
|
|
|
|
|
<%= link_to @homework.course.name, course_path(@homework.course),:class => "color-grey-9" %>
|
|
|
|
|
> <% if @homework.course_homework_category.present? %>
|
|
|
|
|
<%= link_to @homework.course.name, course_path(@homework.course), :class => "color-grey-9" %>
|
|
|
|
|
>
|
|
|
|
|
<% if @homework.course_homework_category.present? %>
|
|
|
|
|
<%= link_to @homework.course_homework_category.name, homework_common_index_path(:course => @homework.course_id, :homework_type => @homework.homework_type, :category => @homework.course_homework_category_id), :class => "color-grey-9" %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= link_to "#{@homework.homework_type_ch}作业", homework_common_index_path(:course => @homework.course_id, :homework_type => @homework.homework_type),:class => "color-grey-9" %>
|
|
|
|
|
<%= link_to "#{@homework.homework_type_ch}作业", homework_common_index_path(:course => @homework.course_id, :homework_type => @homework.homework_type), :class => "color-grey-9" %>
|
|
|
|
|
<% end %>
|
|
|
|
|
> #<%= get_hw_index(@homework, @is_teacher, @homework.homework_type) + 1 %></p>
|
|
|
|
|
<div class="pt10 pb10 edu-back-white clearfix">
|
|
|
|
@ -71,7 +72,7 @@
|
|
|
|
|
<a href="javascript:void(0);" class="tab_type">参考答案</a>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if @is_teacher && @homework.homework_type == 4 && @homework.homework_group_reviews.size > 0 %>
|
|
|
|
|
<% if @is_teacher && @homework.homework_type == 4 && @homework.homework_group_reviews.count > 0 %>
|
|
|
|
|
<li id="edu-tab-nav-5" index="5">
|
|
|
|
|
<a href="javascript:void(0);" class="tab_type">
|
|
|
|
|
查重结果
|
|
|
|
@ -153,7 +154,7 @@
|
|
|
|
|
<% student_works = @homework.student_works.where("work_status != 0") %>
|
|
|
|
|
<% if @group_teacher %>
|
|
|
|
|
<% groups = @course.course_groups.where(:id => @member.teacher_course_groups.pluck(:course_group_id)) %>
|
|
|
|
|
<% group_students = @course.members.where(:course_group_id => @member.teacher_course_groups.pluck(:course_group_id)).select{|m| m.roles.to_s.include?("Student")} %>
|
|
|
|
|
<% group_students = @course.members.where(:course_group_id => @member.teacher_course_groups.pluck(:course_group_id)).select {|m| m.roles.to_s.include?("Student")} %>
|
|
|
|
|
<% student_works = student_works.where(:user_id => group_students.map(&:user_id)) %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<% groups = @course.course_groups %>
|
|
|
|
@ -198,11 +199,15 @@
|
|
|
|
|
<a href="javascript:void(0);" id="status_no_limit" class="<%= @status.blank? ? 'check_on' : '' %> pl10 pr10">不限</a>
|
|
|
|
|
</span>
|
|
|
|
|
<input id="work_status_1" class="magic-checkbox fl" type="checkbox" value="0" name="status[]" <%= !@status.blank? && @status.include?('0') ? 'checked' : '' %>>
|
|
|
|
|
<label for="work_status_1" class="fl mr25">未提交(<%= @all_student_works.where(:work_status => 0).size %>)</label>
|
|
|
|
|
<label for="work_status_1" class="fl mr25">未提交(<%= @all_student_works.where(:work_status => 0).count %>
|
|
|
|
|
)</label>
|
|
|
|
|
<input id="work_status_2" class="magic-checkbox fl" type="checkbox" value="1" name="status[]" <%= !@status.blank? && @status.include?('1') ? 'checked' : '' %>>
|
|
|
|
|
<label for="work_status_2" class="fl mr25">按时提交(<%= student_works.where(:work_status => 1).size %>)</label>
|
|
|
|
|
<label for="work_status_2" class="fl mr25">按时提交(<%= student_works.where(:work_status => 1).count %>
|
|
|
|
|
)</label>
|
|
|
|
|
<input id="work_status_3" class="magic-checkbox fl" type="checkbox" value="2" name="status[]" <%= !@status.blank? && @status.include?('2') ? 'checked' : '' %>>
|
|
|
|
|
<label for="work_status_3" class="fl mr25">延时提交(<%= student_works.where(:work_status => 2).size %>)</label>
|
|
|
|
|
<label for="work_status_3" class="fl mr25">延时提交(<%= student_works.where(:work_status => 2).count %>
|
|
|
|
|
)</label>
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
<li class="clearfix">
|
|
|
|
|
<span class="fl mr10 color-grey-8">分班情况:</span>
|
|
|
|
@ -212,7 +217,8 @@
|
|
|
|
|
<p class="fl pb10" style="display: block;max-width: 995px;">
|
|
|
|
|
<% groups.includes(:members).each do |group| %>
|
|
|
|
|
<input id="group_<%= group.id %>" class="magic-checkbox fl" type="checkbox" value="<%= group.id %>" name="group[]" <%= !@group.blank? && @group.include?(group.id) ? 'checked' : '' %>>
|
|
|
|
|
<label for="group_<%= group.id %>" class="fl mr25"><%= group.name %>(<%= group.members.size %>)</label>
|
|
|
|
|
<label for="group_<%= group.id %>" class="fl mr25"><%= group.name %>
|
|
|
|
|
(<%= group.members.count %>)</label>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if !@group_teacher %>
|
|
|
|
|
<input id="group_0" class="magic-checkbox fl" type="checkbox" value="0" name="group[]">
|
|
|
|
@ -241,6 +247,10 @@
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<% if User.current.admin? %>
|
|
|
|
|
<a onclick="sonar()" data-tip-down="仅限振远使用" class="fl white-btn orange-btn mt10 ml25">质量检测</a>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<div class="edu-find fr mr20 with20 pr">
|
|
|
|
|
<div class="edu-find-input">
|
|
|
|
|
<input type="text" class="task-form-100 panel-box-sizing" maxlength="20" placeholder="姓名、学号关键字检索" value="<%= @name %>" id="course_student_name"/>
|
|
|
|
@ -362,8 +372,7 @@
|
|
|
|
|
if (!event) {
|
|
|
|
|
event = window.event; //针对ie浏览器
|
|
|
|
|
code = event.keyCode;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
code = event.keyCode;
|
|
|
|
|
}
|
|
|
|
|
if (code == 13) {
|
|
|
|
@ -416,4 +425,28 @@
|
|
|
|
|
pop_box_new(htmlvalue, 452, 163);
|
|
|
|
|
$("#submit_url").val('<%= import_score_student_work_index_path(:homework => @homework.id) %>');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function sonar() {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/student_work/sonar?homework=' + $("#homework_id").val(),
|
|
|
|
|
type: 'get',
|
|
|
|
|
data: $("#student_work_search_form").serialize(),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
console.log(data);
|
|
|
|
|
//调用sonar
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: 'http://127.0.0.1:8080/api/sonar',
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
dataType: "json",
|
|
|
|
|
type: 'post',
|
|
|
|
|
data: JSON.stringify(data),
|
|
|
|
|
success: function (data1) {
|
|
|
|
|
console.log(data1);
|
|
|
|
|
alert('调用完成,请等待处理完成');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|