Check PopupMenu answer

I use this function to generate a graphic and a PopupMenu:

Labeled[listar1 = {PopupMenu[Dynamic[r1], {"Sen","Cos","Tan"}]};
         Plot[Sin[x],{x, -2 Pi, 2 Pi}, PlotStyle->Red,PlotRange->{-4,4},ImageSize->Large],
         Column[Flatten[{Text["Which function?"],listar1}]],Right];

After a user has answer the question, how can I check the value of the PopupMenu and display a green/red rectangular or a phrase to indicate him that he is right/wrong?

let me suggest two things.

  1. your going about it backwards meaning plots with check-boxes are show in Help for Manipulate using PopupMenus, but not for PopupMenus with Dynamic. Using Dynamic will be more difficult unless used as seen in Help. I would guess it’s possible but “lower level” usage, and so there will be less help and potentially less support with future versions.

  2. see: ref/CurrentValue

  3. you might consider using ChoiceDialog or some interface element designed to return a choice.