# Multiple Choice

**URL:** <https://forums.ankiweb.net/t/multiple-choice/1668>\
**Category:** Add-ons\
**Created:** [July 31, 2020, 7:38pm UTC](https://forums.ankiweb.net/t/multiple-choice/1668 "2020-07-31T19:38:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ll1234](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@ll1234](https://forums.ankiweb.net/u/ll1234)\
**Post date:** [July 31, 2020, 7:38pm UTC](https://forums.ankiweb.net/t/multiple-choice/1668/1 "2020-07-31T19:38:10Z")

</div>

Support thread for addon [https://ankiweb.net/shared/info/413154037](https://ankiweb.net/shared/info/413154037)

---

<div class="post-metadata">

**Author:** ![hkakh786](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hkakh786](https://forums.ankiweb.net/u/hkakh786)\
**Post date:** [August 2, 2020, 4:16am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/2 "2020-08-02T04:16:07Z")

</div>

(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.

 ![Annotation 2020-08-02 001324](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/21f44496a9f45ee06b3d9116ba61b47db645f47a.png)

---

<div class="post-metadata">

**Author:** ![ll1234](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@ll1234](https://forums.ankiweb.net/u/ll1234)\
**Post date:** [August 2, 2020, 7:36am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/3 "2020-08-02T07:36:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hkakh786](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hkakh786](https://forums.ankiweb.net/u/hkakh786)\
**Post date:** [August 3, 2020, 4:09am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/4 "2020-08-03T04:09:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![acetylaminophenol](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@acetylaminophenol](https://forums.ankiweb.net/u/acetylaminophenol)\
**Post date:** [August 8, 2020, 11:43am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/5 "2020-08-08T11:43:37Z")

</div>

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 ^^

---

<div class="post-metadata">

**Author:** ![mattjbr2](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/mattjbr2/32/1258_2.png) [@mattjbr2](https://forums.ankiweb.net/u/mattjbr2)\
**Post date:** [August 18, 2020, 12:31pm UTC](https://forums.ankiweb.net/t/multiple-choice/1668/6 "2020-08-18T12:31:32Z")

</div>

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:  
[![](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/6/64c20382175ecc817b1a038762b7a09f35a9b3e4.png) ](https://i.imgur.com/z9Z3ip3.png)

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.

 ![](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/3/3b6992eee8c149a6003cb7a8b2c7cbdbfa4ad0dd.png)

Impossible to tell which is the correct option:

 ![](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/5/5e68ae65d8331f88aff246e1f8f5b34d629d80c1.jpeg)

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! 😛

---

<div class="post-metadata">

**Author:** ![mattjbr2](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/mattjbr2/32/1258_2.png) [@mattjbr2](https://forums.ankiweb.net/u/mattjbr2)\
**Post date:** [August 23, 2020, 3:31pm UTC](https://forums.ankiweb.net/t/multiple-choice/1668/7 "2020-08-23T15:31:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![woody](https://avatars.discourse-cdn.com/v4/letter/w/ac91a4/32.png) [@woody](https://forums.ankiweb.net/u/woody)\
**Post date:** [September 1, 2020, 1:33am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/9 "2020-09-01T01:33:13Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![ObsidianJackal](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/obsidianjackal/32/1571_2.png) [@ObsidianJackal](https://forums.ankiweb.net/u/ObsidianJackal)\
**Post date:** [September 3, 2020, 3:47am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/10 "2020-09-03T03:47:54Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/c/c5fd89bbe0a6cdea57a6a89b9de4bcd5bf350466.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/e/e21a51a10d5b3938aa7e6341b40a1c456f583c76.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/b/bf983f75a3b971f80c181ab7e3576520f9b625d1.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/c/c31c438f9fa2b813538c44f5cf9fa61bf8fb5837.png)

“Two” is highlighted in blue as the correct answer when `MC_Ans` was set to 3 and `MC_3` was set to “Three.”  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/5/5bd081ae3e7ed8c269a6d1d585d7a7e61eb130de.png)

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.

---

<div class="post-metadata">

**Author:** ![woody](https://avatars.discourse-cdn.com/v4/letter/w/ac91a4/32.png) [@woody](https://forums.ankiweb.net/u/woody)\
**Post date:** [September 3, 2020, 4:44am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/11 "2020-09-03T04:44:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ll1234](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@ll1234](https://forums.ankiweb.net/u/ll1234)\
**Post date:** [September 3, 2020, 5:03pm UTC](https://forums.ankiweb.net/t/multiple-choice/1668/12 "2020-09-03T17:03:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ObsidianJackal](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/obsidianjackal/32/1571_2.png) [@ObsidianJackal](https://forums.ankiweb.net/u/ObsidianJackal)\
**Post date:** [September 3, 2020, 5:17pm UTC](https://forums.ankiweb.net/t/multiple-choice/1668/13 "2020-09-03T17:17:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mattjbr2](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/mattjbr2/32/1258_2.png) [@mattjbr2](https://forums.ankiweb.net/u/mattjbr2)\
**Post date:** [September 4, 2020, 10:43am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/14 "2020-09-04T10:43:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![acetylaminophenol](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@acetylaminophenol](https://forums.ankiweb.net/u/acetylaminophenol)\
**Post date:** [October 13, 2020, 6:28am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/16 "2020-10-13T06:28:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![acetylaminophenol](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@acetylaminophenol](https://forums.ankiweb.net/u/acetylaminophenol)\
**Post date:** [October 13, 2020, 6:32am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/17 "2020-10-13T06:32:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![martinhansell](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/martinhansell/32/1634_2.png) [@martinhansell](https://forums.ankiweb.net/u/martinhansell)\
**Post date:** [October 19, 2020, 7:36am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/18 "2020-10-19T07:36:14Z")

</div>

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_image01](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/5/5fef48f99b40f61c1a6029a14b1cb788bc2955bf.png)

 ![MC_image02](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/7/7e52fe0f236806391d7493bbb70ec4e9a168916f.png) ![MC\_image03|690x442]

 ![MC_image03](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/b/b3d064a295c226b5ce9c53fccbd9e7d472601b4a.png)

 ![MC_image04](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/b/b080b7f737f04e2ef640c3d47c83d5eb41f219c3.png)

 ![MC_image05](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/a/a8c43483d9874b3a8985f1c6b4200935edc24f45.png)

Many thanks!

---

<div class="post-metadata">

**Author:** ![kael](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kael](https://forums.ankiweb.net/u/kael)\
**Post date:** [October 25, 2020, 3:47pm UTC](https://forums.ankiweb.net/t/multiple-choice/1668/19 "2020-10-25T15:47:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![3564](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/3564/32/17682_2.png) [@3564](https://forums.ankiweb.net/u/3564)\
**Post date:** [November 2, 2020, 6:46am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/20 "2020-11-02T06:46:22Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/5/5ce5f649a558fd2eba69f48691ffdebf68851c8c.jpeg) ![5](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/7/7e29e385a5e067f4c187d13b712f35db40b3a7f6.jpeg) ![6](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/2/270debad3e7824790751bf9988d59a873555cc13.jpeg) ![7](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/1/1ba24b56d4f1b303b9c737a754597f1023fd4315.jpeg)

---

<div class="post-metadata">

**Author:** ![paula](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@paula](https://forums.ankiweb.net/u/paula)\
**Post date:** [November 4, 2020, 11:23pm UTC](https://forums.ankiweb.net/t/multiple-choice/1668/21 "2020-11-04T23:23:54Z")

</div>

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**

---

<div class="post-metadata">

**Author:** ![xavi](https://avatars.discourse-cdn.com/v4/letter/x/8e8cbc/32.png) [@xavi](https://forums.ankiweb.net/u/xavi)\
**Post date:** [May 14, 2024, 9:44am UTC](https://forums.ankiweb.net/t/multiple-choice/1668/22 "2024-05-14T09:44:36Z")

</div>

is issue resolved i am facing the same issue. my ppsc past papers mcqs you can check are not aligning :
