# Add better style to a dynamic question

I would like to obtain something similar to this:

A user, has to answer the question selecting an answer from a popupmenu and he can check it.

I wrote that:

DynamicModule[{r1,r2},listarisposte={PopupMenu[Dynamic[r1],
{"",Sequence @@ RandomSample[{"Sin(60)","Cos(60)"}]}]};
Row[Flatten[{{Text[Subscript["V","x"]],Text["=v*"], listarisposte,Text["40*1/2=20"]},
Button["Controlla", r2 = (r1 == "Cos(60)")],
Graphics[{Dynamic[If[r2, Green, Red, Gray]], Rectangle[{0, 0}]},ImageSize -> {20, 20}],
Dynamic[If[r2, "Giusto!", "Sbagliato, riprova!", ""]]}]]];


The output is

but it isn't very well styled. How can I write 1/2 in the fraction form?

How can I resize the text? I tried with Style but it doesn't work.

• See 69655 and ref/FontSize – Kuba May 30 '17 at 16:36
• @Kuba FontSize works well, but HoldForm not. I modified the previous lines as {Text[Style[Subscript["V","x"],FontSize->30]],Text[Style["=V* ",FontSize->30]], listarisposte, Text[Style[" 40*"<>ToString[HoldForm[1/2]]<>"=20 ",FontSize->30]]} But the result is this i66.tinypic.com/15zmazo.png – Ale1794 May 30 '17 at 19:46
• You can use ToString[1/2, TraditionalForm] or use HoldForm with Row etc, they don't convert it to strings in the linked question. – Kuba May 30 '17 at 19:52
• Perfect, thank you – Ale1794 May 30 '17 at 19:56

I've modified your code a bit for readability. The stylish functions st and st2 define the fonts. The value i is identifier of the right answer.

st=Style[#,20]&;
st2=Style[#,20,Blue,Bold]&;

DynamicModule[{r1 = "", r2, i = RandomInteger[{1, 2}]},
listarisposte =
st@"\!$$\*SubscriptBox[\(V$$, $$x$$]\)=v*", listarisposte,
st@"40*\!$$\*FractionBox[\(1$$, $$2$$]\)=20", Spacer[20],