测验列表
This commit is contained in:
parent
2dc717df0c
commit
1ad0c1cbff
|
@ -621,12 +621,87 @@ class ExerciseController < ApplicationController
|
|||
#导入试卷的弹框
|
||||
def other_exercise
|
||||
# 查作者是我,或者作者是当前课程的老师,且不在当前课程内的试卷 进行导入
|
||||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
courses = User.current.courses.not_deleted.select { |course| User.current.allowed_to?(:as_teacher,course)}
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map { |course| course.id}.join(',') + ")"
|
||||
#none_courses = User.current.courses.where("is_delete = 1 or #{Course.table_name}.id = #{params[:course_id].to_i}")
|
||||
#none_course_ids = none_courses.empty? ? "(-1)" : "(" + none_courses.map { |course| course.id}.join(',') + ")"
|
||||
@exercises = Exercise.where("(user_id = #{User.current.id} or course_id in #{course_ids}) and course_id != #{params[:course_id].to_i}")
|
||||
@exercises = Exercise.where("(user_id = #{User.current.id} or course_id in #{course_ids}) and course_id != #{params[:course_id].to_i}").order("#{@order} #{@b_sort}")
|
||||
@course_id = params[:course_id]
|
||||
@is_remote = true
|
||||
@ex_count = @exercises.count
|
||||
@ex_pages = Paginator.new @ex_count, 10, params['page'] || 1
|
||||
@offset ||= @ex_pages.offset
|
||||
@exercises = paginateHelper @exercises,10
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#搜索导入页面的试卷
|
||||
def search_exercises
|
||||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
search = params[:name].to_s.strip.downcase
|
||||
courses = User.current.courses.not_deleted.select { |course| User.current.allowed_to?(:as_teacher,course)}
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map { |course| course.id}.join(',') + ")"
|
||||
@exercises = Exercise.where("(user_id = #{User.current.id} or course_id in #{course_ids}) and course_id != #{params[:course_id].to_i} and exercise_name like '%#{search}%'").order("#{@order} #{@b_sort}")
|
||||
@is_remote = true
|
||||
@ex_count = @exercises.count
|
||||
@ex_pages = Paginator.new @ex_count, 10, params['page'] || 1
|
||||
@offset ||= @ex_pages.offset
|
||||
@exercises = paginateHelper @exercises,10
|
||||
@course_id = params[:course_id]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#将选择的试卷导入到班级
|
||||
def import_other_exercise
|
||||
course_id = params[:course_id]
|
||||
@course = Course.find(course_id)
|
||||
params[:exercise_id].each_with_index do |ex,i|
|
||||
exercise = Exercise.find(ex)
|
||||
option = {
|
||||
:exercise_name => exercise.exercise_name,
|
||||
:exercise_status => 1,
|
||||
:user_id => User.current.id,
|
||||
:show_result => 1,
|
||||
:course_id => @course.id,
|
||||
:time => exercise.time,
|
||||
:exercise_description => exercise.exercise_description
|
||||
}
|
||||
@exercise = Exercise.create option
|
||||
|
||||
exercise.exercise_questions.each do |q|
|
||||
option = {
|
||||
:question_title => q[:question_title],
|
||||
:question_type => q[:question_type] || 1,
|
||||
:question_number => q[:question_number],
|
||||
:question_score => q[:question_score]
|
||||
}
|
||||
@exercise_question = @exercise.exercise_questions.new option
|
||||
|
||||
for i in 1..q.exercise_choices.count
|
||||
choice_option = {
|
||||
:choice_position => i,
|
||||
:choice_text => q.exercise_choices[i-1][:choice_text]
|
||||
}
|
||||
@exercise_question.exercise_choices.new choice_option
|
||||
end
|
||||
|
||||
for i in 1..q.exercise_standard_answers.count
|
||||
standard_answer_option = {
|
||||
:exercise_choice_id => q.exercise_standard_answers[i-1][:exercise_choice_id],
|
||||
:answer_text => q.exercise_standard_answers[i-1][:answer_text]
|
||||
}
|
||||
@exercise_question.exercise_standard_answers.new standard_answer_option
|
||||
end
|
||||
end
|
||||
@exercise.save
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<table class="newupload_table" cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="newupload_td01"> </th>
|
||||
<th class="pr">
|
||||
<%= link_to "试卷标题", search_exercises_exercise_index_path(:course_id => course_id, :order => "exercise_name", :sort => @r_sort), :remote => true%>
|
||||
<% if order == "exercise_name" %>
|
||||
<%= link_to "", search_exercises_exercise_index_path(:course_id => course_id, :order => "exercise_name", :sort => @r_sort), :class => "#{@r_sort == 'desc' ? 'sortupbtn' : 'sortdownbtn'}", :style => "position: absolute; top: 8px; left: 172px;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="newupload_td03" style="color: #7f7f7f;">来源</th>
|
||||
<th class="newupload_td04 pr">
|
||||
<%= link_to "创建时间", search_exercises_exercise_index_path(:course_id => course_id, :order => "created_at", :sort => @r_sort), :remote => true%>
|
||||
<% if order == "created_at" %>
|
||||
<%= link_to "", search_exercises_exercise_index_path(:course_id => course_id, :order => "created_at", :sort => @r_sort), :class => "#{@r_sort == 'desc' ? 'sortupbtn' : 'sortdownbtn'}", :style => "position: absolute; top: 8px; left: 75px;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% exercises.each do |exercise| %>
|
||||
<tr class="">
|
||||
<td class="newupload_td01"><input type="checkbox" name="exercise_id[]" value="<%=exercise.id %>"/></td>
|
||||
<td class="newupload_td02"><p><%=exercise.exercise_name %></p></td>
|
||||
<td class="newupload_td02"><p><%=exercise.course.name %></p></td>
|
||||
<td class="newupload_td04"><%=format_date(exercise.created_at) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
|
@ -1,54 +1,69 @@
|
|||
<%# has_commit = has_commit_poll?(poll.id ,User.current)%>
|
||||
<% exercise_name = exercise.exercise_name.empty? ? l(:label_poll_new) : exercise.exercise_name%>
|
||||
<% if @is_teacher%>
|
||||
<li title="<%= exercise.exercise_name %>">
|
||||
<div style="width: 310px;float: left;">
|
||||
<%# if has_commit %>
|
||||
<%#= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%>
|
||||
<div>
|
||||
<div title="<%= exercise.exercise_name %>">
|
||||
<div style="width: 310px;float: left;">
|
||||
<%# if has_commit %>
|
||||
<%#= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%>
|
||||
<%# else %>
|
||||
<%#= link_to poll_name, exercise_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %>
|
||||
<%# end %>
|
||||
<%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_w fl c_dblue" %>
|
||||
<% if exercise.exercise_status == 1 %>
|
||||
<span class="exercise_status_nop fl mt3"></span>
|
||||
<% elsif exercise.exercise_status == 2 %>
|
||||
<span class="exercise_status_pub fl mt3"></span>
|
||||
<% else %>
|
||||
<span class="exercise_status_end fl mt3"></span>
|
||||
<% end%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%# if exercise.exercise_status == 2 %>
|
||||
<!--<li><a class="polls_de fr ml5" onclick="" href="javascript:">关闭</a></li>-->
|
||||
<%# else %>
|
||||
<%#= link_to poll_name, exercise_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %>
|
||||
<%# end %>
|
||||
<%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_w fl c_dblue" %>
|
||||
<!--<li class="polls_de_grey fr ml5" title="发布的问卷才能进行关闭">关闭</li>-->
|
||||
<%# end%>
|
||||
|
||||
<%# if exercise.exercise_status == 1%>
|
||||
<!--<li class="polls_de_grey fr ml5">导出</li>-->
|
||||
<%# elsif exercise.exercise_status == 2 || exercise.exercise_status == 3 %>
|
||||
<!--<li><%#= link_to "导出", export_exercise_exercise_path(exercise.id,:format => "xls"), :class => "polls_de fr ml5"%></li>-->
|
||||
<%# end%>
|
||||
<% if exercise.exercise_status == 1 %>
|
||||
<div><a href="javascript:" class="pollsbtn btn_pu fr mr10 ml5" onclick="exercise_submit(<%= exercise.id%>,<%= exercise.exercise_name.length %>,<%=index.to_i %>);">发布试卷</a></div>
|
||||
<% elsif exercise.exercise_status == 2%>
|
||||
<div><a href="javascript:" class="pollsbtn btn_de fr mr10 ml5" onclick="republish_exercise(<%= exercise.id%>,<%=index.to_i %>);">取消发布</a></div>
|
||||
<% else%>
|
||||
<div class="pollsbtn fr mr10 pollsbtn_grey ml5">发布试卷</div>
|
||||
<% end%>
|
||||
|
||||
<% if exercise.exercise_status == 1%>
|
||||
<div class="pollsbtn fr mr10 pollsbtn_grey">统计结果</div>
|
||||
<% else %>
|
||||
<div><%= link_to l(:label_statistical_results), student_exercise_list_exercise_path(exercise.id,:course_id => @course.id), :class => "pollsbtn fr mr10"%></div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt10">
|
||||
<span class="c_grey fl mr15">测试时长:<%= exercise.time.nil? || exercise.time == -1 ? '不限' : exercise.time.to_s + "分钟" %></span>
|
||||
<span class="c_grey fl mr15">截止时间:<%= exercise.end_time.nil? ? '未设置' : format_time(exercise.end_time) %></span>
|
||||
<span class="c_grey fl mr15">发布时间:<%= exercise.publish_time.nil? ? '未设置' : format_time(exercise.publish_time) %></span>
|
||||
<% if exercise.exercise_status > 2 %>
|
||||
<span class="c_grey fl mr15">已提交:<span class="c_blue"><%= exercise.exercise_users.where("created_at >= #{exercise.end_time.to_i}").count %></span></span>
|
||||
<span class="c_grey fl mr15">未提交:<span class="c_blue"><%= exercise.course.student.count - exercise.exercise_users.where("created_at >= #{exercise.end_time.to_i}").count %></span></span>
|
||||
<% end %>
|
||||
|
||||
<div id="exercise_opr_<%=exercise.id %>" class="none fr">
|
||||
<a href="javascript:void(0)" onClick="delete_exercise(<%=exercise.id %>);" class="ex_icon_de mt0"></a>
|
||||
<% if exercise.exercise_status == 1 %>
|
||||
<%= link_to '', edit_exercise_path(exercise.id), :class => "ex_icon_edit mt0"%>
|
||||
<% end%>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<%# if exercise.exercise_status == 2 %>
|
||||
<!--<li><a class="polls_de fr ml5" onclick="" href="javascript:">关闭</a></li>-->
|
||||
<%# else %>
|
||||
<!--<li class="polls_de_grey fr ml5" title="发布的问卷才能进行关闭">关闭</li>-->
|
||||
<%# end%>
|
||||
|
||||
<%# if exercise.exercise_status == 1%>
|
||||
<!--<li class="polls_de_grey fr ml5">导出</li>-->
|
||||
<%# elsif exercise.exercise_status == 2 || exercise.exercise_status == 3 %>
|
||||
<!--<li><%#= link_to "导出", export_exercise_exercise_path(exercise.id,:format => "xls"), :class => "polls_de fr ml5"%></li>-->
|
||||
<%# end%>
|
||||
<% if exercise.exercise_status == 1 %>
|
||||
<li><a href="javascript:" class="pollsbtn btn_pu fr mr10 ml5" onclick="exercise_submit(<%= exercise.id%>,<%= exercise.exercise_name.length %>,<%=index.to_i %>);">发布试卷</a></li>
|
||||
<% elsif exercise.exercise_status == 2%>
|
||||
<li><a href="javascript:" class="pollsbtn btn_de fr mr10 ml5" onclick="republish_exercise(<%= exercise.id%>,<%=index.to_i %>);">取消发布</a></li>
|
||||
<% else%>
|
||||
<li class="pollsbtn fr mr10 pollsbtn_grey ml5">发布试卷</li>
|
||||
<% end%>
|
||||
|
||||
<% if exercise.exercise_status == 1%>
|
||||
<li class="pollsbtn fr mr10 pollsbtn_grey">统计结果</li>
|
||||
<% else %>
|
||||
<li><%= link_to l(:label_statistical_results), student_exercise_list_exercise_path(exercise.id,:course_id => @course.id), :class => "pollsbtn fr mr10"%></li>
|
||||
<% end%>
|
||||
|
||||
<%= link_to(l(:button_delete), exercise,:method => :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml5 mr10") %>
|
||||
|
||||
<% if exercise.exercise_status == 1 %>
|
||||
<li><%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "polls_de fr ml10"%></li>
|
||||
<li class="polls_date fr"><%=exercise.publish_time.nil? ? "未发布" : "将于"+format_time(exercise.publish_time.to_s)+"发布"%></li>
|
||||
<% elsif exercise.exercise_status == 2 %>
|
||||
<li class="polls_de_grey fr ml10" title="未发布的试卷才能进行编辑">编辑</li>
|
||||
<li class="polls_date fr">已发布</li>
|
||||
<% else %>
|
||||
<li class="polls_de_grey fr ml10" title="未发布的试卷才能进行编辑">编辑</li>
|
||||
<li class="polls_date fr">已截止</li>
|
||||
<% end%>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<% else%>
|
||||
<% if exercise.exercise_status != 1%>
|
||||
|
@ -71,4 +86,12 @@
|
|||
<li class="pollsbtn fr mr10 pollsbtn_grey" title="截止时间未到,暂不能查看统计结果">统计结果</li>
|
||||
<%end%>
|
||||
<% end %>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<script>
|
||||
function delete_exercise(id){
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f16">您确定要删除吗</p><div class="cl"></div><a href="/exercise/'+ id +'" class="fr sy_btn_blue mr90 mt10" data-method="delete" data-remote="true">确定</a>'+
|
||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取消</a></div></div>';
|
||||
pop_box_new(htmlvalue, 300, 140);
|
||||
}
|
||||
</script>
|
|
@ -3,15 +3,15 @@
|
|||
<span>(<%= @obj_count%>)</span>
|
||||
</h2>
|
||||
<% if @is_teacher%>
|
||||
<%= link_to "导入试卷", other_exercise_exercise_index_path(:course_id => @course.id), :remote=>true,:class => "newbtn"%>
|
||||
<%= link_to "新建试卷 ", new_exercise_path(:course_id => @course.id), :class => "newbtn" %>
|
||||
<%= link_to "导入试卷", other_exercise_exercise_index_path(:course_id => @course.id), :remote=>true,:class => "newbtn"%>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="polls_list" class="polls_list">
|
||||
|
||||
<% @exercises.each_with_index do |exercise,index|%>
|
||||
<ul id="exercises_<%= exercise.id %>" class="polls_list_ul">
|
||||
<ul id="exercises_<%= exercise.id %>" class="exercise_list_div" onmouseover="$('#exercise_opr_<%=exercise.id %>').show();" onmouseout="$('#exercise_opr_<%=exercise.id %>').hide();">
|
||||
<%= render :partial => 'exercise', :locals => {:exercise => exercise,:index => index} %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -7,111 +7,75 @@
|
|||
<div class="muban_popup_con">
|
||||
<div class="newupload_conbox">
|
||||
<div class="newupload_search_box mb10">
|
||||
<input class="newupload_search_input" placeholder="输入试卷标题的关键词进行搜索" type="text">
|
||||
<input class="newupload_search_input" placeholder="输入试卷标题的关键词进行搜索" name="search" type="text">
|
||||
<a href="javascript:void(0);" class="newupload_btn_search"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" ml15">
|
||||
<table class="newupload_table " cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="newupload_td01"> </th>
|
||||
<th>试卷标题</th>
|
||||
<th class="newupload_td03">来源</th>
|
||||
<th class="newupload_td05">引用数<a href="javascript:void(0);" class="sortdownbtn mt5 fr"></a></th>
|
||||
<th class="newupload_td05">创建时间<a href="javascript:void(0);" class="sortdownbtn mt5 fr mr5"></a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="newupload_td01"><input type="checkbox"> </td>
|
||||
<td class="newupload_td02"><p>软件测试小测</p></td>
|
||||
<td class="newupload_td02"><p>软件测试软件测试软件测试软件测试软件测试软件测试软件测试软件测试</p></td>
|
||||
<td class="newupload_td05">300000</td>
|
||||
<td class="newupload_td05">2016-10-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="newupload_td01"><input type="checkbox"> </td>
|
||||
<td class="newupload_td02"><p>数据库查询系统数据库查询系统课数据库查询系统课数据库查询系统课数据库查询系统课课件练习.doc</p></td>
|
||||
<td class="newupload_td02"><p>软件测试</p></td>
|
||||
<td class="newupload_td05">1</td>
|
||||
<td class="newupload_td05">2016-10-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="newupload_td01"><input type="checkbox"> </td>
|
||||
<td class="newupload_td02"><p>软件测试小测</p></td>
|
||||
<td class="newupload_td02"><p>软件测试软件测试软件测试软件测试软件测试软件测试软件测试软件测试</p></td>
|
||||
<td class="newupload_td05">3</td>
|
||||
<td class="newupload_td05">2016-10-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="newupload_td01"><input type="checkbox"> </td>
|
||||
<td class="newupload_td02"><p>数据库查询系统数据库查询系统课数据库查询系统课数据库查询系统课数据库查询系统课课件练习.doc</p></td>
|
||||
<td class="newupload_td02"><p>软件测试</p></td>
|
||||
<td class="newupload_td05">1</td>
|
||||
<td class="newupload_td05">2016-10-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="newupload_td01"><input type="checkbox"> </td>
|
||||
<td class="newupload_td02"><p>软件测试小测</p></td>
|
||||
<td class="newupload_td02"><p>软件测试软件测试软件测试软件测试软件测试软件测试软件测试软件测试</p></td>
|
||||
<td class="newupload_td05">3</td>
|
||||
<td class="newupload_td05">2016-10-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="newupload_td01"><input type="checkbox"> </td>
|
||||
<td class="newupload_td02"><p>数据库查询系统数据库查询系统课数据库查询系统课数据库查询系统课数据库查询系统课课件练习.doc</p></td>
|
||||
<td class="newupload_td02"><p>软件测试</p></td>
|
||||
<td class="newupload_td05">1</td>
|
||||
<td class="newupload_td05">2016-10-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="newupload_td01"><input type="checkbox"> </td>
|
||||
<td class="newupload_td02"><p>软件测试小测</p></td>
|
||||
<td class="newupload_td02"><p>软件测试软件测试软件测试软件测试软件测试软件测试软件测试软件测试</p></td>
|
||||
<td class="newupload_td05">3</td>
|
||||
<td class="newupload_td05">2016-10-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="newupload_td01"><input type="checkbox"> </td>
|
||||
<td class="newupload_td02"><p>数据库查询系统数据库查询系统课数据库查询系统课数据库查询系统课数据库查询系统课课件练习.doc</p></td>
|
||||
<td class="newupload_td02"><p>软件测试</p></td>
|
||||
<td class="newupload_td05">1</td>
|
||||
<td class="newupload_td05">2016-10-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="newupload_td01"><input type="checkbox"> </td>
|
||||
<td class="newupload_td02"><p>软件测试小测</p></td>
|
||||
<td class="newupload_td02"><p>软件测试软件测试软件测试软件测试软件测试软件测试软件测试软件测试</p></td>
|
||||
<td class="newupload_td05">3</td>
|
||||
<td class="newupload_td05">2016-10-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="newupload_td01"><input type="checkbox"> </td>
|
||||
<td class="newupload_td02"><p>数据库查询系统数据库查询系统课数据库查询系统课数据库查询系统课数据库查询系统课课件练习.doc</p></td>
|
||||
<td class="newupload_td02"><p>软件测试</p></td>
|
||||
<td class="newupload_td05">1</td>
|
||||
<td class="newupload_td05">2016-10-26</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="clear">
|
||||
<div class="clear fl mt10">
|
||||
<button class=" btn btn-blue fr ">确定</button >
|
||||
<button class=" btn fr mr5">取消</button >
|
||||
<%=form_tag import_other_exercise_exercise_index_path,
|
||||
method: :post,
|
||||
remote: true,
|
||||
id: "import_other_exercise_form" do %>
|
||||
<input type="hidden" name="course_id" value="<%= course_id%>" />
|
||||
<div class="ml15">
|
||||
<div id="all_import_exercises">
|
||||
<%=render :partial => 'all_import_exercises', :locals => {:exercises => exercises, :course_id => course_id, :order => @order} %>
|
||||
</div>
|
||||
<div class="clear">
|
||||
<p class="none c_red" id="choose_exercise_notice"></p>
|
||||
<div class="clear fl mt10">
|
||||
<a href="javascript:void(0)" class="btn btn-blue fr" onclick="submit_import_form();">确定</a>
|
||||
<a href="javascript:void(0)" class="btn fr mr5" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
<div class="fr mr10">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="exercise_ref_pages">
|
||||
<%= pagination_links_full @ex_pages, @ex_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fr pages_right_min mt10 mr15" >
|
||||
<a href="javascript:void(0);" class="pages-big">上一页</a>
|
||||
<a href="javascript:void(0);" class="active ">1</a>
|
||||
<a href="javascript:void(0);">2</a>
|
||||
<a href="javascript:void(0);">3</a>
|
||||
<a href="javascript:void(0);">...</a>
|
||||
<a href="javascript:void(0);">31</a>
|
||||
<a href="javascript:void(0);" class="pages-big pages-border-right">下一页</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function submit_import_form(){
|
||||
var checkboxs = $("input[name='exercise_id[]']:checked");
|
||||
if(checkboxs.length > 0) {
|
||||
$("#choose_exercise_notice").html("");
|
||||
$('#import_other_exercise_form').submit();
|
||||
hideModal();
|
||||
} else{
|
||||
$("#choose_exercise_notice").html("请至少选择一个试卷");
|
||||
$("#choose_exercise_notice").show();
|
||||
}
|
||||
}
|
||||
|
||||
var lastSearchCondition = '';
|
||||
var count = 0;
|
||||
function search_exs(e){
|
||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'exercise', :action => 'search_exercises') %>'+'?name='+ e.target.value+'&course_id=<%=course_id %>',
|
||||
type:'get'
|
||||
});
|
||||
}
|
||||
|
||||
function throttle(method,context,e){
|
||||
clearTimeout(method.tId);
|
||||
method.tId=setTimeout(function(){
|
||||
method.call(context,e);
|
||||
},500);
|
||||
}
|
||||
|
||||
//查询项目
|
||||
$("input[name='search']").on('input', function (e) {
|
||||
throttle(search_exs,window,e);
|
||||
});
|
||||
</script>
|
|
@ -1 +1,2 @@
|
|||
hideModal();
|
||||
$("#exercise").html("<%= escape_javascript(render :partial => 'exercises_list') %>");
|
|
@ -0,0 +1,9 @@
|
|||
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>试卷已导入<br/>但需要您设置发布时间和截止时间,以激活相应的试卷<br/></p>' +
|
||||
'<a href="javascript:void(0);" class="btn btn-blue mt10" onclick="click_OK();">知道了</a></div></div></div>';
|
||||
pop_box_new(htmlvalue, 400, 152);
|
||||
|
||||
function click_OK(){
|
||||
hideModal();
|
||||
window.location.href = "<%= exercise_index_path(:course_id => @course.id) %>";
|
||||
}
|
|
@ -4,5 +4,5 @@ var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muba
|
|||
pop_box_new(htmlvalue, 300, 140);
|
||||
<% else %>
|
||||
var html_value = '<%= escape_javascript(render :partial => 'other_exercises',:locals => {:exercises => @exercises, :course_id=>@course_id}) %>';
|
||||
pop_box_new(html_value, 510, 550);
|
||||
pop_box_new(html_value, 745, 600);
|
||||
<% end %>
|
|
@ -0,0 +1,3 @@
|
|||
$("#all_import_exercises").html('<%= escape_javascript(render :partial => 'all_import_exercises', :locals => {:exercises => @exercises, :course_id => @course_id, :order => @order})%>');
|
||||
$("#exercise_ref_pages").html('<%= pagination_links_full @ex_pages, @ex_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
|
||||
$("#choose_exercise_notice").html("");
|
|
@ -297,6 +297,8 @@ RedmineApp::Application.routes.draw do
|
|||
delete 'delete_exercise_question'
|
||||
post 'update_exercise_question'
|
||||
get 'other_exercise'
|
||||
post 'import_other_exercise'
|
||||
get 'search_exercises'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -708,3 +708,5 @@ a:hover.hw_btn_blue,a:active.hw_btn_blue{ background: #3b94d6; color:#fff;}
|
|||
.disabled {background-color:#f5f5f5;}
|
||||
|
||||
#popupWrap ul{cursor: default;}
|
||||
|
||||
.bg_checked{background-color: #64bdd9;}
|
|
@ -586,3 +586,15 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
|
|||
.group_work_tip_box {width:200px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-255px; top:-90px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
|
||||
.group_work_tip_box em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
|
||||
.group_work_tip_box span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
|
||||
|
||||
/*试卷*/
|
||||
.exercise_list_div{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:62px; padding-top:8px;}
|
||||
.exercise_status_nop{ display:block; width:33px; height:22px; background:url(/images/sy/icons_sy.png) 0 -636px no-repeat; color:#fff; font-size:12px; padding-left:10px; line-height: 22px;}
|
||||
.exercise_status_pub{ display:block; width:33px; height:22px; background:url(/images/sy/icons_sy.png) 0 -613px no-repeat; color:#fff; font-size:12px; padding-left:10px; line-height: 22px;}
|
||||
.exercise_status_end{ display:block; width:33px; height:22px; background:url(/images/sy/icons_sy.png) 0 -659px no-repeat; color:#fff; font-size:12px; padding-left:10px; line-height: 22px;}
|
||||
.exercise_status_com{ display:block; width:33px; height:22px; background:url(/images/sy/icons_sy.png) 0 -681px no-repeat; color:#fff; font-size:12px; padding-left:10px; line-height: 22px;}
|
||||
.exercise_status_nocom{ display:block; width:33px; height:22px; background:url(/images/sy/icons_sy.png) 0 -705px no-repeat; color:#fff; font-size:12px; padding-left:10px; line-height: 22px;}
|
||||
a.ex_icon_de{ background:url(/images/course/icons.png) 0px -342px no-repeat; width:16px; height:27px; display:block;float:right;}
|
||||
a:hover.ex_icon_de{ background:url(/images/course/icons.png) -20px -342px no-repeat;}
|
||||
.ex_icon_edit{ background:url(/images/course/icons.png) 0px -276px no-repeat; width:16px; height:27px; display:block;float:right; margin-right:10px;}
|
||||
a:hover.ex_icon_edit{ background:url(/images/course/icons.png) -21px -276px no-repeat;}
|
|
@ -63,10 +63,58 @@ a:hover.sub_btn{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
|
|||
/*模板form 20161013byLB*/
|
||||
textarea.muban_textarea{ width: 98.5%;border:1px solid #ddd; background:#fff; color:#666; padding:5px;}
|
||||
/*模板图标20161020byLB*/
|
||||
.muban-icons-clock{ background: url("../images/project/icons_issue.png") 0 -224px no-repeat; display: inline-block; width: 19px; height: 13px;}
|
||||
.muban-icons-clock{ background: url("/images/project/icons_issue.png") 0 -224px no-repeat; display: inline-block; width: 19px; height: 13px;}
|
||||
/*提示条20161020byLB*/
|
||||
.alert{ padding:10px;border: 1px solid transparent; text-align: center;}
|
||||
.alert-blue{ background-color: #d9edf7;border-color: #bce8f1; color: #3a87ad;}
|
||||
.alert-orange{ background-color: #fff9e9;border-color: #f6d0b1; color:#ee4a20;}
|
||||
.close{padding: 0;cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; font-size: 21px; font-weight: bold;line-height: 1; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.3;}
|
||||
.close:hover{opacity: 0.5;}
|
||||
.close:hover{opacity: 0.5;}
|
||||
|
||||
/*新版上传资源弹框20161103byLB*/
|
||||
.newuploadbox li{ line-height: 30px;}
|
||||
.icons_new_file{display:block; width:16px; height:16px; background: url("/images/icons_newpublic.png") 0px 0px no-repeat; }
|
||||
.icons_new_del{display:block; width:16px; height:17px; background: url("/images/icons_newpublic.png") 0px -26px no-repeat; }
|
||||
.newupload_txt{ display: block; max-width:280px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
#muban_popup_box select.newupload_select{ width: 164px; height: 30px;}
|
||||
.newupload_textarea{ width: 316px; padding:5px; border:1px solid #c8c8c8;}
|
||||
#muban_popup_box label.newupload_innnerlabel{ width: auto; text-align: left;}
|
||||
/*新版导入资源弹框20161107byLB*/
|
||||
.newupload_conbox{ background: #fff; padding:15px; padding-bottom: 0;}
|
||||
.newupload_navbox{border-bottom:1px solid #dbdbdb;}
|
||||
.newupload_nav { height: 30px; line-height: 30px; background: #e7e7e7; }
|
||||
.newupload_nav li {float:left; padding:0 15px; display: block; text-align:center; }
|
||||
.newupload_nav li:last-child{ border-right: none;}
|
||||
.newupload_nav li a{font-size:12px; color:#444;}
|
||||
.newupload_nav_hover{ background: #3498db; }
|
||||
.newupload_nav_nomal { }
|
||||
.newupload_nav_hover a{color: #fff !important; }
|
||||
.lightheight28{ line-height: 28px;}
|
||||
/* 搜索 */
|
||||
.newupload_search_box{ position:relative; }
|
||||
#muban_popup_box input.newupload_search_input{ width:683px; height:38px; border:none; border:1px solid #d3d8e7; background:#fff; padding-left:5px; padding-right:25px;}
|
||||
.newupload_search_box a.newupload_btn_search{display:block; width:20px; height:20px; background:url(/images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:10px; cursor:pointer;}
|
||||
.newupload_search_box a:hover.newupload_btn_search{background:url(/images/hw/icons_hw.png) -40px -57px no-repeat;}
|
||||
|
||||
/*表格*/
|
||||
.newupload_table{ width:715px; background:#fff; border:1px solid #e5e5e5; border-bottom: none; text-align: center;}
|
||||
.newupload_table thead tr,.sy_new_table tbody tr{ height:30px; line-height:30px; border-bottom:1px solid #e5e5e5;}
|
||||
.newupload_table thead tr th{ border-bottom:1px solid #e5e5e5; font-weight: bold; background-image: linear-gradient(#fcfcfc, #eee);}
|
||||
.newupload_table tbody tr:hover{ background:#f5f5f5;}
|
||||
.newupload_table tbody tr td{ height:30px; border-bottom:1px solid #e5e5e5; color:#888;}
|
||||
.newupload_table td{ padding:0 5px;}
|
||||
.newupload_td01{ }
|
||||
.newupload_td02{width:285px; text-align: left; }
|
||||
.newupload_td02 p{ width:285px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; display: inline-block;}
|
||||
.newupload_td03{width:200px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
.newupload_td04{width:100px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
.icons_rslock{ width:13px; height:13px; background:url("/images/icons_newpublic.png") 0px -52px no-repeat; display: inline-block;}
|
||||
.icons_uploadfiles{width:18px; height:15px; background:url("/images/icons_newpublic.png") 0px -75px no-repeat; display: inline-block;}
|
||||
.upload_select_box{ width: 337px; height:240px; overflow-y:scroll; padding: 10px; background:#f7f9fd; color: #333; }
|
||||
#muban_popup_box label.upload_select_label{ width:275px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis; text-align: left; display: inline-block; }
|
||||
.newupload_tishi{ text-align: center; font-size: 14px;}
|
||||
.newupload_label_name{ display: inline-block;max-width:130px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
.newupload_table_name{ display: inline-block;max-width:90px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
.newupload_table_name02{ display: inline-block;max-width:90px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
|
||||
.newupload_td06{max-width:200px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
Loading…
Reference in New Issue