Script in a card field or template

Hi there !

Let’s begin with an example : I would like to create a card with the question (a+b)²=?, and the answer (a+b)²=a²+b²+2ab.

But I would like the same card to have a slightly different question every time :

  • (x+y)²=?
  • (m+n)²=?
  • (b+d)²=?
  • (a+b)²=?

I’m not trying to create multiple cards, because all these questions are variations of the same problem, so I would like those questions to be random occurrences of one card.

I don’t want those questions to be different cards of the same note, I would like those questions to be random occurrences of one card.

Would it be possible? Could we use some JavaScript in the card field or card template for instance?

Thanks !

Please see Styling & HTML - Anki Manual