2015-11-18 20:14:19 +08:00
|
|
|
$("#poll_questions_<%= @exercise_question.id%>").html("<div id='show_poll_questions_<%= @exercise_question.id %>'>" +
|
|
|
|
"<% if @exercise_question.question_type == 1%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:exercise_question => @exercise_question}) %>" +
|
|
|
|
"<% elsif @exercise_question.question_type == 2%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:exercise_question => @exercise_question}) %>" +
|
|
|
|
"<% elsif @exercise_question.question_type == 3%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'show_single', :locals => {:exercise_question => @exercise_question}) %>" +
|
|
|
|
"<% end%>" +
|
|
|
|
"</div>" +
|
|
|
|
"<div id='edit_poll_questions_<%= @exercise_question.id %>' style='display: none;'>" +
|
|
|
|
"<% if @exercise_question.question_type == 1%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:exercise_question => @exercise_question}) %>" +
|
|
|
|
"<% elsif @exercise_question.question_type == 2%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:exercise_question => @exercise_question}) %>" +
|
|
|
|
"<% elsif @exercise_question.question_type == 3%>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:exercise_question => @exercise_question}) %>" +
|
|
|
|
"<% end%>" +
|
|
|
|
"</div>");
|
2015-11-20 19:59:05 +08:00
|
|
|
$("#current_score").html("<%=get_current_score @exercise_question.exercise %>分");
|
2015-11-19 21:19:18 +08:00
|
|
|
$("#exercise_submit").html("<%= escape_javascript(render :partial => 'exercise_submit', :locals => {:exercise => @exercise_question.exercise}) %>");
|