I think the problem here relates to your earlier posting about how to hide the colouring of the result display. You've still got 'showoutputonly' set to true in your JSON result, right? To quote from the documentation:
The 'showoutputonly' attribute, if set true, results in the prologuehtml and
epiloguehtml fields being displayed against a neutral background with the
usual outcome message (e.g. "Passed all tests") suppressed. The mode is intended
for use in pseudo-questions that can be used by students to experiment with a
given bit of code. If this attribute is true the 'fraction' attribute is not
required and is ignored if given. Since a mark is still required by the framework
when a question is checked, full marks are awarded regardless of the result of
the run but questions of this sort would normally not contribute marks towards
So if you want to use that option to hide from students their mark during a test, you'll then have to turn it off again after the test to get meaningful marks.
I'm afraid I can't offer you a solution to your first problem (hiding the outcome from students during the test) that also awards valid marks. Except for the hack that I think you already suggested of awarding marks in the range 0.01 to 0.99.