|
|
|
@ -51,8 +51,8 @@ function chooseQuestionType(quest_type,quest_id){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function add_MC(){
|
|
|
|
|
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>");
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
$("#new_poll_question_new").html("<%= escape_javascript(render :partial => 'new_MC') %>");
|
|
|
|
|
$("#poll_questions_title_new").focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function insert_MC(quest_type,quest_num,quest_id){
|
|
|
|
@ -94,7 +94,7 @@ function add_MC(){
|
|
|
|
|
'</ul>'+
|
|
|
|
|
'</div>'+
|
|
|
|
|
'<div class="ur_editor_footer">'+
|
|
|
|
|
'<a class="btn btn_dark btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
|
|
|
|
'<a class="btn btn_dark btn_submit c_white" data-button="ok" id="add_new_question">'+
|
|
|
|
|
'<%= l(:label_button_ok)%>'+
|
|
|
|
|
'</a>'+
|
|
|
|
|
'<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
|
|
|
@ -106,11 +106,14 @@ function add_MC(){
|
|
|
|
|
'<% end%>'
|
|
|
|
|
);
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
$("#add_new_question").one('click', function(){
|
|
|
|
|
add_poll_question($(this));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function add_MCQ(){
|
|
|
|
|
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ') %>");
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
$("#new_poll_question_new").html("<%= escape_javascript(render :partial => 'new_MCQ') %>");
|
|
|
|
|
$("#poll_questions_title_new").focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function insert_MCQ(quest_type,quest_num,quest_id){
|
|
|
|
@ -152,7 +155,7 @@ function insert_MCQ(quest_type,quest_num,quest_id){
|
|
|
|
|
'</ul>'+
|
|
|
|
|
'</div>'+
|
|
|
|
|
'<div class="ur_editor_footer">'+
|
|
|
|
|
'<a class="btn btn_dark btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
|
|
|
|
'<a class="btn btn_dark btn_submit c_white" data-button="ok" id="add_new_question">'+
|
|
|
|
|
'<%= l(:label_button_ok)%>'+
|
|
|
|
|
'</a>'+
|
|
|
|
|
'<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
|
|
|
@ -164,11 +167,14 @@ function insert_MCQ(quest_type,quest_num,quest_id){
|
|
|
|
|
'<% end%>'
|
|
|
|
|
);
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
$("#add_new_question").one('click', function(){
|
|
|
|
|
add_poll_question($(this));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function add_single(){
|
|
|
|
|
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single') %>");
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
$("#new_poll_question_new").html("<%= escape_javascript(render :partial => 'new_single') %>");
|
|
|
|
|
$("#poll_questions_title_new").focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function insert_SINGLE(quest_type,quest_num,quest_id){
|
|
|
|
@ -185,7 +191,7 @@ function insert_MCQ(quest_type,quest_num,quest_id){
|
|
|
|
|
'<label for="ur_question_require">必答</label>'+
|
|
|
|
|
'</div>'+
|
|
|
|
|
'<div class="ur_editor_footer">'+
|
|
|
|
|
'<a class="btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
|
|
|
|
'<a class="btn_submit c_white" data-button="ok" id="add_new_question">'+
|
|
|
|
|
'<%= l(:label_button_ok)%>'+
|
|
|
|
|
'</a>'+
|
|
|
|
|
'<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
|
|
|
@ -197,10 +203,13 @@ function insert_MCQ(quest_type,quest_num,quest_id){
|
|
|
|
|
'<% end%>'
|
|
|
|
|
);
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
$("#add_new_question").one('click', function(){
|
|
|
|
|
add_poll_question($(this));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
function add_mulit(){
|
|
|
|
|
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>");
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
$("#new_poll_question_new").html("<%= escape_javascript(render :partial => 'new_mulit') %>");
|
|
|
|
|
$("#poll_questions_title_new").focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function insert_MULIT(quest_type,quest_num,quest_id){
|
|
|
|
@ -219,7 +228,7 @@ function insert_MCQ(quest_type,quest_num,quest_id){
|
|
|
|
|
'<div class="ur_editor_toolbar">'+
|
|
|
|
|
'</div>'+
|
|
|
|
|
'<div class="ur_editor_footer">'+
|
|
|
|
|
'<a class="btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
|
|
|
|
'<a class="btn_submit c_white" data-button="ok" id="add_new_question">'+
|
|
|
|
|
'<%= l(:label_button_ok)%>'+
|
|
|
|
|
'</a>'+
|
|
|
|
|
'<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
|
|
|
@ -231,6 +240,9 @@ function insert_MCQ(quest_type,quest_num,quest_id){
|
|
|
|
|
'<% end%>'
|
|
|
|
|
);
|
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
|
$("#add_new_question").one('click', function(){
|
|
|
|
|
add_poll_question($(this));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//选择导入调查问卷
|
|
|
|
@ -262,8 +274,28 @@ function insert_MCQ(quest_type,quest_num,quest_id){
|
|
|
|
|
function add_poll_question(doc)
|
|
|
|
|
{
|
|
|
|
|
var title = $.trim($("#poll_questions_title").val());
|
|
|
|
|
if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();}
|
|
|
|
|
if(title.length == 0){
|
|
|
|
|
alert("标题不能为空");
|
|
|
|
|
doc.one('click', function(){
|
|
|
|
|
add_poll_question($(this));
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
doc.parent().parent().parent().submit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function add_poll_question_new(doc)
|
|
|
|
|
{
|
|
|
|
|
var title = $.trim($("#poll_questions_title_new").val());
|
|
|
|
|
if(title.length == 0){
|
|
|
|
|
alert("标题不能为空");
|
|
|
|
|
doc.one('click', function(){
|
|
|
|
|
add_poll_question($(this));
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
doc.parent().parent().parent().submit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//修改标题时确定按钮
|
|
|
|
|
function edit_poll_question(doc,id)
|
|
|
|
|
{
|
|
|
|
@ -373,7 +405,7 @@ function insert_MCQ(quest_type,quest_num,quest_id){
|
|
|
|
|
</div><!--选项 end-->
|
|
|
|
|
|
|
|
|
|
<!-- 新增问题 -->
|
|
|
|
|
<div id="new_poll_question">
|
|
|
|
|
<div id="new_poll_question_new">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="ur_buttons">
|
|
|
|
|