Cristopher Ewing <[email protected]> writes:
> [reposting after fixing my subscription email address, apologies]
[...]
> Unfortunately, it appears that the qti import functionality is not
> working as one might expect. I can upload a zip file as exported
> from the other system, but the upload does nothing.
>
> I'm currently playing with plone 3.3.5 and ECQuiz 1.2.1b1dev-r158 as
> found at pypi (installed via buildout as an egg).
>
> Here's what I'm finding:
>
> in Products.ECQuiz.qti.importPackage the list of files in the
> ZipFile from the form upload is derived like so:
>
> fileNameList = [context.unicodeDecode(f.filename) for f in
> zipFileObject.filelist]
>
> In my case here, that returns a list of unicode strings something like this:
>
> [u'quiz-arthritis-arthritis_arthritis_-20100414-1221/',
> u'quiz-arthritis-arthritis_arthritis_-20100414-1221/imsmanifest.xml',
> u'quiz-arthritis-arthritis_arthritis_-20100414-1221/question1.xml',
> u'quiz-arthritis-arthritis_arthritis_-20100414-1221/question10.xml',
> ...]
>
> as you can see, the filenames seen here all include the name of the
> folder that was first turned into the zipfile archive by the qti
> exporter in the other system (which I have no control over). When
> ECQuiz tries to find a manifest for this package, the following code
> is used:
>
> manifestFnList = [fn for fn in fileNameList if fn.lower() ==
> MANIFEST_FILE_NAME]
>
> where MANIFEST_FILE_NAME is u'imsmanifext.xml'. I'm sure you can
> see that this is going to fail, since although I do have a manifest
> in my zipfile archive, its name includes the name of the containing
> folder. If I change the above to this:
>
> manifestFnList = [fn for fn in fileNameList if MANIFEST_FILE_NAME in
> fn.lower()]
>
> then I get a manifest and the processing fails a bit further on.
> The problem at that point is also that the names of the xml files
> for each resource in my quiz as indexed by the zipfile include the
> name of the containing folder, whereas the names of the resources as
> listed in the manifest xml code look like this:
>
> u'./question1.xml'
[...]
You're right, ECQuiz expects the manifest in the top level directory
of the zip file, and all resource references are expected to be
relative to the top level directory, not relative to the location of
the manifest. Browsing the QTI specification I found no concrete
evidence that this is how packages are supposed to look. So the code
is probably just intolerant/dumb.
One obvious workaround would be to repackage your packages so
everything is contained in the top-level directory, not a sub-folder.
A real fix might be to extend 'readFromZip' so it accepts an
additional directory name, which would be the directory in which the
imsmanifest.xml resides. Every filename that 'readFromZip' is given
would then be expected to be relative to that directory.
Also, the statement
manifestFnList = [fn for fn in fileNameList
if fn.lower() == MANIFEST_FILE_NAME]
would have to become something like
manifestFnList = [fn for fn in fileNameList
if os.path.split(fn)[-1].lower() ==
MANIFEST_FILE_NAME]
> I could probably figure out a work-around for this one, too, at
> which point I suspect the import would work fine, but I'd really
> like to contribute this fix to the product. Here's where the second
> part of my subject comes into play.
>
> Back in January of 2009 a plea was made to move the repository for
> the eduComponents code to the plone collective
> (http://listserv.uni-magdeburg.de/pipermail/educomponents/2009-January/000265.html).
> After a bit of hopeful-looking thread, it came back that that would
[...]
I'm sorry, but I cannot help you with the second part since I'm not in
a position to do anything about it.
--
Wolfram Fenske
A: Yes.
>Q: Are you sure?
>>A: Because it reverses the logical flow of conversation.
>>>Q: Why is top posting frowned upon?
_______________________________________________
eduComponents mailing list
[email protected]
https://listserv.uni-magdeburg.de/mailman/listinfo/educomponents