Error message prevOpt is undefined

Not the randomtest results. The actual source code that you wrote in ChoiceScript.

Also, what are you getting from quicktest?