Identify correct answer from list?How do I call controller/view methods from the console in Rails?Rails: Check output of path helper from consoleHow to remove a key from Hash and get the remaining hash in Ruby/Rails?Why do people use Heroku when AWS is present? What distinguishes Heroku from AWS?model attribute is undefined method for active record relationActive record wont save for some reasonRails 4: List of available datatypesArray.count with block does not return correct answerAllow user to choose correct answer with accepts_nested_attributes_for?Function for ranking cards by number and adjusting ranks
Modern approach to radio buttons
How does one "dump" or deplete propellant without changing spacecraft attitude or trajectory?
Uncommanded roll at high speed
Could IPv6 make NAT / port numbers redundant?
Get LaTeX form from step by step solution
Can you move on your turn, and then use the Ready Action to move again on another creature's turn?
Infinitely many hats
What does the word 「ごねだした」 mean?
Where can I find the list of all tendons in the human body?
What are the slash markings on Gatwick's 08R/26L?
What are the problems in teaching guitar via Skype?
Can I install a row of bricks on a slab to support a shed?
I think I may have violated academic integrity last year - what should I do?
Writing the notation when gates act on non successive registers
Strange math syntax in old basic listing
How do I spend money in the US?
Draw a checker pattern with a black X in the center
Can a wire having a 610-670 THz (frequency of blue light) AC frequency supply, generate blue light?
How can I grammatically understand "Wir über uns"?
Thousands and thousands of words
Why would Lupin kill Pettigrew?
Is there an explanation for Austria's Freedom Party virtually retaining its vote share despite recent scandal?
Rotated Position of Integers
Why does the UK have more political parties than the US?
Identify correct answer from
How do I call controller/view methods from the console in Rails?Rails: Check output of path helper from consoleHow to remove a key from Hash and get the remaining hash in Ruby/Rails?Why do people use Heroku when AWS is present? What distinguishes Heroku from AWS?model attribute is undefined method for active record relationActive record wont save for some reasonRails 4: List of available datatypesArray.count with block does not return correct answerAllow user to choose correct answer with accepts_nested_attributes_for?Function for ranking cards by number and adjusting ranks
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have questions which have five choices of which one is TRUE for choices.is_correct.
I currently have an ERB loop displaying the question and possible answer choices, with choices randomize in an ordered list (<li>).
In a separate ERB loop, I need to display the correct answer in the form of it's respective <li> label (A,B,C,D or E).
I feel like this might be possible through some sort of local variable, but none of my tests are working so far. Should local variables work, or am I approaching from the wrong perspective?
My current ERB for the question / answer section:
<% @free_questions.each_with_index do |question, i| %>
<div class="row justify-content-center">
<div class="col-lg-10">
<% @a = ("a".."z").to_a %>
<h5>Question <%= i+1 %>: <%= question.name %></h5>
<p>
<ol type="A">
<% @free_choices.where(question: question.id).sort_byrand.each do |choice| %>
<li><%= choice.name %></li>
<% end %><br />
</ol>
</p>
<% @free_choices.where(question: question.id, correct: TRUE).each do |choice| %>
<div class="accordion" id="accordionExample">
<% if choice.question.context.present? or choice.question.image.attached? %>
<div class="card">
<div class="card-header" id="headingC<%= i+1 %>">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseC<%= i+1 %>" aria-expanded="true" aria-controls="collapseC<%= i+1 %>">
CLICK FOR QUESTION CONTEXT
</button>
</h5>
</div>
<div id="collapseC<%= i+1 %>" class="collapse" aria-labelledby="headingC<%= i+1 %>" data-parent="#accordionExample">
<div class="card-body">
<p>
<% if choice.question.image.attached? %>
<img src="<%= url_for(choice.question.image) if choice.question.image.attached? %>" class="rounded float-center" alt="context image for this question">
<% end %>
<!--TODO: Add more useful image alts here-->
<%= simple_format(choice.question.context) %>
</p>
</div>
</div>
</div>
<% end %>
<div class="card">
<div class="card-header" id="headingA<%= i+1 %>">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseA<%= i+1 %>" aria-expanded="true" aria-controls="collapseA<%= i+1 %>">
CLICK FOR ANSWER
</button>
</h5>
</div>
<div id="collapseA<%= i+1 %>" class="collapse" aria-labelledby="headingA<%= i+1 %>" data-parent="#accordionExample">
<div class="card-body">
<p>
Correct Answer: <b><%= choice.name %></b>
</p>
<p>
Explanation: <%= raw(choice.question.explanation) %>
</p>
</div>
</div>
</div>
</div>
<% end %>
<hr />
</div>
</div>
<% end %>
EDIT: Adding the models below
question.rb
class Question < ApplicationRecord
before_validation :assign_questionable
belongs_to :questionable, polymorphic: true
has_many :choices, :dependent => :destroy
accepts_nested_attributes_for :choices, allow_destroy: true
choice.rb
class Choice < ApplicationRecord
belongs_to :question
ruby-on-rails
add a comment |
I have questions which have five choices of which one is TRUE for choices.is_correct.
I currently have an ERB loop displaying the question and possible answer choices, with choices randomize in an ordered list (<li>).
In a separate ERB loop, I need to display the correct answer in the form of it's respective <li> label (A,B,C,D or E).
I feel like this might be possible through some sort of local variable, but none of my tests are working so far. Should local variables work, or am I approaching from the wrong perspective?
My current ERB for the question / answer section:
<% @free_questions.each_with_index do |question, i| %>
<div class="row justify-content-center">
<div class="col-lg-10">
<% @a = ("a".."z").to_a %>
<h5>Question <%= i+1 %>: <%= question.name %></h5>
<p>
<ol type="A">
<% @free_choices.where(question: question.id).sort_byrand.each do |choice| %>
<li><%= choice.name %></li>
<% end %><br />
</ol>
</p>
<% @free_choices.where(question: question.id, correct: TRUE).each do |choice| %>
<div class="accordion" id="accordionExample">
<% if choice.question.context.present? or choice.question.image.attached? %>
<div class="card">
<div class="card-header" id="headingC<%= i+1 %>">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseC<%= i+1 %>" aria-expanded="true" aria-controls="collapseC<%= i+1 %>">
CLICK FOR QUESTION CONTEXT
</button>
</h5>
</div>
<div id="collapseC<%= i+1 %>" class="collapse" aria-labelledby="headingC<%= i+1 %>" data-parent="#accordionExample">
<div class="card-body">
<p>
<% if choice.question.image.attached? %>
<img src="<%= url_for(choice.question.image) if choice.question.image.attached? %>" class="rounded float-center" alt="context image for this question">
<% end %>
<!--TODO: Add more useful image alts here-->
<%= simple_format(choice.question.context) %>
</p>
</div>
</div>
</div>
<% end %>
<div class="card">
<div class="card-header" id="headingA<%= i+1 %>">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseA<%= i+1 %>" aria-expanded="true" aria-controls="collapseA<%= i+1 %>">
CLICK FOR ANSWER
</button>
</h5>
</div>
<div id="collapseA<%= i+1 %>" class="collapse" aria-labelledby="headingA<%= i+1 %>" data-parent="#accordionExample">
<div class="card-body">
<p>
Correct Answer: <b><%= choice.name %></b>
</p>
<p>
Explanation: <%= raw(choice.question.explanation) %>
</p>
</div>
</div>
</div>
</div>
<% end %>
<hr />
</div>
</div>
<% end %>
EDIT: Adding the models below
question.rb
class Question < ApplicationRecord
before_validation :assign_questionable
belongs_to :questionable, polymorphic: true
has_many :choices, :dependent => :destroy
accepts_nested_attributes_for :choices, allow_destroy: true
choice.rb
class Choice < ApplicationRecord
belongs_to :question
ruby-on-rails
Can you please share source of Question and Choice Models as well?
– Amit Patel
Mar 24 at 10:15
Sure thing - added the models
– Antonio Fergesi
Mar 24 at 10:34
add a comment |
I have questions which have five choices of which one is TRUE for choices.is_correct.
I currently have an ERB loop displaying the question and possible answer choices, with choices randomize in an ordered list (<li>).
In a separate ERB loop, I need to display the correct answer in the form of it's respective <li> label (A,B,C,D or E).
I feel like this might be possible through some sort of local variable, but none of my tests are working so far. Should local variables work, or am I approaching from the wrong perspective?
My current ERB for the question / answer section:
<% @free_questions.each_with_index do |question, i| %>
<div class="row justify-content-center">
<div class="col-lg-10">
<% @a = ("a".."z").to_a %>
<h5>Question <%= i+1 %>: <%= question.name %></h5>
<p>
<ol type="A">
<% @free_choices.where(question: question.id).sort_byrand.each do |choice| %>
<li><%= choice.name %></li>
<% end %><br />
</ol>
</p>
<% @free_choices.where(question: question.id, correct: TRUE).each do |choice| %>
<div class="accordion" id="accordionExample">
<% if choice.question.context.present? or choice.question.image.attached? %>
<div class="card">
<div class="card-header" id="headingC<%= i+1 %>">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseC<%= i+1 %>" aria-expanded="true" aria-controls="collapseC<%= i+1 %>">
CLICK FOR QUESTION CONTEXT
</button>
</h5>
</div>
<div id="collapseC<%= i+1 %>" class="collapse" aria-labelledby="headingC<%= i+1 %>" data-parent="#accordionExample">
<div class="card-body">
<p>
<% if choice.question.image.attached? %>
<img src="<%= url_for(choice.question.image) if choice.question.image.attached? %>" class="rounded float-center" alt="context image for this question">
<% end %>
<!--TODO: Add more useful image alts here-->
<%= simple_format(choice.question.context) %>
</p>
</div>
</div>
</div>
<% end %>
<div class="card">
<div class="card-header" id="headingA<%= i+1 %>">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseA<%= i+1 %>" aria-expanded="true" aria-controls="collapseA<%= i+1 %>">
CLICK FOR ANSWER
</button>
</h5>
</div>
<div id="collapseA<%= i+1 %>" class="collapse" aria-labelledby="headingA<%= i+1 %>" data-parent="#accordionExample">
<div class="card-body">
<p>
Correct Answer: <b><%= choice.name %></b>
</p>
<p>
Explanation: <%= raw(choice.question.explanation) %>
</p>
</div>
</div>
</div>
</div>
<% end %>
<hr />
</div>
</div>
<% end %>
EDIT: Adding the models below
question.rb
class Question < ApplicationRecord
before_validation :assign_questionable
belongs_to :questionable, polymorphic: true
has_many :choices, :dependent => :destroy
accepts_nested_attributes_for :choices, allow_destroy: true
choice.rb
class Choice < ApplicationRecord
belongs_to :question
ruby-on-rails
I have questions which have five choices of which one is TRUE for choices.is_correct.
I currently have an ERB loop displaying the question and possible answer choices, with choices randomize in an ordered list (<li>).
In a separate ERB loop, I need to display the correct answer in the form of it's respective <li> label (A,B,C,D or E).
I feel like this might be possible through some sort of local variable, but none of my tests are working so far. Should local variables work, or am I approaching from the wrong perspective?
My current ERB for the question / answer section:
<% @free_questions.each_with_index do |question, i| %>
<div class="row justify-content-center">
<div class="col-lg-10">
<% @a = ("a".."z").to_a %>
<h5>Question <%= i+1 %>: <%= question.name %></h5>
<p>
<ol type="A">
<% @free_choices.where(question: question.id).sort_byrand.each do |choice| %>
<li><%= choice.name %></li>
<% end %><br />
</ol>
</p>
<% @free_choices.where(question: question.id, correct: TRUE).each do |choice| %>
<div class="accordion" id="accordionExample">
<% if choice.question.context.present? or choice.question.image.attached? %>
<div class="card">
<div class="card-header" id="headingC<%= i+1 %>">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseC<%= i+1 %>" aria-expanded="true" aria-controls="collapseC<%= i+1 %>">
CLICK FOR QUESTION CONTEXT
</button>
</h5>
</div>
<div id="collapseC<%= i+1 %>" class="collapse" aria-labelledby="headingC<%= i+1 %>" data-parent="#accordionExample">
<div class="card-body">
<p>
<% if choice.question.image.attached? %>
<img src="<%= url_for(choice.question.image) if choice.question.image.attached? %>" class="rounded float-center" alt="context image for this question">
<% end %>
<!--TODO: Add more useful image alts here-->
<%= simple_format(choice.question.context) %>
</p>
</div>
</div>
</div>
<% end %>
<div class="card">
<div class="card-header" id="headingA<%= i+1 %>">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseA<%= i+1 %>" aria-expanded="true" aria-controls="collapseA<%= i+1 %>">
CLICK FOR ANSWER
</button>
</h5>
</div>
<div id="collapseA<%= i+1 %>" class="collapse" aria-labelledby="headingA<%= i+1 %>" data-parent="#accordionExample">
<div class="card-body">
<p>
Correct Answer: <b><%= choice.name %></b>
</p>
<p>
Explanation: <%= raw(choice.question.explanation) %>
</p>
</div>
</div>
</div>
</div>
<% end %>
<hr />
</div>
</div>
<% end %>
EDIT: Adding the models below
question.rb
class Question < ApplicationRecord
before_validation :assign_questionable
belongs_to :questionable, polymorphic: true
has_many :choices, :dependent => :destroy
accepts_nested_attributes_for :choices, allow_destroy: true
choice.rb
class Choice < ApplicationRecord
belongs_to :question
ruby-on-rails
ruby-on-rails
edited Mar 24 at 10:34
Antonio Fergesi
asked Mar 24 at 9:34
Antonio FergesiAntonio Fergesi
595
595
Can you please share source of Question and Choice Models as well?
– Amit Patel
Mar 24 at 10:15
Sure thing - added the models
– Antonio Fergesi
Mar 24 at 10:34
add a comment |
Can you please share source of Question and Choice Models as well?
– Amit Patel
Mar 24 at 10:15
Sure thing - added the models
– Antonio Fergesi
Mar 24 at 10:34
Can you please share source of Question and Choice Models as well?
– Amit Patel
Mar 24 at 10:15
Can you please share source of Question and Choice Models as well?
– Amit Patel
Mar 24 at 10:15
Sure thing - added the models
– Antonio Fergesi
Mar 24 at 10:34
Sure thing - added the models
– Antonio Fergesi
Mar 24 at 10:34
add a comment |
1 Answer
1
active
oldest
votes
Here I am outlining quick fix
- replace
<% @a = ("a".."z").to_a %>with<% alpha_numbers = ("A".."Z").to_a %>. You are using<ol type="A">which prints list in upper case latter not in small case. - Move above snippet outside
@free_questions.each_with_indexloop so that you don't end up initializing same array for each question in loop. - Replace
@free_choices.where(question: question.id).sort_byrand.each do |choice|withquestion.choices.shuffle.each_with_index do |choice, index|. As per the model relationship,question.choiceswill give same result as@free_choices.where(question: question.id).shuffleis better way of doingsort_byrand. - In the
Choicemodel, addattr_accessor :alpha_order. This will create accessor methods. - Above
<li><%= choice.name %></li>line add<% choice.alpha_order = alpha_numbers[index] %>. This line sets current alphabetic order of choice in an instance variable. - Replace
@free_choices.where(question: question.id, correct: TRUE).each do |choice|withquestion.choices.select choice.is_correct .each do. This will loop through only those choices for givenquestionwhereis_correctistrue. - If you want to get alphabetic number attached to choice, access it using
choice.alpha_orderwhich will give correct alpha order.
Hope this helps.
You're a legend, thanks for including details about why it does what also! I've implemented, and it's working great. :)
– Antonio Fergesi
Mar 24 at 12:23
That's nice. Thanks!
– Amit Patel
Mar 25 at 4:25
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55322403%2fidentify-correct-answer-from-li-list%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here I am outlining quick fix
- replace
<% @a = ("a".."z").to_a %>with<% alpha_numbers = ("A".."Z").to_a %>. You are using<ol type="A">which prints list in upper case latter not in small case. - Move above snippet outside
@free_questions.each_with_indexloop so that you don't end up initializing same array for each question in loop. - Replace
@free_choices.where(question: question.id).sort_byrand.each do |choice|withquestion.choices.shuffle.each_with_index do |choice, index|. As per the model relationship,question.choiceswill give same result as@free_choices.where(question: question.id).shuffleis better way of doingsort_byrand. - In the
Choicemodel, addattr_accessor :alpha_order. This will create accessor methods. - Above
<li><%= choice.name %></li>line add<% choice.alpha_order = alpha_numbers[index] %>. This line sets current alphabetic order of choice in an instance variable. - Replace
@free_choices.where(question: question.id, correct: TRUE).each do |choice|withquestion.choices.select choice.is_correct .each do. This will loop through only those choices for givenquestionwhereis_correctistrue. - If you want to get alphabetic number attached to choice, access it using
choice.alpha_orderwhich will give correct alpha order.
Hope this helps.
You're a legend, thanks for including details about why it does what also! I've implemented, and it's working great. :)
– Antonio Fergesi
Mar 24 at 12:23
That's nice. Thanks!
– Amit Patel
Mar 25 at 4:25
add a comment |
Here I am outlining quick fix
- replace
<% @a = ("a".."z").to_a %>with<% alpha_numbers = ("A".."Z").to_a %>. You are using<ol type="A">which prints list in upper case latter not in small case. - Move above snippet outside
@free_questions.each_with_indexloop so that you don't end up initializing same array for each question in loop. - Replace
@free_choices.where(question: question.id).sort_byrand.each do |choice|withquestion.choices.shuffle.each_with_index do |choice, index|. As per the model relationship,question.choiceswill give same result as@free_choices.where(question: question.id).shuffleis better way of doingsort_byrand. - In the
Choicemodel, addattr_accessor :alpha_order. This will create accessor methods. - Above
<li><%= choice.name %></li>line add<% choice.alpha_order = alpha_numbers[index] %>. This line sets current alphabetic order of choice in an instance variable. - Replace
@free_choices.where(question: question.id, correct: TRUE).each do |choice|withquestion.choices.select choice.is_correct .each do. This will loop through only those choices for givenquestionwhereis_correctistrue. - If you want to get alphabetic number attached to choice, access it using
choice.alpha_orderwhich will give correct alpha order.
Hope this helps.
You're a legend, thanks for including details about why it does what also! I've implemented, and it's working great. :)
– Antonio Fergesi
Mar 24 at 12:23
That's nice. Thanks!
– Amit Patel
Mar 25 at 4:25
add a comment |
Here I am outlining quick fix
- replace
<% @a = ("a".."z").to_a %>with<% alpha_numbers = ("A".."Z").to_a %>. You are using<ol type="A">which prints list in upper case latter not in small case. - Move above snippet outside
@free_questions.each_with_indexloop so that you don't end up initializing same array for each question in loop. - Replace
@free_choices.where(question: question.id).sort_byrand.each do |choice|withquestion.choices.shuffle.each_with_index do |choice, index|. As per the model relationship,question.choiceswill give same result as@free_choices.where(question: question.id).shuffleis better way of doingsort_byrand. - In the
Choicemodel, addattr_accessor :alpha_order. This will create accessor methods. - Above
<li><%= choice.name %></li>line add<% choice.alpha_order = alpha_numbers[index] %>. This line sets current alphabetic order of choice in an instance variable. - Replace
@free_choices.where(question: question.id, correct: TRUE).each do |choice|withquestion.choices.select choice.is_correct .each do. This will loop through only those choices for givenquestionwhereis_correctistrue. - If you want to get alphabetic number attached to choice, access it using
choice.alpha_orderwhich will give correct alpha order.
Hope this helps.
Here I am outlining quick fix
- replace
<% @a = ("a".."z").to_a %>with<% alpha_numbers = ("A".."Z").to_a %>. You are using<ol type="A">which prints list in upper case latter not in small case. - Move above snippet outside
@free_questions.each_with_indexloop so that you don't end up initializing same array for each question in loop. - Replace
@free_choices.where(question: question.id).sort_byrand.each do |choice|withquestion.choices.shuffle.each_with_index do |choice, index|. As per the model relationship,question.choiceswill give same result as@free_choices.where(question: question.id).shuffleis better way of doingsort_byrand. - In the
Choicemodel, addattr_accessor :alpha_order. This will create accessor methods. - Above
<li><%= choice.name %></li>line add<% choice.alpha_order = alpha_numbers[index] %>. This line sets current alphabetic order of choice in an instance variable. - Replace
@free_choices.where(question: question.id, correct: TRUE).each do |choice|withquestion.choices.select choice.is_correct .each do. This will loop through only those choices for givenquestionwhereis_correctistrue. - If you want to get alphabetic number attached to choice, access it using
choice.alpha_orderwhich will give correct alpha order.
Hope this helps.
answered Mar 24 at 11:09
Amit PatelAmit Patel
8,834165494
8,834165494
You're a legend, thanks for including details about why it does what also! I've implemented, and it's working great. :)
– Antonio Fergesi
Mar 24 at 12:23
That's nice. Thanks!
– Amit Patel
Mar 25 at 4:25
add a comment |
You're a legend, thanks for including details about why it does what also! I've implemented, and it's working great. :)
– Antonio Fergesi
Mar 24 at 12:23
That's nice. Thanks!
– Amit Patel
Mar 25 at 4:25
You're a legend, thanks for including details about why it does what also! I've implemented, and it's working great. :)
– Antonio Fergesi
Mar 24 at 12:23
You're a legend, thanks for including details about why it does what also! I've implemented, and it's working great. :)
– Antonio Fergesi
Mar 24 at 12:23
That's nice. Thanks!
– Amit Patel
Mar 25 at 4:25
That's nice. Thanks!
– Amit Patel
Mar 25 at 4:25
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55322403%2fidentify-correct-answer-from-li-list%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you please share source of Question and Choice Models as well?
– Amit Patel
Mar 24 at 10:15
Sure thing - added the models
– Antonio Fergesi
Mar 24 at 10:34