original_string: public static function get_description($tool) {
          global $DB;
          $description = '';
          $context = \context::instance_by_id($tool->contextid);
          if ($context->contextlevel == CONTEXT_COURSE) {
              $course = $DB->get_record('course', array('id' => $context->instanceid));
              $description = $course->summary;
          } else if ($context->contextlevel == CONTEXT_MODULE) {
              $cmid = $context->instanceid;
              $cm = get_coursemodule_from_id(false, $context->instanceid, 0, false, MUST_EXIST);
              $module = $DB->get_record($cm->modname, array('id' => $cm->instance));
              $description = $module->intro;
          }
          return trim(html_to_text($description));
      }
code: public static function get_description($tool) {
          global $DB;
          $description = '';
          $context = \context::instance_by_id($tool->contextid);
          if ($context->contextlevel == CONTEXT_COURSE) {
              $course = $DB->get_record('course', array('id' => $context->instanceid));
              $description = $course->summary;
          } else if ($context->contextlevel == CONTEXT_MODULE) {
              $cmid = $context->instanceid;
              $cm = get_coursemodule_from_id(false, $context->instanceid, 0, false, MUST_EXIST);
              $module = $DB->get_record($cm->modname, array('id' => $cm->instance));
              $description = $module->intro;
          }
          return trim(html_to_text($description));
      }
code_tokens: public static function get_description ( $ tool ) { global $ DB ; $ description = '' ; $ context = \ context :: instance_by_id ( $ tool -> contextid ) ; if ( $ context -> contextlevel == CONTEXT_COURSE ) { $ course = $ DB -> get_record ( 'course' , array ( 'id' => $ context -> instanceid ) ) ; $ description = $ course -> summary ; } else if ( $ context -> contextlevel == CONTEXT_MODULE ) { $ cmid = $ context -> instanceid ; $ cm = get_coursemodule_from_id ( false , $ context -> instanceid , 0 , false , MUST_EXIST ) ; $ module = $ DB -> get_record ( $ cm -> modname , array ( 'id' => $ cm -> instance ) ) ; $ description = $ module -> intro ; } return trim ( html_to_text ( $ description ) ) ; }
docstring: Returns a description of the course or module that this lti instance points to.
  
  @param \stdClass $tool The lti tool
  @return string A description of the tool
  @since Moodle 3.2
docstring_tokens: Returns a description of the course or module that this lti instance points to .