This commit is contained in:
cxt 2015-11-19 17:50:24 +08:00
parent 27c88fda4f
commit d91a6c03b1
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" + $("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
"<li class='ur_item'>" + "<li class='ur_item'>" +
"<label>选项<%=convert_to_char (index+1).to_s %><span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>" + "<label>选项<%=convert_to_char (index+1).to_s %><span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>" +
"<input maxlength='200' type='text' name='question_answer[0]' placeholder='输入选项内容' value='<%=exercise_choice.choice_text %>'/>" + "<input maxlength='200' type='text' name='question_answer[<%=exercise_choice.id %>]' placeholder='输入选项内容' value='<%=exercise_choice.choice_text %>'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" + "<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" + "<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
"</li>" + "</li>" +

View File

@ -5,10 +5,10 @@
{ {
$("#poll_questions_title_<%=exercise_question.id%>").val("<%= exercise_question.question_title%>") $("#poll_questions_title_<%=exercise_question.id%>").val("<%= exercise_question.question_title%>")
$("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>") $("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>")
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %> %>" + $("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>" +
"<li class='ur_item'>" + "<li class='ur_item'>" +
"<label>候选答案<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>" + "<label>候选答案<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>" +
"<input name='exercise_choice[<%=index %>]' placeholder='请输入候选答案' type='text' value='<%=exercise_choice.answer_text %>'/>" + "<input name='exercise_choice[<%=exercise_choice.id %>]' placeholder='请输入候选答案' type='text' value='<%=exercise_choice.answer_text %>'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_candidate_answer($(this));'></a>" + "<a class='icon_add' title='向下插入选项' onclick='add_candidate_answer($(this));'></a>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" + "<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +