original_string: public function get_short_question_name($stringtoshorten, $characterlimit)
      {
          if (!empty($stringtoshorten)) {
              $returnstring = format_string($stringtoshorten);
              if (strlen($returnstring) > $characterlimit) {
                  $returnstring = shorten_text($returnstring, $characterlimit, true);
              }
              return $returnstring;
          } else {
              return '';
          }
      }
code: public function get_short_question_name($stringtoshorten, $characterlimit)
      {
          if (!empty($stringtoshorten)) {
              $returnstring = format_string($stringtoshorten);
              if (strlen($returnstring) > $characterlimit) {
                  $returnstring = shorten_text($returnstring, $characterlimit, true);
              }
              return $returnstring;
          } else {
              return '';
          }
      }
code_tokens: public function get_short_question_name ( $ stringtoshorten , $ characterlimit ) { if ( ! empty ( $ stringtoshorten ) ) { $ returnstring = format_string ( $ stringtoshorten ) ; if ( strlen ( $ returnstring ) > $ characterlimit ) { $ returnstring = shorten_text ( $ returnstring , $ characterlimit , true ) ; } return $ returnstring ; } else { return '' ; } }
docstring: This function shortens a question name if it exceeds the character limit.
  
  @param string $stringtoshorten the string to be shortened.
  @param int $characterlimit the character limit.
  @return string
docstring_tokens: This function shortens a question name if it exceeds the character limit .