/**
  * Print a link to student submitted file.
  *
  * @param int $userid User Id
  * @param boolean $return Return the link or print it directly
  */
 function print_student_answer($userid, $return = false)
 {
     $output = parent::print_student_answer($userid, true);
     $submission = $this->get_submission($userid);
     $onlinejudge_result = $this->get_onlinejudge_result($submission);
     // replace draft status with onlinejudge status
     $pattern = '/(<div class="box files">).*(<div )/';
     $statusstyle = $onlinejudge_result->status == ONLINEJUDGE_STATUS_ACCEPTED ? 'notifysuccess' : 'notifyproblem';
     $statustext = html_writer::tag('span', get_string('status' . $onlinejudge_result->status, 'local_onlinejudge'), array('class' => $statusstyle));
     $replacement = '$1' . $statustext . '$2';
     $output = preg_replace($pattern, $replacement, $output, 1);
     // TODO: Syntax Highlight source code link
     return $output;
     // Always return since parent do so too
 }