public static function stringToCoords($string, $shape)
    {
        if (Format::isCoords($string)) {

            $stringCoords = explode(",", $string);
            $intCoords = array();

            foreach ($stringCoords as $sC) {
                $intCoords[] = intval($sC);
            }

            // Maybe it was accepted has coords, but is it buildable with
            // the given shape?
            return new QtiCoords($shape, $intCoords);
        } else {
            throw new UnexpectedValueException("'${string}' cannot be converted to Coords.");
        }
    }