Can't add more than 2 answers on a multiple choice question

I'm working with a client to set up a coursepress pro website and the client told me they were having difficulties adding more than 2 answers on a multiple choice question.
when adding extra answers to a multiple choice question and clicking save, the answers list reverts to two entries and the second answer is changed to whatever the last input answer was.

I turned on wordpress debugging but am not seeing any error messages or log entires
Single-choice questions are working appropriately however.

I tried different browsers and duplicate the course, the issue persists on the copy too. Though works ok on a new empty course.

Not sure it's at all related but just noticed that when I switch a unit to draft, save, change a question, then save again, the unit goes back to being "live"
This happened four times when duplicating the course: Trying to get property of non-object in /~/public_html/wp-content/plugins/coursepress/includes/classes/class.course.unit.php on line 668

  • Adam

    I have already added support access to the site in question.

    Looked back into my courses list and saw that the "duplicated" course had been duplicated twice (there were two entries for the same course (copy)).

    When I used the bulk actions to delete the two course copies I got a bunch of error messages like this:
    Notice: Trying to get property of non-object in /~/public_html/wp-content/plugins/coursepress/includes/classes/class.course.unit.module.php on line 190
    Warning: Invalid argument supplied for foreach() in /~/public_html/wp-content/plugins/coursepress/includes/classes/class.course.unit.module.php on line 193

    Just did an additional test with a new unit with only a single page and a single multiple choice question and that also worked appropriately/as expected.

  • Adam

    Added a new page to my "Test Unit" and was able to successfully add a multiple choice question as expected on the second page.

    When I added a new page to the unit giving the issue/errors and added a multiple choice question, the question again reverted to having only two answers.

    Considering this is a fully completed, 7-page unit, I would really like to not need to completely replicate it all if possible.

  • Adam Czajczyk

    Hello Adam,

    I hope you're well today and thank you for your question!

    I tried to replicate this on my end but wasn't able to. However, I tested this with only 4-5 answers and a single multiple choice on a page. Should I try more? Also, have you tried to set unit to "Draft" before making changes, then add your multiple choice questions and and after saving set unit to back to "Live"?

    If you haven't tried that yet, could you please do it and let me know about the result?

    Best regards,

  • Adam

    For some reason, this issue is only occurring on a single "unit". When I add new units to the same course I can install multiple choice questions on multiple pages without issue.

    I did try setting the unit to "Draft" and then saving. I then edited the multiple choice question (in draft mode) and when I click save the unit reverts back to "Live" mode and the multiple choice question reverts to having only two answers, the first/original "correct" answer and the last answer in the submitted list of possible answers.

  • Milan

    Hey Adam

    I can see your issue in action and its really surprising one as its not taking place on other units.

    So I have one trick in mind which can help us here. :slight_smile: You can create new unit exactly same as that one and when its ready you can shift it to 2nd place. To shift it to second place, all you need to do is just dragging it from bottom to top.

    Will this work for you ? I know its not an answer of your issue but alternative solution for sure which you can try meantime. :slight_smile:

    Let me know what you think about this ?
    Best Regards,

  • Adam

    Hi Milan,

    Unfortunately that's what we had to do. It's very strange that this was occurring with no errors in the php error log or the javascript console. Unfortunately it's one of those ghost in the machine-types of situations where it's nearly impossible to pinpoint since the functionality works -everywhere- else that it's supposed to except for this one particular location.

    Since the customer has since moved forward I'm marking this as resolved even though we were not able to identify the source of the problem.

  • Adam

    Hi Emily,

    Sorry to hear you're experiencing the same issue!

    Unfortunately because the system was not generating any error messages (either in the PHP error log or in the Javascript console) it was practically impossible to troubleshoot or locate the source of the issue.

    Our only solution (which we proceeded with) was to re-create the test in a whole new "unit" which seemed to clear up the issue for us. I wish I had better news (especially if you're 20+ questions into the test!) but that's the workaround that we had to use to continue our development of the course until such time as the problem could be identified, fixed, and patched by the plugin development team.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.