Disclaimer: I do not know if there is a formatting standard that users are used to here. This is one of those occassional times I thought "this post has to be out there" and so I posted. I really can't find the solution online or there is but it's complicated in my eyes. I just want something that works on Desktop and AnkiMobile. The best I got is first page Google-ing and my highschool HTML lessons a decade ago.
With that out of the way....
> Create or Edit aBasic Note type
> Go to Fields
> Add 4 Fields
> name them A, B, C, D
> Go to Cards
> Copy the Front Template below
FRONT TEMPLATE
{{Front}}
<div style="visibility:hidden";>
<div class="shuffle A">{{A}}</div>
<div class="shuffle B">{{B}}</div>
<div class="shuffle C">{{C}}</div>
<div class="shuffle D">{{D}}</div>
</div>
<div>
<div id="container" style="
text-align: left;
display: inline-block;">
</div>
</div>
<script>
seed = Math.floor(Date.now()/3600000);
random = ((seed * 9301 + 49297) % 233280) / 233280;
function shuffleArray(array) {
for (let i = array.length - 1; i > 0; i--) {
j = Math.floor(random * (i+1));
[array[i], array[j]] = [array[j], array[i]];
}
}
setTimeout(() => {
const fields = [...document.querySelectorAll(".shuffle")];
shuffleArray(fields);
fields.forEach((fld) => document.getElementById("container").appendChild(fld));
}, 0);
</script>
Copy this to the Back Field so the right answer lights up blue when you flip the card.
<style>
.A {color:lightblue;font-weight:bold;}
</style>
Replace 'A' with the Field that has the right answer
source of multiple choice: https://forums.ankiweb.net/t/how-to-create-a-multiple-choice-card-with-randomized-order-of-answers/27904
source of random number: https://stackoverflow.com/questions/33716998/why-does-seed-9301-49297-233280-233280-0-generate-a-random-number
The random number generator's good tho, you can control it, it's the same random number for the entire day before it switches to a new one. It sorta fixes the Anki persistence thing too with just you and the front template.
The problem with Math.random() is that it'll generate a new one when you go flip the card. So, the initial generated number's gone by then.