Anki Forums

Multiple Choice

Support thread for addon https://ankiweb.net/shared/info/413154037

3 Likes

(see attached picture below) The description to the addon states it will allow as many multiple choice options as possible. I have put it at 20 options, yet it is constantly displaying all 20 option numbers when I test myself (even ones I have not entered answer options for).

This didn’t used to happen before the update (albeit, I only capped my answer choices to 5 then). Please explain how I may correct this? Thanks.

I’ve updated the plugin to add in an option in the config “Ignore Blanks”. If true, it will ignore blanks (so in your example the empty fields would not be shown). Default is true. Let me know if that works.

1 Like

@ll1234, that looks like it did the trick. Thanks for your help!

Hey there. Got a problem with the answers. The preview says “the answer must be in a field labeled MC_1”. This is actually true for all my old MCQs: Even though i’ve put the correct number in MC_Answer it always shows MC_1 as the right one. I mean, I could just change the MC’s so that the right answer is always in MC_1 but doing that for ~1000 cards would be a huge thing ^^

Hi, I love your addon, thank you so much for making it. I only have 2 issues with it. The solution text is blue! On dark mode it’s almost impossible to make out what it says. How do I change this blue colour to yellow? I have no background in coding, so please give me the exact code to paste into the ‘Styling’ section!
Too difficult to see:

The second issue is with multi-choice questions that I screenshotted rather than copied the text. As the solution only changes colour, it’s literally impossible to tell what the answer is if all the options are images (images aren’t affected by a change in colour). Is there a way to display ONLY the correct option and hide the incorrect options? Or have 1 of the numbers change colour? Or any other thing you might suggest.

Below are all images pasted into the boxes, they aren’t select-able text.

Impossible to tell which is the correct option:

Thanks!

Edit: nevermind the 1st issue! I resolved it by making the background white and the text black, so now the blue is easily visible. I still am unable to solve the 2nd issue though

Edit2: ok I solved the 2nd issue by creating another field and just pasting the correct option into that field. Still, a more elegant method would be better! :stuck_out_tongue:

Update: I ran in to the same problem as acetylaminophenol. It keeps telling me that MC_2 is the correct answer regardless of what’s in MC_Ans. MC_Ans could be empty and I’d still get told that the solution is MC_2. Even if I create a new card and place 4 into MC_Ans, MC_2 will show up. Why is it doing this?

@mattjbr2, @ll1234 I ran into the same issue with answer 2 ALWAYS being selected. I am stubborn, so I walked through the .py file and discovered the following:
This line:
if key == f’{MULTIPLE_CHOICE_PREFIX}{answer_key_index}’:
will ALWAYS return MC_2 as the value key is compared to, because the answer_key_index doesn’t change (it is always the ordinal of the MC_Ans field).

The correct statement should be:
if key == f’{MULTIPLE_CHOICE_PREFIX}{mc_answer_option}’:
as this will return the current answer option. I tested this out on several of my questions and it seems to have “fixed” the issue.

Another issue I discovered is if I copied Question and Answers from a webpage, sometimes the HTML (i.e. <span…> and coloring would be copied with it and would overwrite the highlighting of the answer.

Note: I am NOT the plugin developer, just someone that wanted to use this plugin and grew frustrated with it not working as needed.

2 Likes

If I set MC_Ans to a number, it doesn’t pick the right answer.

Here’s what I have set for a card:

image

image

image

“Two” is highlighted in blue as the correct answer when MC_Ans was set to 3 and MC_3 was set to “Three.”
image

Out of frustration I also discovered that if I set MC_Ans to a number that doesn’t match any of the multiple choice numbers, it will pick one anyway.

See my post directly above your post. The issue is the python code behind the plugin is broken and it ALWAYS selects the second answer (MC_2), no matter what value is in MC_Ans. If you apply the fix I suggest to the .py file, it will fix your issue and the plugin will work as expected.

I am not the developer, I am just someone who was frustrated the same as you and decided to figure out the reason for the problem. It doesn’t look like the developer has responded to any issues on the forum in quite some time.

1 Like

Sorry, been busy recently with a recent move; I made the fix but I guess I forgot to upload it. Just uploaded it.

2 Likes

Thanks.

Also, if you copy/paste from a webpage and don’t want that page’s formatting, use CTRL+SHIFT+V shortcut to paste content as plain text.


Thanks ll1234 for the update too.

I can’t believe it’s finally fixed, finally!. Also, there’s an option in preferences/basic that says “Paste without shift key strips formatting” so I’m not sure what issues people are having with formatting

Hey there. Sorry for complaining again. There was a version once where I was able to lable more than one answer as correct, e.g. MC_Ans = 1;2. That’s not possible anymore. Do you have a solution for that?

As mattjbr2 has stated, there’s also no possibility to choose the text colour. Would it be possible to add that as well?
I know it is a lot of work and you’re not rewarded for that. If there’s is a possibility to support you, please tell us. Your add-on is one of my favourites so far and I would love to push the work on it.
Greetings

I have just installed the plugin to Anki Version 2.1.35 (84dcaa86). I have followed the instructions in the plugin page. But the MC_Questions are not being pulled into the card on either the front or the back.

Here are the images of the relevant windows.

![MC_image03|690x442]

Many thanks!

hello I have the same problem like martinhansell.
I also use Anki version: 2.1.35.
I hope you can fix problem soon.

many thanks.

Hello
Thanks for your good plugin. Unfortunately, the code you suggested for the mobile version does not work properly.
Please also think about the Android version. Studying flashcards on the Android version is much more practical and more important than the desktop version.
(upload://8regugmmpypCfVuaH3ICll8LbqE.jpeg) 4 5 6 7

Hi. I am using Anki version 2.1.35 as well. Whenever I edit a card using this add-on, it would give me a bug error message. I added an Image field for photo reference for the multiple choice question.

I am unsure if it’s because I added the Image field or if I just have too many fields in general that the add-on is crashing.

THE ACTUAL PROBLEM: The questions don’t migrate into back template and the answer doesn’t show either.

I also would like to customize the fonts and the card background color. I am not a programmer but does this also affect the add-on’s functionality? It worked fine with my modifications until it crashes.
Here below is the error message I received.

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you’ve discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.7
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-11-03 18:47:06
Add-ons possibly involved: ⁨Multiple Choice UPDATED AS OF 2129⁩

Caught exception:
Traceback (most recent call last):
** File “aqt/progress.py”, line 53, in handler**
** File “aqt/clayout.py”, line 467, in _renderPreview**
** File “aqt/clayout.py”, line 533, in ephemeral_card_for_rendering**
** File “anki/template.py”, line 220, in render**
** File “anki/template.py”, line 302, in apply_custom_filters**
** File “anki/hooks.py”, line 267, in call**
** File “/Users/magsthegrey19/Library/Application Support/Anki2/addons21/413154037/multiple_choice.py”, line 69, in mc_filter**
** return invalid_name(filter_name)**
NameError: name ‘invalid_name’ is not defined