Briefly - I saw Jay use a method that allows for flexibility, I believe here:
He created multiple patterns, like your sum and difference options. He then used
firstDefinedValue
to figure out which one (if any) the student had used.
You can see that in the CL of the note in this example of his: