original_string: public function get_component_title() {
  
          $this->ensure_isset(array('context', 'component'));
  
          if ($this->get_context()->contextlevel == CONTEXT_SYSTEM) {
              if ($this->get_component() == 'core_grading') {
                  $title = ''; // we are in the bank UI
              } else {
                  throw new coding_exception('Unsupported component at the system context');
              }
  
          } else if ($this->get_context()->contextlevel >= CONTEXT_COURSE) {
              list($context, $course, $cm) = get_context_info_array($this->get_context()->id);
  
              if ($cm && strval($cm->name) !== '') {
                  $title = format_string($cm->name, true, array('context' => $context));
              } else {
                  debugging('Gradable areas are currently supported at the course module level only', DEBUG_DEVELOPER);
                  $title = $this->get_component();
              }
  
          } else {
              throw new coding_exception('Unsupported gradable area context level');
          }
  
          return $title;
      }
code: public function get_component_title() {
  
          $this->ensure_isset(array('context', 'component'));
  
          if ($this->get_context()->contextlevel == CONTEXT_SYSTEM) {
              if ($this->get_component() == 'core_grading') {
                  $title = ''; // we are in the bank UI
              } else {
                  throw new coding_exception('Unsupported component at the system context');
              }
  
          } else if ($this->get_context()->contextlevel >= CONTEXT_COURSE) {
              list($context, $course, $cm) = get_context_info_array($this->get_context()->id);
  
              if ($cm && strval($cm->name) !== '') {
                  $title = format_string($cm->name, true, array('context' => $context));
              } else {
                  debugging('Gradable areas are currently supported at the course module level only', DEBUG_DEVELOPER);
                  $title = $this->get_component();
              }
  
          } else {
              throw new coding_exception('Unsupported gradable area context level');
          }
  
          return $title;
      }
code_tokens: public function get_component_title ( ) { $ this -> ensure_isset ( array ( 'context' , 'component' ) ) ; if ( $ this -> get_context ( ) -> contextlevel == CONTEXT_SYSTEM ) { if ( $ this -> get_component ( ) == 'core_grading' ) { $ title = '' ; // we are in the bank UI } else { throw new coding_exception ( 'Unsupported component at the system context' ) ; } } else if ( $ this -> get_context ( ) -> contextlevel >= CONTEXT_COURSE ) { list ( $ context , $ course , $ cm ) = get_context_info_array ( $ this -> get_context ( ) -> id ) ; if ( $ cm && strval ( $ cm -> name ) !== '' ) { $ title = format_string ( $ cm -> name , true , array ( 'context' => $ context ) ) ; } else { debugging ( 'Gradable areas are currently supported at the course module level only' , DEBUG_DEVELOPER ) ; $ title = $ this -> get_component ( ) ; } } else { throw new coding_exception ( 'Unsupported gradable area context level' ) ; } return $ title ; }
docstring: Returns a text describing the context and the component
  
  At the moment this works for gradable areas in course modules. In the future, this
  method should be improved so it works for other contexts (blocks, gradebook items etc)
  or subplugins.
  
  @return string
docstring_tokens: Returns a text describing the context and the component