" +
- "<% 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%>" +
+ $("#new_poll_question").html("");
+ <%if @exercise_questions.question_type == 1%>
+ $("#mc_question_list").show().append("
" +
+ "
" +
+ "<%= escape_javascript(render :partial => 'show_MC', :locals => {:exercise_question => @exercise_questions}) %>" +
+ "
" +
+ "
" +
+ "<%= escape_javascript(render :partial => 'edit_MC', :locals => {:exercise_question => @exercise_questions}) %>" +
+ "
" +
+ "
");
+ <% end %>
+ <%if @exercise_questions.question_type == 2%>
+ $("#mcq_question_list").show().append("
" +
+ "
" +
+ "<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:exercise_question => @exercise_questions}) %>" +
+ "
" +
+ "
" +
+ "<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:exercise_question => @exercise_questions}) %>" +
+ "
" +
+ "
");
+ <% end %>
+ <%if @exercise_questions.question_type == 3%>
+ $("#single_question_list").show().append("
" +
+ "
" +
+ "<%= escape_javascript(render :partial => 'show_single', :locals => {:exercise_question => @exercise_questions}) %>" +
+ "
" +
+ "
" +
+ "<%= escape_javascript(render :partial => 'edit_single', :locals => {:exercise_question => @exercise_questions}) %>" +
+ "
" +
+ "
");
+ <% end %>
+/*$("#poll_content").append("
" +
+ "
" +
+ "<%# 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%>" +
"
" +
- "
" +
- "<% 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%>" +
+ "
" +
+ "<%# 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%>" +
"
" +
- "
");
+ "
");*/
$("#current_score").html("<%=get_current_score @exercise %>分");
+$("#current_score_div").show();
<% end %>
diff --git a/app/views/exercise/update_exercise_question.js.erb b/app/views/exercise/update_exercise_question.js.erb
index e69de29bb..0f0a23cec 100644
--- a/app/views/exercise/update_exercise_question.js.erb
+++ b/app/views/exercise/update_exercise_question.js.erb
@@ -0,0 +1,19 @@
+$("#poll_questions_<%= @exercise_question.id%>").html("
" +
+ "<% 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%>" +
+ "
" +
+ "
" +
+ "<% 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%>" +
+ "
");
+$("#current_score").html("<%=get_current_score @exercise %>分");