dev_local
cxt 6 years ago
parent aee5cf576d
commit 956ac51b8a

@ -9,11 +9,11 @@ class ExerciseController < ApplicationController
:send_to_course, :get_student_uncomplete_question, :edit_question_score, :setting, :set_public, :send_to_course, :get_student_uncomplete_question, :edit_question_score, :setting, :set_public,
:ex_setting, :add_to_exercise_bank, :choose_shixuns, :shixun_question, :back_to_answer, :export_blank_exercise, :export_student_result, :ex_setting, :add_to_exercise_bank, :choose_shixuns, :shixun_question, :back_to_answer, :export_blank_exercise, :export_student_result,
:choose_student, :redo_exercise, :cancel_commit_confirm, :cancel_commit, :choose_student, :redo_exercise, :cancel_commit_confirm, :cancel_commit,
:update_shixun_block, :delete_shixun_question] :update_shixun_block, :delete_shixun_question, :delete_choose_shixun]
before_filter :find_course, :only => [:index,:new,:create] before_filter :find_course, :only => [:index,:new,:create]
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :create_exercise_question, :publish_exercise, :publish_notice, :end_exercise, :cancel_publish, before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :create_exercise_question, :publish_exercise, :publish_notice, :end_exercise, :cancel_publish,
:update_question_num, :send_to_course, :edit_question_score, :set_public, :ex_setting, :export_blank_exercise, :export_student_result, :update_question_num, :send_to_course, :edit_question_score, :set_public, :ex_setting, :export_blank_exercise, :export_student_result,
:choose_shixuns, :shixun_question, :update_shixun_block, :delete_shixun_question] :choose_shixuns, :shixun_question, :update_shixun_block, :delete_shixun_question, :delete_choose_shixun]
before_filter :require_login, :only => [:student_exercise_list, :show] before_filter :require_login, :only => [:student_exercise_list, :show]
include ExerciseHelper include ExerciseHelper
include ApplicationHelper include ApplicationHelper
@ -76,12 +76,12 @@ class ExerciseController < ApplicationController
if @exercise_user.nil? if @exercise_user.nil?
@exercise_user = ExerciseUser.create(:user_id => User.current.id, :exercise_id => @exercise.id, :start_at => Time.now, :status => false, :commit_status => 0) @exercise_user = ExerciseUser.create(:user_id => User.current.id, :exercise_id => @exercise.id, :start_at => Time.now, :status => false, :commit_status => 0)
if @exercise.exercise_level_settings.where("num != exercise_questions_count").count > 0 if @exercise.exercise_level_settings.where("num != exercise_questions_count").count > 0
@exercise.create_user_question_list(@exercise_user) @exercise.create_user_question_list(@exercise_user.id)
end end
# @exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first # @exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first
elsif @exercise_user.start_at.nil? elsif @exercise_user.start_at.nil?
if @exercise.exercise_level_settings.where("num != exercise_questions_count").count > 0 if @exercise.exercise_level_settings.where("num != exercise_questions_count").count > 0
@exercise.create_user_question_list(@exercise_user) @exercise.create_user_question_list(@exercise_user.id)
end end
@exercise_user.update_attributes(:start_at => Time.now) @exercise_user.update_attributes(:start_at => Time.now)
end end
@ -112,7 +112,7 @@ class ExerciseController < ApplicationController
@can_edit_excercise = false @can_edit_excercise = false
end end
@exercise_questions = user_question_list @exercise_user.id @exercise_questions = @exercise.user_question_list @exercise_user.id
# @percent = get_percent(@exercise,User.current) # @percent = get_percent(@exercise,User.current)
#@exercise_questions = @exercise.exercise_questions #@exercise_questions = @exercise.exercise_questions
@ -221,6 +221,10 @@ class ExerciseController < ApplicationController
@exercise.exercise_level_settings.destroy_all @exercise.exercise_level_settings.destroy_all
end end
def delete_choose_shixun
@exercise.exercise_questions.where(question_type: 5, exercise_level_setting_id: 0).destroy_all
end
def create def create
if params[:exercise] if params[:exercise]
exercise = Exercise.new exercise = Exercise.new
@ -1315,7 +1319,7 @@ class ExerciseController < ApplicationController
if @is_teacher || (User.current.member_of_course?(@exercise.course) && @exercise.exercise_status > 2) if @is_teacher || (User.current.member_of_course?(@exercise.course) && @exercise.exercise_status > 2)
@user = User.find params[:user_id] @user = User.find params[:user_id]
@exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", @user.id, @exercise.id).first @exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", @user.id, @exercise.id).first
@exercise_questions = @exercise.user_question_list @exercise_user.id @exercise_questions = (@exercise.user_question_list @exercise_user.id).reorder("question_number = 0 asc, question_number asc")
respond_to do |format| respond_to do |format|
if params[:pdf] if params[:pdf]
format.html { render :layout => "pdf" } format.html { render :layout => "pdf" }

@ -314,7 +314,7 @@ module ExerciseHelper
all_questions = questions.where("question_type = 5") all_questions = questions.where("question_type = 5")
uncomplete_shixun = [] uncomplete_shixun = []
all_questions.each do |question| all_questions.each do |question|
myshixun = Myshixun.where(:shixun_id => question.shixun_id, :user_id => user.id).first myshixun = Myshixun.where(:shixun_id => question.shixun_id, :user_id => exercise_user.user_id).first
unless myshixun && myshixun.is_complete? unless myshixun && myshixun.is_complete?
uncomplete_shixun << question uncomplete_shixun << question
end end

@ -31,14 +31,12 @@ class Exercise < ActiveRecord::Base
def create_user_question_list exercise_user_id def create_user_question_list exercise_user_id
self.exercise_questions.where("question_type != 5").each do |question| self.exercise_questions.where("question_type != 5").each do |question|
self.exercise_user_questions << ExerciseUserQuestion.new(exercise_user_id: exercise_user_id, ExerciseUserQuestion.create(exercise_id: self.id, exercise_user_id: exercise_user_id, exercise_question_id: question.id)
exercise_question_id: question)
end end
self.exercise_level_settings.each do |setting| self.exercise_level_settings.each do |setting|
# 每个级别中随机挑选num个实训题 # 每个级别中随机挑选num个实训题
setting.exercise_questions.pluck(:id).sample(setting.num).each do |question_id| setting.exercise_questions.pluck(:id).sample(setting.num).each do |question_id|
self.exercise_user_questions << ExerciseUserQuestion.new(exercise_user_id: exercise_user_id, ExerciseUserQuestion.create(exercise_id: self.id, exercise_user_id: exercise_user_id, exercise_question_id: question_id)
exercise_question_id: question_id)
end end
end end
end end

@ -6,11 +6,11 @@ class ExerciseQuestion < ActiveRecord::Base
belongs_to :exercise belongs_to :exercise
belongs_to :shixun belongs_to :shixun
has_many :exercise_shixun_challenges, :order => "#{ExerciseShixunChallenge.table_name}.position",:dependent => :destroy has_many :exercise_shixun_challenges, :order => "#{ExerciseShixunChallenge.table_name}.position",:dependent => :destroy
has_many :exercise_shixun_answers, :dependent => :destroy has_many :exercise_shixun_answers
has_many :exercise_choices, :dependent => :destroy has_many :exercise_choices, :dependent => :destroy
has_many :exercise_answers, :dependent => :destroy has_many :exercise_answers
has_many :exercise_answer_comments, :dependent => :destroy has_many :exercise_answer_comments
has_many :exercise_standard_answers, :dependent => :destroy has_many :exercise_standard_answers
belongs_to :exercise_level_setting, counter_cache: true belongs_to :exercise_level_setting, counter_cache: true
has_many :exercise_user_questions, :dependent => :destroy has_many :exercise_user_questions, :dependent => :destroy
@ -29,4 +29,12 @@ class ExerciseQuestion < ActiveRecord::Base
"实训题" "实训题"
end end
end end
def ques_number index
question_number = self.question_number
if self.question_type == 5
question_number = exercise.exercise_questions.where("question_type != 5").count + index
end
question_number
end
end end

@ -2,7 +2,7 @@ class ExerciseShixunAnswer < ActiveRecord::Base
belongs_to :exercise_question belongs_to :exercise_question
belongs_to :user belongs_to :user
belongs_to :exercise_shixun_challenge belongs_to :exercise_shixun_challenge
has_many :exercise_answer_comments, :dependent => :destroy has_many :exercise_answer_comments
# status 0: 未通过, 1通过 # status 0: 未通过, 1通过
# attr_accessible :answer_text, :score, :status # attr_accessible :answer_text, :score, :status
end end

@ -161,9 +161,9 @@
</p> </p>
<% end %> <% end %>
</div> </div>
<% if exercise_question.question_type == 5 %> <%# if exercise_question.question_type == 5 %>
<p class="pl15 pr15 mb10"><%= exercise_question.shixun.name %></p> <!-- <p class="pl15 pr15 mb10"><%#= exercise_question.shixun.name %></p>-->
<% end %> <%# end %>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= sanitize exercise_question.question_title %></div> <div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= sanitize exercise_question.question_title %></div>
<% case exercise_question.question_type %> <% case exercise_question.question_type %>
<% when 1 %> <% when 1 %>

@ -76,9 +76,10 @@
</p> </p>
</div> </div>
<div class="clearfix ml80 mt10 mb5"> <div class="clearfix ml80 mt10 mb5">
<% exercise_questions.where(:question_type => [1, 2, 3, 5]).each do |eq| %> <% que_count = exercise_questions.where(:question_type => [1, 2, 3]).count %>
<% exercise_questions.where(:question_type => [1, 2, 3, 5]).each_with_index do |eq, index| %>
<% is_correct = answer_is_correct(eq, user) %> <% is_correct = answer_is_correct(eq, user) %>
<a href="javascript:void(0);" onclick="scroll_70height(<%= eq.question_number%>);" style="cursor:pointer" class="checkstatus_box_big color_white <%= is_correct ? 'post_btn_green' : 'post_btn_red' %>"><%= eq.question_number %></a> <a href="javascript:void(0);" onclick="scroll_70height(<%= eq.id %>);" style="cursor:pointer" class="checkstatus_box_big color_white <%= is_correct ? 'post_btn_green' : 'post_btn_red' %>"><%= eq.ques_number(index-que_count + 1) %></a>
<% end %> <% end %>
</div> </div>
<div class="clearfix"> <div class="clearfix">
@ -90,16 +91,16 @@
<div class="clearfix ml80 mt10"> <div class="clearfix ml80 mt10">
<% exercise_questions.where(:question_type => 4).each do |eq| %> <% exercise_questions.where(:question_type => 4).each do |eq| %>
<% ea = @exercise_user.user.exercise_answer.where(:exercise_question_id => eq.id).first %> <% ea = @exercise_user.user.exercise_answer.where(:exercise_question_id => eq.id).first %>
<a href="javascript:void(0);" onclick="scroll_70height(<%= eq.question_number%>);" style="cursor:pointer" id="ex_comment_status_<%= eq.id %>" class="checkstatus_box_big <%= (ea && ea.score == -1) ? 'post_btn_grey' : 'post_btn_white' %>"><%= eq.question_number %></a> <a href="javascript:void(0);" onclick="scroll_70height(<%= eq.id%>);" style="cursor:pointer" id="ex_comment_status_<%= eq.id %>" class="checkstatus_box_big <%= (ea && ea.score == -1) ? 'post_btn_grey' : 'post_btn_white' %>"><%= eq.question_number %></a>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="clearfix" id="problem_main"> <div class="clearfix" id="problem_main">
<% question_list = exercise_questions.includes(:exercise_shixun_answers, :exercise_choices => [:exercise_answers]) %> <% question_list = exercise_questions.includes(:exercise_shixun_answers, :exercise_choices => [:exercise_answers]) %>
<% question_list.each do |exercise_question| %> <% question_list.each_with_index do |exercise_question, index| %>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15"> <div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15"> <div class="clearfix pl15 pr15">
<p class="fl font-15" id="mao<%= exercise_question.question_number %>">第<%= exercise_question.question_number %> <p class="fl font-15" id="mao<%= exercise_question.id %>">第<%= index + 1 %>
题:<span class="color-orange03 ml10">[<%= exercise_question.question_type_name %> 题:<span class="color-orange03 ml10">[<%= exercise_question.question_type_name %>
]</span><span class="ml10"><%= exercise_question.question_score %> ]</span><span class="ml10"><%= exercise_question.question_score %>
分</span><span class="ml10 color-red"><%= question_commit_status exercise_question, @exercise_user.user %></span> 分</span><span class="ml10 color-red"><%= question_commit_status exercise_question, @exercise_user.user %></span>

@ -1,5 +1,5 @@
<% if @exercise.id %> <% if @exercise.id %>
<div nhname="new_exercise_mc_q"> <div>
<%= form_for('', <%= form_for('',
:html => { :multipart => true, :id => "new_shixun_question"}, :html => { :multipart => true, :id => "new_shixun_question"},
:url=>update_shixun_block_exercise_path(@exercise.id)) do |f| %> :url=>update_shixun_block_exercise_path(@exercise.id)) do |f| %>
@ -41,7 +41,7 @@
<div class="fl mt15 font-16 mb10 padding10 practicalTitlefont">实训题</div> <div class="fl mt15 font-16 mb10 padding10 practicalTitlefont">实训题</div>
<ul class="fl" id="ul"> <ul class="fl" id="shixun_question_ul">
<% for i in 1..4 %> <% for i in 1..4 %>
<% questions_list = @exercise.exercise_questions.where(question_type: 5, level: i) %> <% questions_list = @exercise.exercise_questions.where(question_type: 5, level: i) %>
@ -98,8 +98,8 @@
<li class="fl clearfix mb20 shixunsboxs"> <li class="fl clearfix mb20 shixunsboxs">
<p class="mr40"> <p class="mr40">
<a href="javascript:void(0)" class="fr task-btn task-btn-orange" id="add_new_question">保存</a> <a href="javascript:void(0)" class="fr task-btn task-btn-orange" id="add_new_shixun_question">保存</a>
<a href="javascript:void(0)" class="fr task-btn mr30" onclick="$('#show_shixun_questions').show(); $('#edit_shixun_questions').hide();">取消</a> <a href="<%= delete_choose_shixun_exercise_path(@exercise) %>" data-remote="true" data-method="delete" class="fr task-btn mr30">取消</a>
<span class=" fr font-12 color-grey mt5 mr25" style="display: block;"> <span class=" fr font-12 color-grey mt5 mr25" style="display: block;">
<span class="color-orange-tip ">温馨提示:</span>[实训题]属于客观题将由系统自动评分 <span class="color-orange-tip ">温馨提示:</span>[实训题]属于客观题将由系统自动评分
</span> </span>
@ -114,13 +114,14 @@
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
//保存 //保存
$("#add_new_question").one('click', function(){ $("#add_new_shixun_question").one('click', function(){
add_shixun_question(); add_shixun_question();
}); });
}); });
function add_shixun_question(){ function add_shixun_question(){
var result = true; var result = true;
var Uarry=$("#ul li:visible");//获取ul中所有的li元素 var Uarry=$("#shixun_question_ul li:visible");//获取ul中所有的li元素
for(var i = 1; i <= Uarry.length; i++){ for(var i = 1; i <= Uarry.length; i++){
@ -160,23 +161,20 @@
$("#topicinteger"+i).hide(); $("#topicinteger"+i).hide();
$("#topicreater"+i).hide(); $("#topicreater"+i).hide();
} }
} }
console.log(result); console.log(result);
if(result){ if(result){
$("#new_shixun_question").submit(); $("#new_shixun_question").submit();
} else{ } else{
$("#add_new_question").one('click', function(){ $("#add_new_shixun_question").one('click', function(){
add_shixun_question(); add_shixun_question();
}); });
} }
} }
function shixunboxdelete(num,key){ function shixunboxdelete(num,key){
var div=$("#shixunsbox"+num+" div");//获取所有子元素
$("#shixunsbox"+num+" div")[key].remove(); $("#shixunsbox"+num+" div")[key].remove();
$("#available"+num).html($("#shixunsbox"+num+" div").length); $("#available"+num).html($("#shixunsbox"+num+" div").length);
console.log($("#shixunsbox"+num+" div").length);
} }
</script> </script>

@ -1,5 +1,6 @@
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15"> <% if false %>
<div class="clearfix pl15 pr15"> <!--<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">-->
<!-- <div class="clearfix pl15 pr15">-->
<!-- <p class="fl font-15">第<%#= exercise_question.question_number %>题:<span class="color-orange03 ml10">[实训题]</span><span class="ml10"><%#= exercise_question.question_score %></span>分</p>--> <!-- <p class="fl font-15">第<%#= exercise_question.question_number %>题:<span class="color-orange03 ml10">[实训题]</span><span class="ml10"><%#= exercise_question.question_score %></span>分</p>-->
<%# if @exercise.exercise_status == 1 %> <%# if @exercise.exercise_status == 1 %>
<!-- <p class="fr exam_operator font-18">--> <!-- <p class="fr exam_operator font-18">-->
@ -26,6 +27,7 @@
<!-- <span class="fl ml20" style="display: block;"><%#= exercise_challenge.question_score %>分</span>--> <!-- <span class="fl ml20" style="display: block;"><%#= exercise_challenge.question_score %>分</span>-->
<!-- </li>--> <!-- </li>-->
<%# end %> <%# end %>
<% end %>
<div class="user_bg_shadow bor-grey-e mb20 answer_Temp edu-back-white practicalTemp <%= @exercise.has_shixun_questions? ? '' : 'none' %>"> <div class="user_bg_shadow bor-grey-e mb20 answer_Temp edu-back-white practicalTemp <%= @exercise.has_shixun_questions? ? '' : 'none' %>">
@ -34,7 +36,7 @@
<!-- 试卷列表不展示三个按钮--> <!-- 试卷列表不展示三个按钮-->
<% if @exercise.exercise_status == 1 %> <% if @exercise.exercise_status == 1 %>
<a href="javascript:void(0)" onclick="shixunQuestionEdit();"><i data-tip-down="编辑" class="fa fa-pencil color-orange05 fr mr10"></i></a> <a href="javascript:void(0)" onclick="shixunQuestionEdit();"><i data-tip-down="编辑" class="fa fa-pencil color-orange05 fr mr10"></i></a>
<a href="javascript:void(0)" onclick="delete_confirm_box('<%= delete_shixun_question_exercise_path(@exercise) %>', '确定要删除该题目吗?')"> <a href="javascript:void(0)" onclick="delete_confirm_box_2('<%= delete_shixun_question_exercise_path(@exercise) %>', '确定要删除所有的实训题吗?')">
<i data-tip-down="删除" class="fa fa-times-circle mr10 color-orange05 fr"></i> <i data-tip-down="删除" class="fa fa-times-circle mr10 color-orange05 fr"></i>
</a> </a>
<% end %> <% end %>
@ -75,12 +77,17 @@
</div> </div>
</div> <!-- </div>-->
</div> <!--</div>-->
<script> <script>
function shixunQuestionEdit(){ function shixunQuestionEdit(){
$("#show_shixun_questions").hide(); var forms = $("form.new_exercise_question");
$("#edit_shixun_questions").show(); if(forms.length > 0){
notice_box("请先保存正在编辑的题目再编辑。");
} else {
$("#show_shixun_questions").hide();
$("#edit_shixun_questions").show();
}
} }
</script> </script>

@ -0,0 +1,2 @@
$("#exercise_question_list").html("<%= escape_javascript(render :partial => 'exercise/exercise_content') %>");
$("#shixun_question_block").remove();

@ -1,2 +1,3 @@
$("#exercise_question_list").html("<%= escape_javascript(render :partial => 'exercise/exercise_content') %>"); $("#exercise_question_list").html("<%= escape_javascript(render :partial => 'exercise/exercise_content') %>");
$("#new_exercise_question").html('<%= escape_javascript(render :partial => 'new_question') %>');
$("#total_questions_score").html("<%= escape_javascript(render :partial => 'exercise/total_questions_score') %>"); $("#total_questions_score").html("<%= escape_javascript(render :partial => 'exercise/total_questions_score') %>");

@ -1,6 +1,2 @@
<% if @exercise.has_shixun_questions? %> $("#show_shixun_questions").hide();
$("#insert_new_poll_question_<%= params[:quest_id] %>").html("<%= escape_javascript(render :partial => 'new_shixun', :locals => {:exercise=>@exercise}) %>"); $("#edit_shixun_questions").html("<%= escape_javascript(render :partial => 'new_shixun') %>").show();
$("#quest_id").val(<%= params[:quest_id] %>);
<% else %>
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_shixun') %>");
<% end %>

@ -243,7 +243,7 @@
</div> </div>
<div class="clearfix"> <div class="clearfix">
<% @exercise.exercise_questions.includes(:exercise_choices, :exercise_standard_answers, exercise_shixun_challenges: :challenge).each_with_index do |exercise_question, i| %> <% @exercise.exercise_questions.where("question_type != 5").includes(:exercise_choices, :exercise_standard_answers, exercise_shixun_challenges: :challenge).each_with_index do |exercise_question, i| %>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15"> <div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15"> <div class="clearfix pl15 pr15">
<p class="fl font-15" id="mao<%= exercise_question.question_number %>">第<%= exercise_question.question_number %> <p class="fl font-15" id="mao<%= exercise_question.question_number %>">第<%= exercise_question.question_number %>
@ -328,19 +328,59 @@
}); });
</script> </script>
</div> </div>
<% when 5 %> <%# when 5 %>
<div class="pl15 pr15 pt10 pb10 bor-top-greyE"> <!-- <div class="pl15 pr15 pt10 pb10 bor-top-greyE">-->
<% exercise_question.exercise_shixun_challenges.each_with_index do |exercise_challenge, index| %> <%# exercise_question.exercise_shixun_challenges.each_with_index do |exercise_challenge, index| %>
<div class="clearfix"> <!-- <div class="clearfix">-->
<span class="fl">第<%= index + 1 %>关</span> <!-- <span class="fl">第<%#= index + 1 %>关</span>-->
<span class="fl task-hide ml20" style="display: block; max-width: 80%"><%= exercise_challenge.challenge.subject %></span> <!-- <span class="fl task-hide ml20" style="display: block; max-width: 80%"><%#= exercise_challenge.challenge.subject %></span>-->
<span class="fl ml20" style="display: block;"><%= exercise_challenge.question_score %>分</span> <!-- <span class="fl ml20" style="display: block;"><%#= exercise_challenge.question_score %>分</span>-->
</div> <!-- </div>-->
<% end %> <%# end %>
</div> <!-- </div>-->
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<div class="user_bg_shadow bor-grey-e mb20 answer_Temp edu-back-white practicalTemp <%= @exercise.has_shixun_questions? ? '' : 'none' %>">
<div class="fl mt15 font-16 mb10 padding10 practicalTitlefont">
<span class="colorFF8121s">[实训题]</span><%= @exercise.shixun_question_score %>分)
</div>
<ul class="fl">
<% for i in 1..4 %>
<% questions_list = @exercise.exercise_questions.where(question_type: 5, level: i) %>
<li class="<%= questions_list.try(:count).to_i > 0 ? '' : 'none' %>">
<div class="fl font-16 mb10 practicalTitle">
<span class="Titlefont"><%= shixun_question_level i %></span>
<div class="fr mr40 shixun-title-font">
分值:<%= @exercise.level_setting(i).try(:score) %> 分/题
</div>
<div class="fr mr40 shixun-title-font width200">
随机出题量:<%= @exercise.level_setting(i).try(:num) || questions_list.try(:count) %>
</div>
</div>
<div class="fl mb10 shixunsbox">
<% questions_list.each_with_index do |question| %>
<div>
<span class="shixunsboxfont"><%= question.question_title %></span>
<span class="shixundelect">
<a href="<%= shixun_path(question.shixun) %>" class="white-btn orange-btn fr mr20 mt3" target="_blank">+&nbsp;实训详情</a>
</span>
</div>
<% end %>
</div>
</li>
<% end %>
</ul>
</div>
</div> </div>
</div> </div>
</div> </div>

@ -1049,7 +1049,8 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'cancel_commit_confirm' get 'cancel_commit_confirm'
get 'adjust_question_score' get 'adjust_question_score'
post 'update_shixun_block' post 'update_shixun_block'
get 'delete_shixun_question' delete 'delete_shixun_question'
delete 'delete_choose_shixun'
end end
collection do #生成路径为 /exercise/方法名 collection do #生成路径为 /exercise/方法名

@ -1716,7 +1716,7 @@ function copy_course(url){
pop_box_new(htmlvalue, 550, 300); pop_box_new(htmlvalue, 550, 300);
} }
function new_shixun_exercise(id){ function new_shixun_exercise(){
if($("input[name='shixun_exercise[]']:checked").length == 0){ if($("input[name='shixun_exercise[]']:checked").length == 0){
$("#exercise_type_notice").show(); $("#exercise_type_notice").show();
} else{ } else{

Loading…
Cancel
Save