Hunter,
There was a post to the pretext development list that triggered my memory enough to realize that there IS a solution to your problem, it just requires that you code directly in javascript instead of the expression library markdown. Making a test about the formula as an expression is what I was thinking about in my earlier answer. But the system is already capable of adding arbitrary javascript calculations and tests from the original design — just not many have gone this route.
If you go to this section of the documentation
Subsection 4.12.7: Fill-in-the-Blanks Exercises there is a reference to a `jscmp` method that you can use to define your own comparison based on any valid javascript that evaluates to a boolean. Because the modulus operator is a first-class operator in javascript, you could use that for your test if you just want to check a numerical answer for comparison. It also mentions `setupScript` which allows arbitrary javascript (encapsulated in a function) to generate additional values.
All objects are stored as local variables within an object named `v` for the actual javascript. So having defined your values, instead of defining "wt" as a de-object (where the operator is not defined), you can instead compute "wt" in the setupScript.
<setup>
... same as before except defining wt ...
<setupScript> <!-- This is pure javascript executed within a function -->
v.wt = (v.x1^4 + v.x2^4 + v.x3^4 + v.x4^4 + v.x5^4 + v.x6^4) % 5;
</setupScript>
</setup>
And then instead of <mathcmp> you would try:
<jscmp>answer == wt</jscmp>
(At the comparison step, all of the "v" variables are made 1st class variables in their own right so that we don't need v.{...})
I have not attempted if this works as is, but it should be close.
Brian