// We have a slight problem accessing the user connected to that attempt and
// We have a slight problem accessing the user connected to that attempt and
// therefore this will only work with `quiz` type activities for now.
// therefore this will only work with `quiz` type activities for now.
$params=[$qa->get_usage_id(),'mod_quiz'];
$params=[$qa->get_usage_id(),'mod_quiz'];
$tmp=$DB->get_record_sql('SELECT qas.userid FROM {quiz_attempts} qas, {question_usages} qu WHERE qu.id = ? AND qu.component = ? AND qu.id = qas.uniqueid;',$params,IGNORE_MISSING);
$tmp=$DB->get_record_sql('SELECT qas.userid FROM {quiz_attempts} qas, {question_usages} qu '.
'WHERE qu.id = ? AND qu.component = ? AND qu.id = qas.uniqueid;',$params,IGNORE_MISSING);