diff --git a/app/views/games/_choice_question.html.erb b/app/views/games/_choice_question.html.erb index 41aa897ae..badbf1536 100644 --- a/app/views/games/_choice_question.html.erb +++ b/app/views/games/_choice_question.html.erb @@ -14,30 +14,43 @@
<% @game_challenge.challenge_chooses.each_with_index do |choose, index| %>

<%= (index + 1).to_s + "." + (choose.category == 1 ? "单选题" : "多选题") %>

-
+
- <% choose.challenge_questions.each_with_index do |question, i| %> -

-                
-
" onclick=""> - - <% if choose.category == 1 %> - - <% else %> - - - <% end %> -
- <%= (question.position + 65).chr %>. +
+ <% choose.challenge_questions.each_with_index do |question, i| %> +

+ + <% if choose.category == 1 %> + + <% else %> + + + <% end %> + + +

+ <% end %> + +
+ <% end %> +

@@ -67,6 +80,30 @@ } }); }); + + $(function(){ + $(".problem_single p input").live("change",function(event){ + var $this=$(this).parents(".problem_single").find("input[name='user_answer']"); + var value=""; + if($(this).attr("category")=="1"){ + value=""; + //alert($(this).siblings("label").find("span").html()); + if($(this).attr("checked")=="checked"){ + value=$(this).siblings("label").find("span").html(); + } + }else{ + var p=$(this).parents(".problem_single").find("p"); + value=""; + for(var i=0;i< p.length;i++){ + if(p.eq(i).find("input").attr("checked")=="checked"){ + //alert(p.eq(i).find("input").siblings("label").find("span").html()); + value+=p.eq(i).find("input").siblings("label").find("span").html(); + } + } + } + $this.val(value); + }) + })