Compare input with database value workflow

Howdy!

I am building a Duolingo clone, where a random question (taken from my database “Questions”) is displayed on screen, and the user needs to input an answer.

In my database, there is a correct answer for each question (see below).

After a user submits their answer, I would like to evaluate whether the INPUT is equal to the ANSWER in the database.

However, I am unable to evaulate the input against the CURRENT question on screen (which is randomly selected on page load).
Screenshot 2022-12-07 at 12.41.08 pm

Any clue on how to best approach this?

Thanks for your help :grinning:

You just need to reference the Question…

So wherever the question is loaded (presumably in a Group somewhere), just refer to that in your workflow…

i.e. when Input’s value is Group’s Question’s Answer…

Thanks for your quick reply @adamhholmes

So yes, my question is indeed inside a group named “Question group”.

However, when trying to reference it, all I see are irrelevant variables… What am I missing?
Screenshot 2022-12-07 at 1.01.35 pm

What Content-Type does the Group have?

also, your two screenshots don’t match up… one show ‘Question group’ the other is ‘Question Group Content’… those are two different elements… so I’m not sure which one is the Group that holds the question?..

In fact, I can’t work out from the screenshot what kind of element ‘Question Group Content’ is at all (it doesn’t look like a group?)…

Aaaah I get it now. :sweat_smile:

So the Content-Type was missing from my Question Group Content.

I can now see the correct variable in the workflow.
Screenshot 2022-12-07 at 1.25.36 pm

I am unsure now as to why the page doesn’t refresh when the correct answer is added in the input field though. :face_with_monocle: But at least I am getting closer!

Thank you @adamhholmes !