I am trying to create a quiz and keep getting the following error msg: "Option has a summary, but no name."

I don't see any required field that I haven't filled out. What am I doing wrong?

Thanks!

Comments

WoozyDuck’s picture

Same error I get when trying to set the Quiz summary options

dleonard’s picture

Version: 6.x-3.4 » 6.x-3.5

I have the same issue in 6.x-3.5.

falcon’s picture

I'm not very familiar with the 3.x version of quiz, but I think that you have to give all "active" summary options a name. The names are not marked as required because you can leave the entire summary option blank.

simon georges’s picture

Version: 6.x-3.5 » 6.x-4.0-rc7

I have the same issue in 6.x-4.0-rc7.
Maybe because of some WYSIWYG editor, always having a <p></p> or a <br> inside ?

Regards,

simon georges’s picture

Component: Miscellaneous » Code - Quiz module
Category: support » bug

Actually, it's a bug, I guess, not a support request... isn't it ?

hiddentao’s picture

Yeah I think it's definitely due to a WYSIWYG editor putting in <p>&nbsp;</p>. I'm using FCKEditor on my site. Thing is, the summary field seems to explain plaintext (no WYSIWYG support) so in the form constructions it's obviously re-using a default value from other form fields.

simon georges’s picture

Would it be possible to "force" plain text fields on "Quiz" content type, at least on fields used by quiz module ?

hiddentao’s picture

Well, it might be nice to enable WYSIWYG editing for other fields in a Quiz. So perhaps what's needed is to nullify the summary field for result options (using hook_form_alter()).

hiddentao’s picture

Inside a hook_form_alter I run the following:

switch ($form_id) {

      case 'quiz_node_form':

        foreach ($form['resultoptions'] as $i => &$info) {
            if (is_numeric($i)) {
               unset($info['format']);
            }
        }
      break;
}

This removes WYSIWYG editing for the 'summary' field of Result Options. Saving the Quiz then works without the above error. This probably isn't the most elegant solution but it will work as a quick fix.

simon georges’s picture

Each time a format is added, quiz module calls _quiz_format_mod($form['resultoptions'][$i]['format']);, so I guess there's something to do here... I need to go deeper into my input filter knowledge ;)

simon georges’s picture

Otherwise, maybe we just have to wait for #550428: Tags like "&nbsp;" or "<p>&nbsp;</p>" or "<br />" added to empty textareas. to be fixed ?

falcon’s picture

Thanks for reporting

I've been quite busy lately, but I'll create/find a fix for this soon. I think I'll try to create a (regexp) function that figures out if a box is empty or not. It will have to consider most tags, spaces, linebreaks etc. as empty. img tags, object tags and embed tags must not be considered as empty.

simon georges’s picture

@falcon: I really think it's a WYSIWYG bug, so the fix has no reason to be into Quiz module (IMHO).
The only fix that could be into Quiz module would be to remove WYSIWYG from Quiz fields, I think. Don't you agree ? It would ease maintenance, and be indenpendant from WYSIWYG editors future changes.

My 2 cents,

falcon’s picture

Status: Active » Fixed

I've tried to provide a fix for this now. Fix was just commited, and will be a part of the next release of quiz. Please re-open this issue if the fix doesn't help...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.