Moodle

Several issues with QTI v2 export

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 1.9, 1.9.1, 1.9.2
  • Fix Version/s: None
  • Component/s: Questions
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

I've been having a look at the QTI2 export facility, and have found quite a few problems - it took quite a lot of editing to get any items to play in either the R2Q2 or APIS QTI2 item players, and even then they were incomplete. I've mostly been looking at choice items.

Issues that all exported item types have

  • Schema declaration is incorrect
  • The extra schema declaration in response processing shouldn't be there.
  • Images that are included in XHTML are missing from the exported content package.

Issues specific to multiple choice items

  • General feedback is not included.
  • Overall feedback is not included.
  • The 'FEEDBACK' variable is not declared.
  • The option specific feedback is displayed at the end of the item rather than beside the option.
  • Scoring is broken, a simple MCQ item with correct score of 2 and incorrect of 0 became 1 and -1 respectively.
  • Identifiers are integers, which is not allowed.

Content package issues

  • Content package structure is wrong, the manifest is in a sub-directory.
  • Resource file names and paths are incorrect in the manifest.

I've created a new template for choice items that creates items that can be rendered and processed using R2Q2 (from http://www.qtitools.org/), which I've attached. This template also needs a few lines changed in moodle/question/format/qti2/format.php - I've attached an updated version.

My template currently ignores grade settings so all items are exported with a default question grade of 1. I've also only tested it with a couple of test items - it needs further testing with a greater variety of items.

  1. choiceMultiple.tpl
    30/Jul/08 11:24 PM
    4 kB
    Niall Barr
  2. format.php
    26/Aug/08 10:15 PM
    35 kB
    Niall Barr
  3. match.tpl
    26/Aug/08 4:59 PM
    3 kB
    Niall Barr
  4. qti.patch
    13/May/09 9:12 PM
    3 kB
    Penny Leach
  5. truefalse.tpl
    26/Aug/08 10:15 PM
    2 kB
    Niall Barr

Issue Links

Activity

Hide
Howard Miller added a comment -

Files updated. Will there be more or are we closing this report now?

Show
Howard Miller added a comment - Files updated. Will there be more or are we closing this report now?
Hide
Niall Barr added a comment -

I'll work through the other item types and also try and fix the content package structure, so leave it open for now.

Show
Niall Barr added a comment - I'll work through the other item types and also try and fix the content package structure, so leave it open for now.
Hide
Niall Barr added a comment -

New template for matching items, and slightly modified question/format/qti2/format.php to work with it.

Show
Niall Barr added a comment - New template for matching items, and slightly modified question/format/qti2/format.php to work with it.
Hide
Niall Barr added a comment -

This is a template for true/false items based on the previous choice template (which, I think, is no longer needed if this one is used).

Also, as before, a new version of format.php that adds support for this template.

Show
Niall Barr added a comment - This is a template for true/false items based on the previous choice template (which, I think, is no longer needed if this one is used). Also, as before, a new version of format.php that adds support for this template.
Hide
Penny Leach added a comment -

Custom qtypes are also not supported - I wouldn't think this would be too hard to implement similar to the xml and whatever else export formats.

Also, it seems as though at some point the qtypes had numeric ids - see function get_qtype in the qti format class - it switches on constant type and returns a string, but, the values of those constants are the same strings... this could be done with constant($type_id) instead, which would not only be more elegant, but help towards supporting plugins (which is my end goal for the next few days).

Show
Penny Leach added a comment - Custom qtypes are also not supported - I wouldn't think this would be too hard to implement similar to the xml and whatever else export formats. Also, it seems as though at some point the qtypes had numeric ids - see function get_qtype in the qti format class - it switches on constant type and returns a string, but, the values of those constants are the same strings... this could be done with constant($type_id) instead, which would not only be more elegant, but help towards supporting plugins (which is my end goal for the next few days).
Hide
Penny Leach added a comment -

Actually this is not even needed. It can just use $type_id itself as the qtype string - no need to even call constant() on it.

Show
Penny Leach added a comment - Actually this is not even needed. It can just use $type_id itself as the qtype string - no need to even call constant() on it.
Hide
Howard Miller added a comment -

While we're at it we're going to add the hook for custom question types. Just testing and waiting for it not to be Tuesday!

Show
Howard Miller added a comment - While we're at it we're going to add the hook for custom question types. Just testing and waiting for it not to be Tuesday!
Hide
Penny Leach added a comment -

Further comments about hooks that I typed in to skype at Howard while he was away

[10:09:30] ... I started looking at the qti pluggability issue
[10:09:34] ... and it looks as though it's quite simple,
[10:09:37] ... to do something like:
[10:09:58] ... http://rafb.net/p/4oS8oC95.html
[10:10:01] ... in the big switch() statement
[10:10:12] ... but we need to pass the smarty object to that method
[10:10:17] ... is that what $extras is for ?
[10:12:04] ... because it needs to use all the stuff that smarty has already been assigned , I think
[10:15:27] ... I think it should take the smarty object in $extras by reference, so it can ->assign() , and then return $template which will have to be a fullpath, like question/type/mycustomhack/templates/qti2.tpl
[10:15:31] ... or the template path could even by by contract

Show
Penny Leach added a comment - Further comments about hooks that I typed in to skype at Howard while he was away [10:09:30] ... I started looking at the qti pluggability issue [10:09:34] ... and it looks as though it's quite simple, [10:09:37] ... to do something like: [10:09:58] ... http://rafb.net/p/4oS8oC95.html [10:10:01] ... in the big switch() statement [10:10:12] ... but we need to pass the smarty object to that method [10:10:17] ... is that what $extras is for ? [10:12:04] ... because it needs to use all the stuff that smarty has already been assigned , I think [10:15:27] ... I think it should take the smarty object in $extras by reference, so it can ->assign() , and then return $template which will have to be a fullpath, like question/type/mycustomhack/templates/qti2.tpl [10:15:31] ... or the template path could even by by contract
Hide
Penny Leach added a comment -

might be easier to just force the template to be question/type/mycustomhack/format/qti2/template.tpl for all custom plugins.

Show
Penny Leach added a comment - might be easier to just force the template to be question/type/mycustomhack/format/qti2/template.tpl for all custom plugins.
Hide
Howard Miller added a comment -

We have some stuff to commit (based on the attached files) - it should certainly improve things.

The hook for custom questions is identical to that for "Moodle XML" format in which the 'extra' parameter is unused. Extra was intended to be defined by the particular format on an 'as required' basic. For example, in GIFT it passed the already parsed answers part rather than the plugin having to do it again.

Show
Howard Miller added a comment - We have some stuff to commit (based on the attached files) - it should certainly improve things. The hook for custom questions is identical to that for "Moodle XML" format in which the 'extra' parameter is unused. Extra was intended to be defined by the particular format on an 'as required' basic. For example, in GIFT it passed the already parsed answers part rather than the plugin having to do it again.
Hide
Penny Leach added a comment -

This patch adds enough hooks for plugins that I managed to get my custom one to be included.

Note that this is NOT a pure patch against 19stable, but it's small and will give you an idea of what I'm doing. The file I'm patching (ims/questionformat.php) just subclasses question/format/qti2/format.php so the patches should just apply clean there too.

Show
Penny Leach added a comment - This patch adds enough hooks for plugins that I managed to get my custom one to be included. Note that this is NOT a pure patch against 19stable, but it's small and will give you an idea of what I'm doing. The file I'm patching (ims/questionformat.php) just subclasses question/format/qti2/format.php so the patches should just apply clean there too.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Vote (1)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: