original_string: public function is_used_in_context($typeid, $courseid) {
          global $DB;
  
          $ok = $DB->record_exists('lti', array('course' => $courseid, 'typeid' => $typeid));
          return $ok || $DB->record_exists('lti_types', array('course' => $courseid, 'id' => $typeid));
      }
code: public function is_used_in_context($typeid, $courseid) {
          global $DB;
  
          $ok = $DB->record_exists('lti', array('course' => $courseid, 'typeid' => $typeid));
          return $ok || $DB->record_exists('lti_types', array('course' => $courseid, 'id' => $typeid));
      }
code_tokens: public function is_used_in_context ( $ typeid , $ courseid ) { global $ DB ; $ ok = $ DB -> record_exists ( 'lti' , array ( 'course' => $ courseid , 'typeid' => $ typeid ) ) ; return $ ok || $ DB -> record_exists ( 'lti_types' , array ( 'course' => $ courseid , 'id' => $ typeid ) ) ; }
docstring: Default implementation will check for the existence of at least one mod_lti entry for that tool and context.
  
  It may be overridden if other inferences can be done.
  
  Ideally a Site Tool should be explicitly engaged with a course, the check on the presence of a link is a proxy
  to infer a Site Tool engagement until an explicit Site Tool - Course relationship exists.
  
  @param int $typeid The tool lti type id.
  @param int $courseid The course id.
  @return bool returns True if tool is used in context, false otherwise.
docstring_tokens: Default implementation will check for the existence of at least one mod_lti entry for that tool and context .