original_string: public function get_course_name(\context $context) {
          $courseid = $this->courseid;
          if (empty($courseid)) {
              return get_string('site');
          } else {
              try {
                  $course = get_course($courseid);
                  return format_string($course->fullname, true, array('context' => $context));
              } catch (\dml_exception $e) {
                  return '-';
              }
          }
      }
code: public function get_course_name(\context $context) {
          $courseid = $this->courseid;
          if (empty($courseid)) {
              return get_string('site');
          } else {
              try {
                  $course = get_course($courseid);
                  return format_string($course->fullname, true, array('context' => $context));
              } catch (\dml_exception $e) {
                  return '-';
              }
          }
      }
code_tokens: public function get_course_name ( \ context $ context ) { $ courseid = $ this -> courseid ; if ( empty ( $ courseid ) ) { return get_string ( 'site' ) ; } else { try { $ course = get_course ( $ courseid ) ; return format_string ( $ course -> fullname , true , array ( 'context' => $ context ) ) ; } catch ( \ dml_exception $ e ) { return '-' ; } } }
docstring: Get properly formatted name of the course associated.
  
  @param \context $context context where this name would be displayed.
  @return string Formatted name of the rule.
docstring_tokens: Get properly formatted name of the course associated .