/** * Get the SQL needed to test that question_attempt_steps.state is in a * state corresponding to $summarystate. * @param string $summarystate one of * inprogress, needsgrading, manuallygraded or autograded * @param bool $equal if false, do a NOT IN test. Default true. * @return string SQL fragment. */ public function in_summary_state_test($summarystate, $equal = true, $prefix = 'summarystates') { $states = question_state::get_all_for_summary_state($summarystate); return $this->db->get_in_or_equal(array_map('strval', $states), SQL_PARAMS_NAMED, $prefix, $equal); }