original_string: public function get_marking_workflow_states_for_current_user() {
          if (!empty($this->markingworkflowstates)) {
              return $this->markingworkflowstates;
          }
          $states = array();
          if (has_capability('mod/assign:grade', $this->context)) {
              $states[ASSIGN_MARKING_WORKFLOW_STATE_INMARKING] = get_string('markingworkflowstateinmarking', 'assign');
              $states[ASSIGN_MARKING_WORKFLOW_STATE_READYFORREVIEW] = get_string('markingworkflowstatereadyforreview', 'assign');
          }
          if (has_any_capability(array('mod/assign:reviewgrades',
                                       'mod/assign:managegrades'), $this->context)) {
              $states[ASSIGN_MARKING_WORKFLOW_STATE_INREVIEW] = get_string('markingworkflowstateinreview', 'assign');
              $states[ASSIGN_MARKING_WORKFLOW_STATE_READYFORRELEASE] = get_string('markingworkflowstatereadyforrelease', 'assign');
          }
          if (has_any_capability(array('mod/assign:releasegrades',
                                       'mod/assign:managegrades'), $this->context)) {
              $states[ASSIGN_MARKING_WORKFLOW_STATE_RELEASED] = get_string('markingworkflowstatereleased', 'assign');
          }
          $this->markingworkflowstates = $states;
          return $this->markingworkflowstates;
      }
code: public function get_marking_workflow_states_for_current_user() {
          if (!empty($this->markingworkflowstates)) {
              return $this->markingworkflowstates;
          }
          $states = array();
          if (has_capability('mod/assign:grade', $this->context)) {
              $states[ASSIGN_MARKING_WORKFLOW_STATE_INMARKING] = get_string('markingworkflowstateinmarking', 'assign');
              $states[ASSIGN_MARKING_WORKFLOW_STATE_READYFORREVIEW] = get_string('markingworkflowstatereadyforreview', 'assign');
          }
          if (has_any_capability(array('mod/assign:reviewgrades',
                                       'mod/assign:managegrades'), $this->context)) {
              $states[ASSIGN_MARKING_WORKFLOW_STATE_INREVIEW] = get_string('markingworkflowstateinreview', 'assign');
              $states[ASSIGN_MARKING_WORKFLOW_STATE_READYFORRELEASE] = get_string('markingworkflowstatereadyforrelease', 'assign');
          }
          if (has_any_capability(array('mod/assign:releasegrades',
                                       'mod/assign:managegrades'), $this->context)) {
              $states[ASSIGN_MARKING_WORKFLOW_STATE_RELEASED] = get_string('markingworkflowstatereleased', 'assign');
          }
          $this->markingworkflowstates = $states;
          return $this->markingworkflowstates;
      }
code_tokens: public function get_marking_workflow_states_for_current_user ( ) { if ( ! empty ( $ this -> markingworkflowstates ) ) { return $ this -> markingworkflowstates ; } $ states = array ( ) ; if ( has_capability ( 'mod/assign:grade' , $ this -> context ) ) { $ states [ ASSIGN_MARKING_WORKFLOW_STATE_INMARKING ] = get_string ( 'markingworkflowstateinmarking' , 'assign' ) ; $ states [ ASSIGN_MARKING_WORKFLOW_STATE_READYFORREVIEW ] = get_string ( 'markingworkflowstatereadyforreview' , 'assign' ) ; } if ( has_any_capability ( array ( 'mod/assign:reviewgrades' , 'mod/assign:managegrades' ) , $ this -> context ) ) { $ states [ ASSIGN_MARKING_WORKFLOW_STATE_INREVIEW ] = get_string ( 'markingworkflowstateinreview' , 'assign' ) ; $ states [ ASSIGN_MARKING_WORKFLOW_STATE_READYFORRELEASE ] = get_string ( 'markingworkflowstatereadyforrelease' , 'assign' ) ; } if ( has_any_capability ( array ( 'mod/assign:releasegrades' , 'mod/assign:managegrades' ) , $ this -> context ) ) { $ states [ ASSIGN_MARKING_WORKFLOW_STATE_RELEASED ] = get_string ( 'markingworkflowstatereleased' , 'assign' ) ; } $ this -> markingworkflowstates = $ states ; return $ this -> markingworkflowstates ; }
docstring: Get the list of marking_workflow states the current user has permission to transition a grade to.
  
  @return array of state => description
docstring_tokens: Get the list of marking_workflow states the current user has permission to transition a grade to .