UJM-dev / ExoBundle

A Claroline plugin to create exercises
Other
5 stars 12 forks source link

Bug when importing qti questions with images #106

Open CPASimUSante opened 8 years ago

CPASimUSante commented 8 years ago

I tried to make a package with qti samples from https://www.imsglobal.org/question/index.html but when i imported as qti question i had this error.

500 Internal Server Error - ContextErrorException

Stack Trace
in vendor/ujm/exo-bundle/UJM/ExoBundle/Services/classes/QTI/qtiImport.php at line 211   -
            $extension = pathinfo($fileName, PATHINFO_EXTENSION);
            $hashName = $this->container->get('claroline.utilities.misc')->generateGuid() . '.' . $extension;
            $mimeType = $ob->getAttribute('type');
            $size = filesize($tmpFile);
            $targetFilePath = $filesDirectory . DIRECTORY_SEPARATOR . $hashName;
            copy($tmpFile, $targetFilePath);
            $file = new File();

my /web folder is 777, i've joined the file :

qti.zip

UJM-dev commented 8 years ago

Hi,

In exoBundle, we use the open graphic question (hotspotInteraction) : http://www.imsglobal.org/question/qtiv2p1/examples/items/select_point.xml

In the attachment the graphic question is a graphic question with choices (selectPointInteraction) : http://www.imsglobal.org/question/qtiv2p1/examples/items/hotspot.xml

For more sample see this link : http://www.imsglobal.org/question/qtiv2p1/imsqti_implv2p1.html

However, you should import an attached picture with the nice schema. Is it OK ?