|
|
|
@ -61,7 +61,12 @@
|
|
|
|
|
|
|
|
|
|
function insert_MC(quest_type,quest_num,quest_id){
|
|
|
|
|
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
|
|
|
|
'<%#= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@exercise.id),:remote => true do |f|%>'+
|
|
|
|
|
'<%= form_for(ExerciseQuestion.new,
|
|
|
|
|
:html => { :multipart => true },
|
|
|
|
|
:url => {:controller => 'exercise',
|
|
|
|
|
:action => 'create_exercise_question',
|
|
|
|
|
:course_id => @course.id
|
|
|
|
|
},:remote=>true ) do |f|%>'+
|
|
|
|
|
' <div class="ur_editor radio"> '+
|
|
|
|
|
'<div class="ur_editor_title"> '+
|
|
|
|
|
'<label>问题: </label>'+
|
|
|
|
@ -76,21 +81,21 @@
|
|
|
|
|
'<ul>'+
|
|
|
|
|
'<li class="ur_item">'+
|
|
|
|
|
'<label>选项<span class="ur_index"></span>: </label>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="新建选项"/>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="输入选项内容"/>'+
|
|
|
|
|
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
|
|
|
|
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
|
|
|
|
'</li>'+
|
|
|
|
|
'<div class="cl"></div>'+
|
|
|
|
|
'<li class="ur_item">'+
|
|
|
|
|
'<label>选项<span class="ur_index"></span>: </label>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="新建选项"/>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="输入选项内容"/>'+
|
|
|
|
|
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
|
|
|
|
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
|
|
|
|
'</li>'+
|
|
|
|
|
'<div class="cl"></div>'+
|
|
|
|
|
'<li class="ur_item">'+
|
|
|
|
|
'<label>选项<span class="ur_index"></span>: </label>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="新建选项"/>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="输入选项内容"/>'+
|
|
|
|
|
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
|
|
|
|
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
|
|
|
|
'</li>'+
|
|
|
|
@ -107,7 +112,7 @@
|
|
|
|
|
'</div>'+
|
|
|
|
|
'<div class="cl"></div>'+
|
|
|
|
|
'</div>'+
|
|
|
|
|
'<%# end%>'
|
|
|
|
|
'<% end%>'
|
|
|
|
|
);
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
}
|
|
|
|
@ -119,7 +124,12 @@
|
|
|
|
|
|
|
|
|
|
function insert_MCQ(quest_type,quest_num,quest_id){
|
|
|
|
|
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
|
|
|
|
'<%#= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@exercise.id),:remote => true do |f|%>'+
|
|
|
|
|
'<%= form_for(ExerciseQuestion.new,
|
|
|
|
|
:html => { :multipart => true },
|
|
|
|
|
:url => {:controller => 'exercise',
|
|
|
|
|
:action => 'create_exercise_question',
|
|
|
|
|
:course_id => @course.id
|
|
|
|
|
},:remote=>true ) do |f|%>'+
|
|
|
|
|
'<div class="ur_editor checkbox">'+
|
|
|
|
|
'<div class="ur_editor_title">'+
|
|
|
|
|
'<label>问题: </label>'+
|
|
|
|
@ -134,21 +144,21 @@
|
|
|
|
|
'<ul>'+
|
|
|
|
|
'<li class="ur_item">'+
|
|
|
|
|
'<label>选项<span class="ur_index"></span>: </label>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="新建选项"/>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="输入选项内容"/>'+
|
|
|
|
|
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
|
|
|
|
'<a class="icon_remove" title="删除"" onclick="remove_single_answer($(this))"></a>'+
|
|
|
|
|
'</li>'+
|
|
|
|
|
'<div class="cl"></div>'+
|
|
|
|
|
'<li class="ur_item">'+
|
|
|
|
|
'<label>选项<span class="ur_index"></span>: </label>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="新建选项"/>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="输入选项内容"/>'+
|
|
|
|
|
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
|
|
|
|
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
|
|
|
|
'</li>'+
|
|
|
|
|
'<div class="cl"></div>'+
|
|
|
|
|
'<li class="ur_item">'+
|
|
|
|
|
'<label>选项<span class="ur_index"></span>: </label>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="新建选项"/>'+
|
|
|
|
|
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="输入选项内容"/>'+
|
|
|
|
|
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
|
|
|
|
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
|
|
|
|
'</li>'+
|
|
|
|
@ -165,7 +175,7 @@
|
|
|
|
|
'</div>'+
|
|
|
|
|
'<div class="cl"></div>'+
|
|
|
|
|
'</div>'+
|
|
|
|
|
'<%# end%>'
|
|
|
|
|
'<% end%>'
|
|
|
|
|
);
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
}
|
|
|
|
@ -177,7 +187,12 @@
|
|
|
|
|
|
|
|
|
|
function insert_SINGLE(quest_type,quest_num,quest_id){
|
|
|
|
|
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
|
|
|
|
'<%#= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@exercise.id),:remote => true do |f|%>'+
|
|
|
|
|
'<%= form_for(ExerciseQuestion.new,
|
|
|
|
|
:html => { :multipart => true },
|
|
|
|
|
:url => {:controller => 'exercise',
|
|
|
|
|
:action => 'create_exercise_question',
|
|
|
|
|
:course_id => @course.id
|
|
|
|
|
},:remote=>true ) do |f|%>'+
|
|
|
|
|
'<div class="ur_editor text ">'+
|
|
|
|
|
'<div class="ur_editor_title">'+
|
|
|
|
|
'<label for="ur_question_title">问题: </label>'+
|
|
|
|
@ -198,7 +213,7 @@
|
|
|
|
|
'</div>'+
|
|
|
|
|
'<div class="cl"></div>'+
|
|
|
|
|
'</div>'+
|
|
|
|
|
'<%# end%>'
|
|
|
|
|
'<% end%>'
|
|
|
|
|
);
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
}
|
|
|
|
@ -274,7 +289,7 @@
|
|
|
|
|
//单选题
|
|
|
|
|
function add_single_answer(doc)
|
|
|
|
|
{
|
|
|
|
|
doc.parent().after("<li class='ur_item'><label>选项<span class='ur_index'></span>: </label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='新建选项'/>" +
|
|
|
|
|
doc.parent().after("<li class='ur_item'><label>选项<span class='ur_index'></span>: </label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='输入选项内容'/>" +
|
|
|
|
|
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a><a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
|
|
|
|
|
"</li><div class='cl'></div>");
|
|
|
|
|
}
|
|
|
|
@ -319,7 +334,8 @@
|
|
|
|
|
<div id="polls_head_edit">
|
|
|
|
|
<%= render :partial => 'edit_head', :locals => {:exercise => @exercise}%>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mb5" style="display: none">目前试卷总分:<span class="c_red">20分</span></div>
|
|
|
|
|
<% current_score = get_current_score @exercise %>
|
|
|
|
|
<div class="mb5" style="display: <%= current_score == 0 ? "none" : "" %>">目前试卷总分:<span class="c_red" id="current_score"><%=current_score %>分</span></div>
|
|
|
|
|
<!-- 问题 -->
|
|
|
|
|
<div id="poll_content">
|
|
|
|
|
<%= render :partial => 'exercise_content', :locals => {:exercise => @exercise}%>
|
|
|
|
|