Super easy variable question

Easy for you…but I’m dumb. So I’m working on a game, where if you click an answer, it will double check to see if that’s the one you really want. So I tried to set a variable when that button is clicked. On another set of buttons, I placed an if / else statement, but it doesn’t seem to be working. I’ll post the code, and you tell me if I’m even remotely close. Which I’m probably not. Thanks.

Button 1:

on (release) {
//ser variable of right answer
answer = “correct”;
trace(answer);
}

Button 2:

on (release) {
if ( answer = “correct” ) {
gotoAndPlay(2);
} else {
gotoAndPlay(3);
}
}