original_string: public static function create_cartridge($toolid) {
          $cartridge = new \DOMDocument();
          $cartridge->load(realpath(__DIR__ . '/../xml/imslticc.xml'));
          $xpath = new \DOMXpath($cartridge);
          $xpath->registerNamespace('cc', 'http://www.imsglobal.org/xsd/imslticc_v1p0');
          $parameters = self::get_cartridge_parameters($toolid);
          self::set_xpath($xpath, $parameters);
  
          return $cartridge->saveXML();
      }
code: public static function create_cartridge($toolid) {
          $cartridge = new \DOMDocument();
          $cartridge->load(realpath(__DIR__ . '/../xml/imslticc.xml'));
          $xpath = new \DOMXpath($cartridge);
          $xpath->registerNamespace('cc', 'http://www.imsglobal.org/xsd/imslticc_v1p0');
          $parameters = self::get_cartridge_parameters($toolid);
          self::set_xpath($xpath, $parameters);
  
          return $cartridge->saveXML();
      }
code_tokens: public static function create_cartridge ( $ toolid ) { $ cartridge = new \ DOMDocument ( ) ; $ cartridge -> load ( realpath ( __DIR__ . '/../xml/imslticc.xml' ) ) ; $ xpath = new \ DOMXpath ( $ cartridge ) ; $ xpath -> registerNamespace ( 'cc' , 'http://www.imsglobal.org/xsd/imslticc_v1p0' ) ; $ parameters = self :: get_cartridge_parameters ( $ toolid ) ; self :: set_xpath ( $ xpath , $ parameters ) ; return $ cartridge -> saveXML ( ) ; }
docstring: Create an IMS cartridge for the tool.
  
  @param int $toolid The id of the shared tool
  @return string representing the generated cartridge
  @since Moodle 3.2
docstring_tokens: Create an IMS cartridge for the tool .