2015-11-18 14:05:29 +08:00
|
|
|
<% if @is_insert %>
|
|
|
|
$("#poll_content").html('<%= escape_javascript(render :partial => 'exercise_content', :locals => {:exercise => @exercise})%>');
|
|
|
|
<% else %>
|
|
|
|
$("#new_poll_question").html("");
|
|
|
|
|
|
|
|
$("#poll_content").append("<div id='poll_questions_<%= @exercise_questions.id%>'>" +
|
|
|
|
"<div id='show_poll_questions_<%= @exercise_questions.id %>'>" +
|
|
|
|
"<% if @exercise_questions.question_type == 1%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"<% elsif @exercise_questions.question_type == 2%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"<% elsif @exercise_questions.question_type == 3%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'show_single', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"<% end%>" +
|
|
|
|
"</div>" +
|
|
|
|
"<div id='edit_poll_questions_<%= @exercise_questions.id %>' style='display: none;'>" +
|
|
|
|
"<% if @exercise_questions.question_type == 1%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"<% elsif @exercise_questions.question_type == 2%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"<% elsif @exercise_questions.question_type == 3%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"<% end%>" +
|
|
|
|
"</div>" +
|
|
|
|
"</div>");
|
2015-11-18 15:30:39 +08:00
|
|
|
$("#current_score").html("<%=get_current_score @exercise %>分");
|
2015-11-18 14:05:29 +08:00
|
|
|
<% end %>
|