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 '';
        }
    }
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 '';
        }
    }
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 '' ; } }
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
This function shortens a question name if it exceeds the character limit .