/** * Do we have all the necessary inputs to execute one of the potential response trees? * @param stack_potentialresponse_tree $prt the tree in question. * @param array $response the response. * @param bool $acceptvalid if this is true, then we will grade things even * if the corresponding inputs are only VALID, and not SCORE. * @return bool can this PRT be executed for that response. */ protected function can_execute_prt(stack_potentialresponse_tree $prt, $response, $acceptvalid) { // The only way to find out is to actually try evaluating it. This calls // has_necessary_prt_inputs, and then does the computation, which ensures // there are no CAS errors. $result = $this->get_prt_result($prt->get_name(), $response, $acceptvalid); return null !== $result->valid && !$result->errors; }