original_string: public function get_grading_status($userid) {
          if ($this->get_instance()->markingworkflow) {
              $flags = $this->get_user_flags($userid, false);
              if (!empty($flags->workflowstate)) {
                  return $flags->workflowstate;
              }
              return ASSIGN_MARKING_WORKFLOW_STATE_NOTMARKED;
          } else {
              $attemptnumber = optional_param('attemptnumber', -1, PARAM_INT);
              $grade = $this->get_user_grade($userid, false, $attemptnumber);
  
              if (!empty($grade) && $grade->grade !== null && $grade->grade >= 0) {
                  return ASSIGN_GRADING_STATUS_GRADED;
              } else {
                  return ASSIGN_GRADING_STATUS_NOT_GRADED;
              }
          }
      }
code: public function get_grading_status($userid) {
          if ($this->get_instance()->markingworkflow) {
              $flags = $this->get_user_flags($userid, false);
              if (!empty($flags->workflowstate)) {
                  return $flags->workflowstate;
              }
              return ASSIGN_MARKING_WORKFLOW_STATE_NOTMARKED;
          } else {
              $attemptnumber = optional_param('attemptnumber', -1, PARAM_INT);
              $grade = $this->get_user_grade($userid, false, $attemptnumber);
  
              if (!empty($grade) && $grade->grade !== null && $grade->grade >= 0) {
                  return ASSIGN_GRADING_STATUS_GRADED;
              } else {
                  return ASSIGN_GRADING_STATUS_NOT_GRADED;
              }
          }
      }
code_tokens: public function get_grading_status ( $ userid ) { if ( $ this -> get_instance ( ) -> markingworkflow ) { $ flags = $ this -> get_user_flags ( $ userid , false ) ; if ( ! empty ( $ flags -> workflowstate ) ) { return $ flags -> workflowstate ; } return ASSIGN_MARKING_WORKFLOW_STATE_NOTMARKED ; } else { $ attemptnumber = optional_param ( 'attemptnumber' , - 1 , PARAM_INT ) ; $ grade = $ this -> get_user_grade ( $ userid , false , $ attemptnumber ) ; if ( ! empty ( $ grade ) && $ grade -> grade !== null && $ grade -> grade >= 0 ) { return ASSIGN_GRADING_STATUS_GRADED ; } else { return ASSIGN_GRADING_STATUS_NOT_GRADED ; } } }
docstring: Returns the grading status.
  
  @param int $userid the user id
  @return string returns the grading status
docstring_tokens: Returns the grading status .