Title: &#8220;Correct Answer Logic&#8221; doesn&#8217;t work
Last modified: June 8, 2023

---

# “Correct Answer Logic” doesn’t work

 *  Resolved [Alexander Guskov](https://wordpress.org/support/users/forcesail/)
 * (@forcesail)
 * [3 years ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/)
 * Hello,
 * v.8.1.7. Can’t be used because:
    1. “Correct Answer Logic” doesn’t copy from “Quiz Default Options” to Quiz options
       when “Reset to Defaults”
    2. IF “Correct Answer Logic” set to “All correct answers” it requests to all correct
       answers are chosen not only for “Multiply response” but “Multiply Choice” too,
       that is impossible by default

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/page/2/?output_format=md)

 *  [sumitsanadhya](https://wordpress.org/support/users/sumitsanadhya/)
 * (@sumitsanadhya)
 * [3 years ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16805821)
 * Hi Alexander,
   Hope you are doing well.
 * I would like to inquire about a particular matter with our technical team. As
   soon as I receive any updates from them, I will promptly relay the information
   to you.
 * I sincerely appreciate your patience and understanding in this regard.
 * Best regards, 
   Sumit
 *  [sumitsanadhya](https://wordpress.org/support/users/sumitsanadhya/)
 * (@sumitsanadhya)
 * [3 years ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16806469)
 * Dear Alexander,
 * Please check the below-given points for your reference.
    1. “Correct Answer Logic” doesn’t copy from “Quiz Default Options” to Quiz options
       when “Reset to Defaults”
 * Ans: On this point our technical team is working on it. I will keep you posted
   with further updates soon.
    2. IF “Correct Answer Logic” set to “All correct answers” it requests to all correct
       answers are chosen not only for “Multiply response” but “Multiply Choice” too,
       that is impossible by default
 * Ans: We have checked, and there is nothing wrong with the multiple-choice question
   type. For multiple-choice, you are supposed to select only one correct answer
   in your back-end when setting up the quiz, since you can only select one answer
   on the quiz front-end.
 * This option is for multiple response question types and uses with the correct
   score variable. It will work as followings.
 * For a question with 4 answers and 3 of them are correct.
 * If you set Correct Answer Logic to all, you need to check all 3 correct answers,
   in order to score 100% for correct score variable.
 * If you set Correct Answer Logic to any, you need only check one of the correct
   answers to score 100%.
 * Please check below-given screencast link for your reference.
 * [https://app.usebubbles.com/4APLDsdCBAY1iJkJxBJFkS/correct-answer-logic](https://app.usebubbles.com/4APLDsdCBAY1iJkJxBJFkS/correct-answer-logic)
 * Let me know if you need more help.
 * Regards,
   Sumit
 *  Thread Starter [Alexander Guskov](https://wordpress.org/support/users/forcesail/)
 * (@forcesail)
 * [3 years ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16806531)
 *     ```wp-block-code
       Dear Sumitsanadhya,
       Thank you for your prompt reply.
       1) Thank you for that I'll be waiting. Meanwhile would you ask your team to check all other option - it seams there are a few uncoping more (but haven't checked) and definitely there are a few that omit in default plugin settings.
       2) I disagree with you here. Sorry.
       Until v.8 it worked fine with multiply choice and it's amazing possibility to have a few correct answers for the question. It could be covered with multiply response if the option "Correct Answer Logic" existed for every question. But it's more cumbersome. So to apply ability to have a few correct answers for multiply choice was great! I have been using all of these a lot... Bring it back, please!!!
   
       For example, you make quiz about fruits. It's target to focus that the fruits can have just a few colors. So you try to have the same answers for all questions. But you start from the general one:
       1. Mark all that are fruits (multi checkbox):
       - Orange (X)
       - Apple (X)
       - Lemon (X)
       - Strawberry
       2. Witch color mostly orange are? (multi rabio-button)
       - yellow 
       - green
       - orange (X)
       - red
       3. Witch color mostly lemon are? (multi rabio-button)
       - yellow (X)
       - green
       - orange
       - red
       4. Witch color mostly apple are? (multi rabio-button)
       - yellow
       - green (X)
       - orange
       - red (X)
   
       Can we change the style of the questions to satisfy the possibilities of the plugin? In this case - yes, but the logic of the quiz will be different. In other cases - not. 
       So, it's better to return this possibility!!! Please! 
       ```
   
 *  [sumitsanadhya](https://wordpress.org/support/users/sumitsanadhya/)
 * (@sumitsanadhya)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16817251)
 * Dear Alexander,
 * Please check below-given points for your reference.
    1. “Correct Answer Logic” doesn’t copy from “Quiz Default Options” to Quiz options
       when “Reset to Defaults”
 * Ans: This issue is fixed in the latest version of QSM which is 8.1.8. I request
   you to please update the QSM and then check.
    2. IF “Correct Answer Logic” set to “All correct answers” it requests to all correct
       answers are chosen not only for “Multiply response” but “Multiply Choice” too,
       that is impossible by default
 * Ans: Our technical team is working on this point. I will keep you posted with
   further updates soon.
 * Thank you for your cooperation.
 * Regards,
   Sumit
 *  [sumitsanadhya](https://wordpress.org/support/users/sumitsanadhya/)
 * (@sumitsanadhya)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16868665)
 * Dear Alexander,
   The second point issue is fixed and released. I request you to
   please update QSM to its latest version and then check.Let me know if you need
   more help.
 * Regards,
   Sumit
 *  Thread Starter [Alexander Guskov](https://wordpress.org/support/users/forcesail/)
 * (@forcesail)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16884413)
 * Dear Sumitsanadhya,
 * In v.8.1.10 the 1st issue is fixed but I’m sorry to say you that the 2nd one 
   is not fixed.
 *  [sumitsanadhya](https://wordpress.org/support/users/sumitsanadhya/)
 * (@sumitsanadhya)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16888311)
 * Dear Alexander,
 * I request you to please clear the website and browser cookies and cache and then
   check.
 * If you still face the same issue then please share the screencast of the issue
   so I will check and help you to fix the issue.
 * Looking forward to your reply.
 * Regards,
   Sumit
 *  Thread Starter [Alexander Guskov](https://wordpress.org/support/users/forcesail/)
 * (@forcesail)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16889622)
 * Hello Sumit.
 * Yes, the issue hasn’t fixed. See video:
   [https://forcesail.ru/screenshots/QSM-multyChoce-test-2023-07-12_1_1.mp4](https://forcesail.ru/screenshots/QSM-multyChoce-test-2023-07-12_1_1.mp4)
 * By the way 2 very old issues more:
   1) If there is just 1 question in the quiz–
   it shows on the same screen with “Text Before Quiz”2) It is awfully crooked idea
   to create post without template. Every time when you update the plugin I have
   to go inside and correct the php (remove the call get_the_post_thumbnail() )/
   But any way I’d be happy to choose another template (for example that I use for
   all important pages) in place of default one.
 *  Thread Starter [Alexander Guskov](https://wordpress.org/support/users/forcesail/)
 * (@forcesail)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16947466)
 * Hello Sumit.
 * Just inform you that in version 8.1.13 the issue is still NOT resolved.
 *  Thread Starter [Alexander Guskov](https://wordpress.org/support/users/forcesail/)
 * (@forcesail)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16975265)
 * Hello Sumit,
 * if **QSM_Question_Review_Choice::set_answer_status()** (file ‘class-question-
   review-choice.php’) you would change 
   **if ( in_array( $this->question_type, 
   array( 0, 1 ), true ) && 0 < $user_correct_ans ) {**to _(better)_:**if ( in_array(
   $this->question_type, array( ‘0’, ‘1’ ), true ) && 0 < $user_correct_ans ) {**
   or to _(not so good)_:**if ( in_array( $this->question_type, array( 0, 1 )) &&
   0 < $user_correct_ans ) {**it would work. Verified.
 * The problem is, that **$this->question_type** is a string, because in file class-
   question-review.php it gets string from (that returns only strings or null, that
   converts to 0 , so it’s why the 1st promoted option is better):
   **QSM_Questions::
   load_question_data()**As well, it would be perfect if you would add class property
   description**public $question_type = ”;**to the class **QSM_Question_Review**
   in file class-question-review.php
 * Please, do it!
 *  [sumitsanadhya](https://wordpress.org/support/users/sumitsanadhya/)
 * (@sumitsanadhya)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16977301)
 * Dear [@forcesail](https://wordpress.org/support/users/forcesail/) ,
 * Let me discuss this with our technical team. I will keep you posted with further
   updates soon.
   Regards,Sumit
 *  [sumitsanadhya](https://wordpress.org/support/users/sumitsanadhya/)
 * (@sumitsanadhya)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16979188)
 * Dear [@forcesail](https://wordpress.org/support/users/forcesail/) ,
   Can you please
   provide an explanation of what is this regarding? Why are you suggesting these
   code changes?
 * Our developer will need this information in order to evaluate this code suggestion.
 * Looking forward to your reply.
 * Regards,
   Sumit
 *  Thread Starter [Alexander Guskov](https://wordpress.org/support/users/forcesail/)
 * (@forcesail)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16980251)
 * Hello Sumit,
 * This is regarding the discussion about this topic subject, that for questions
   multiply chose “Correct Answer Logic” doesn’t work properly. Please read above
   from the beginning.
 * To fix it, in version 8.1.10 your team added this 
   **if ( in_array( $this->question_type,
   array( 0, 1 ), true ) && 0 < $user_correct_ans ) {**in class method **QSM_Question_Review_Choice::
   set_answer_status()** (file ‘class-question-review-choice.php’) that doesn’t 
   work (that I reported you multiply times) because they pass **string **as the
   first argument and array of **numbers **as the second argument and ‘string ‘true’
   as the 3d argument (“compare strict”) to the function ** in_array**. This code
   never can return “**true**“, so this code useless and this bypass for multiply
   chose keep doing not working.
 * Above I explained you the ways to fix this error and with indicating which way
   is better and why.
 * I believe this explanation will clarify to your development team what did they
   do. But if you need any other explanation how their code works you are always
   free to request me without any hesitation. -:)
 *  [sumitsanadhya](https://wordpress.org/support/users/sumitsanadhya/)
 * (@sumitsanadhya)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16980712)
 * Dear [@forcesail](https://wordpress.org/support/users/forcesail/) 
   Thank you 
   for the explanation.Let me discuss this with our technical team.I will keep you
   posted with further updates soon.Regards,Sumit
 *  [sumitsanadhya](https://wordpress.org/support/users/sumitsanadhya/)
 * (@sumitsanadhya)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/#post-16989147)
 * Dear [@forcesail](https://wordpress.org/support/users/forcesail/) ,
   As per the
   technical team, we’ve made a decision. Instead of comparing strings to strings,
   we will now compare integers to integers. For instance:
 * if ( in_array( intval( $this->question_type ), array( 0, 1 ), true ) && 0 < $
   user_correct_ans ) {
 * It will be included in the upcoming plugin release.
 * Regards,
   Sumit

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/page/2/?output_format=md)

The topic ‘“Correct Answer Logic” doesn’t work’ is closed to new replies.

 * ![](https://ps.w.org/quiz-master-next/assets/icon-128x128.png?rev=3158087)
 * [Quiz and Survey Master (QSM) - Easy Quiz and Survey Maker](https://wordpress.org/plugins/quiz-master-next/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/quiz-master-next/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/quiz-master-next/)
 * [Active Topics](https://wordpress.org/support/plugin/quiz-master-next/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/quiz-master-next/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/quiz-master-next/reviews/)

 * 20 replies
 * 2 participants
 * Last reply from: [Alexander Guskov](https://wordpress.org/support/users/forcesail/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/correct-answer-logic-doesnt-work/page/2/#post-17062969)
 * Status: resolved