2015-11-18 14:05:29 +08:00
|
|
|
<% if @is_insert %>
|
2015-11-18 20:14:19 +08:00
|
|
|
$("#poll_content").html('<%= escape_javascript(render :partial => 'exercise_content', :locals => {:exercise => @exercise})%>');
|
2015-11-19 17:18:58 +08:00
|
|
|
$("#exercise_submit").html("<%= escape_javascript(render :partial => 'exercise_submit', :locals => {:exercise => @exercise}) %>");
|
2015-11-20 19:59:05 +08:00
|
|
|
$("#current_score_div").show();
|
|
|
|
$("#current_score").html("<%=get_current_score @exercise %>分");
|
2015-11-18 14:05:29 +08:00
|
|
|
<% else %>
|
2015-11-19 11:37:49 +08:00
|
|
|
$("#new_exercise_question").html('<%= escape_javascript(render :partial => 'new_question', :locals => {:exercise => @exercise}) %>');
|
2015-11-18 20:14:19 +08:00
|
|
|
$("#new_poll_question").html("");
|
2015-11-19 17:18:58 +08:00
|
|
|
$("#exercise_submit").html("<%= escape_javascript(render :partial => 'exercise_submit', :locals => {:exercise => @exercise}) %>");
|
2015-11-18 20:14:19 +08:00
|
|
|
<%if @exercise_questions.question_type == 1%>
|
|
|
|
$("#mc_question_list").show().append("<div id='poll_questions_<%= @exercise_questions.id%>'>" +
|
|
|
|
"<div id='show_poll_questions_<%= @exercise_questions.id %>'>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"</div>" +
|
|
|
|
"<div id='edit_poll_questions_<%= @exercise_questions.id %>' style='display: none;'>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"</div>" +
|
|
|
|
"</div>");
|
|
|
|
<% end %>
|
|
|
|
<%if @exercise_questions.question_type == 2%>
|
|
|
|
$("#mcq_question_list").show().append("<div id='poll_questions_<%= @exercise_questions.id%>'>" +
|
|
|
|
"<div id='show_poll_questions_<%= @exercise_questions.id %>'>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"</div>" +
|
|
|
|
"<div id='edit_poll_questions_<%= @exercise_questions.id %>' style='display: none;'>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"</div>" +
|
|
|
|
"</div>");
|
|
|
|
<% end %>
|
|
|
|
<%if @exercise_questions.question_type == 3%>
|
|
|
|
$("#single_question_list").show().append("<div id='poll_questions_<%= @exercise_questions.id%>'>" +
|
|
|
|
"<div id='show_poll_questions_<%= @exercise_questions.id %>'>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'show_single', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"</div>" +
|
|
|
|
"<div id='edit_poll_questions_<%= @exercise_questions.id %>' style='display: none;'>" +
|
|
|
|
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:exercise_question => @exercise_questions}) %>" +
|
|
|
|
"</div>" +
|
|
|
|
"</div>");
|
|
|
|
<% end %>
|
|
|
|
$("#current_score_div").show();
|
2015-11-20 19:59:05 +08:00
|
|
|
$("#current_score").html("<%=get_current_score @exercise %>分");
|
2015-11-18 14:05:29 +08:00
|
|
|
<% end %>
|