I had to create a new "Long Menu" question type (for one of my clients), which I also want to give to the community. This is a first draft, but at least it works on my client's site. Next steps will include better descriptions at the question creation form fields and better comments in the code (for fellow developers and better bug hunting).

Comments

raphaelhuefner’s picture

What I forgot to mention: this shall work with quiz-6.x-4.x-dev, at least that's the quiz version it was developed for.

falcon’s picture

Version: 6.x-4.x-dev » 6.x-5.x-dev

Thanks for contributing! I'll test this one in my spare time soon! Hopefully others will test it as well. Right now I move it to the 5.x issue list. We only want bug reports in this one. If and when your module works perfectly I'll include it in 4.x, but the main priority is to finish 4.x.

To be clear: If everything is okay with your module we will add it to 4.x. If not it will be added later when everything is okay with it.

raphaelhuefner’s picture

StatusFileSize
new24.64 KB

Added README.txt to clarify what this thing actually does (with much text, crafted to be hopefully understandable ;-) , and with explanation links, even to some scientific paper).
Added a (for me overwhelming ;-) number of docblocks and inline comments.
Added meaningful descriptions in UI.

vegardjo’s picture

Hia,

and thanks, this sound cool, I'll definitely test it! However, when I tried that right now (with quiz-6.x-4.x-dev from today) I get this:

Fatal error: Call to undefined function long_menu_get_or_create_vocabulary() in /Applications/MAMP/htdocs/april/sites/all/modules/quiz/question_types/long_menu/long_menu.install on line 22

This happened when I was to save the admin/build/modules page after enabling the module. I get the same on two different installs.

raphaelhuefner’s picture

Hi vegardjo,

thank you for taking the time testing it and for your feedback!

Here is a quick fix: Just comment or delete this line 22 in the file long_menu.install.

I'll load up a new version with that soon.

Regards,
raphaelhuefner

raphaelhuefner’s picture

StatusFileSize
new24.79 KB

- (Hopefully) Removed the Fatal error reported by vegardjo
- Fixed bug in handling empty answers.
- Try calling node_types_rebuild() (see http://api.drupal.org/api/function/node_types_rebuild/6 ) in hook_enable() for introducing new question node type to Drupal, but this still does not the trick. See the "Troubleshooting" section in README.txt.

raphaelhuefner’s picture

StatusFileSize
new24.84 KB

- Now hopefully gets quiz_question to correctly announce the new long_menu node type.

vegardjo’s picture

StatusFileSize
new127.22 KB
new31.18 KB
new106.29 KB
new43.85 KB
new71.59 KB
new75.18 KB
new45.8 KB

Aight, now it worked!

First of all, I didn't initially understand how this was supposed to work from reading the description, but now that I have tried it I see many possible use cases! :) I'm a bit confused of the "Long menu" name as it doesn't seem to describe what you do? But it seems to be an established name for these kind of questions?

Anyway, if we get it bug tested (+ fixed) and polished in time I would say this is a very good addition to Quiz 4!

So, some issues in no particular order:

  1. Entities like ' are shown as html codes in the dropdown, see first screenshot. Oh, and related in textfields, see screenshot six too.
  2. Some smallish style issues for the quiz taker: long alternatives break over two lines, and the lines need some more spacing between them (disclaimer: not tested on say Garland, so this might be my issue). See second screenshot.
  3. Alternatives that has been chosen are still available in the dropdown, also second screenshot.
  4. The question report needs more polish too. It's not perfectly clear what was correct answers and what was distractors. Also distractor feedback shows inline with the distractor alternatives, not making it clear. Also, I believe I had a default feedback that didn't show. See third screenshot.
  5. Regarding the last point, keep an eye on this issue: #779632: Make quiz more themer friendly / add more template files as I personally would prefer each question type in Quiz 4 to be shipped with two template files, one for the taking of it and one for the report.
  6. You get an error message saying "You must provide at least two words as answer", but an (as in one) alternative may contain more than two words. Should probably be "you must provide at least two answers". See fourth screenshot.
  7. Related: Minimum and maximum answer count is required, why? I'd say if they are empty there are no min or max value here.
  8. When creating my second quiz with long menu question in, I could chose from ALL taxonomy terms on the site, not only the ones in the Long menu taxonomy, see fifth screenshot.
  9. When navigationg to /admin/content/taxonomy, chosing the long menu taxonomy and "list terms" I get no terms showing. I can add new ones directly though.
  10. You use the wording "Taxonomy terms used as correct answers and distractors" - In my opinion "taxonomy terms" are Drupalspeak and the quiz creator does not need to know that you use the Drupal taxonomies to store this. It could be renamed simply to "Answers and distractors". Also "term 1" etc. could be "alternative 1" etc.
  11. You use both taxonomies and textfields to do the same thing (add answers and distractors)? Of the two I guess I prefer the taxonomies for the reusability of answers.
  12. You can not give negative points on alternatives, or rather distractors? Don't know if you should, but it struck me.
  13. Regarding importing and exporting we can now do that for most question types in quiz I believe, do you know if that would be possible for this question type? I know turadg of the maintainers is the one who knows the ins and outs of this.
  14. (meta issue not related to Long menu: Quiz import / export should ideally be compatible with Quiz itself, not only partially through different standards)
  15. If you view a question outside of a quiz (click the title from the question browser) you get a lot of code output. See seventh screenshot.

I'll be happy to test more but will be pretty much unavailable from about now till late next week.

And again, really cool module and great work! :)

raphaelhuefner’s picture

Thank you, vegardjo, for the thorough review!

As far as I can see it now, I will really have to address all the issues you found.

djdevin’s picture

Component: Code » Code - Quiz core
Issue summary: View changes
Status: Active » Closed (outdated)

This issue is being closed because it was filed against a version that is no longer supported. If the issue still persists in the latest version of Quiz, please open a new issue.