public function refreshIdentifiers(AbstractItem $item)
    {
        $text = $item->getText();

        /** @var Hole $hole */
        foreach ($item->getHoles() as $hole) {
            // stash current id
            $oldId = $hole->getUuid();

            // generate new id for hole
            $hole->refreshUuid();

            // replace placeholder in text
            $text = str_replace('[['.$oldId.']]', '[['.$hole->getUuid().']]', $text);
        }

        $item->setText($text);
    }
public function refreshIdentifiers(AbstractItem $item)
    {
        $text = $item->getText();

        /** @var Hole $hole */
        foreach ($item->getHoles() as $hole) {
            // stash current id
            $oldId = $hole->getUuid();

            // generate new id for hole
            $hole->refreshUuid();

            // replace placeholder in text
            $text = str_replace('[['.$oldId.']]', '[['.$hole->getUuid().']]', $text);
        }

        $item->setText($text);
    }
public function refreshIdentifiers ( AbstractItem $ item ) { $ text = $ item -> getText ( ) ; /** @var Hole $hole */ foreach ( $ item -> getHoles ( ) as $ hole ) { // stash current id $ oldId = $ hole -> getUuid ( ) ; // generate new id for hole $ hole -> refreshUuid ( ) ; // replace placeholder in text $ text = str_replace ( '[[' . $ oldId . ']]' , '[[' . $ hole -> getUuid ( ) . ']]' , $ text ) ; } $ item -> setText ( $ text ) ; }
Refreshes hole UUIDs and update placeholders in text.

@param ClozeQuestion $item
Refreshes hole UUIDs and update placeholders in text .