Not sure if this is a issue related to the new quiz or to the "pages" functionality. But when I try to insert a page and then indent questions under it (to create a quiz on a page), I get an error saying that qnr_id and qnr_pid must be 4 characters and they are 5. I've looked for this definition in the code, but I can't find it (nor do I probably have enough experience to do so).

Any thoughts? Thanks!
-tiffani

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

edboost’s picture

Actually, searched some more and found the max values in quiz.admin.inc and raised to 5.

Process goes through now.

Have not gotten the page to work, but at least it's not erroring out.

Sorry to post prematurely. But, if anyone thinks my hack might be preventing the single page from working, please chime in!

Thanks!

edboost’s picture

Nevermind -- it works!

But please do chime in if you think my hack broke something I can't see.
And, it might be worth upping that value if I'm not the only one with really long ids.

djdevin’s picture

Do you have more than 9,999 questions?

I'll see if there's a better way to do this.

edboost’s picture

No, I only have about 2500 questions. But... there are LOTS of revisions of each question and I feel like that might be boosting the numbers. Is that possible?

Changing the max values does seem to be working, even if it's not an elegant fix.

Quizzes, are, intermittently (or does it vary by quiz I can't figure it out!) not scoring properly (sometimes they don't assess answers at all... sometimes some questions assess and others don't). Don't think it's related to my hack, but haven't tracked it down well enough yet.

Back to the issue cue for me!

Thanks for looking into it.

Sherif Darwish’s picture

FileSize
62.83 KB
64.91 KB

Hi,

i am also getting the same error message "qnr_ids cannot be longer than 4 characters but is currently 5 characters long." when i try to manage questions assigned to quiz from node/[nid]/quiz/questions , every time i try to save i receive this error

i went through the form validate handler and i can see the field qnr_id defined as below have a maximum length as 4 characters and this is why i am receiving the error, i am not sure however why it have this maximum as the database column is int(10)

I updated the maximum length #maxlength to 6 and it worked with me but not sure if this can have an impact somewhere else

by the way, i only have around 300 questions but it seems the number is getting higher because of the revisions

    $form[$fieldset]['qnr_ids'][$id] = array(
      '#type' => 'textfield',
      '#size' => 3,
      '#maxlength' => 4,
      '#default_value' => $question->qnr_id,
djdevin’s picture

Version: 7.x-5.0-alpha7 » 7.x-5.x-dev
Status: Active » Needs review
FileSize
796 bytes

There's no reason to have #maxlength here, so let's remove it.

@edboost haven't been able to reproduce Quizzes not scoring...but if you do figure out please open a new issue.

djdevin’s picture

Status: Needs review » Fixed

Fixed!

  • djdevin committed d7ae9dd on 7.x-5.x
    Issue #2408959 by Sherif Darwish, edboost, djdevin: qnr_id and qnr_pid...

Status: Fixed » Closed (fixed)

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