Hi,

I am completely stumped on how I can set the max score of a quiz question to greater than 99? In my instance I need to set the max score of 150. When I try to set it I get: "max_scores cannot be longer than 2 characters but is currently 3 characters long."

Is there any way to override this?

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

djdevin’s picture

I believe this is just an arbitrary limit and nobody had questions worth more than 99 points.

We just have to check to make sure that the number can be stored correctly in the database. I am fairly sure they are just integers so removing the limit would be fine.

If you wanted to try you could just search for #maxlength and remove that line otherwise I will work on a patch...it appears to be in other places as well.

strategicweb’s picture

Not sure exactly how to submit a patch, but this should at least outline where the change needs to be made. Set it to a length of 11 as that is the size in the database.

strategicweb’s picture

Updating file (Starting line number) - made the change against the wrong file version

djdevin’s picture

With Drupal the #size is a soft constraint, it determines the visible length of the field, I think we should keep that to 3 or 4. Otherwise we'll end up with really long input fields which don't look nice.

#maxlength is the one that makes it a hard constraint.

strategicweb’s picture

Makes sense to me

strategicweb’s picture

FileSize
143.29 KB

Getting an issue with marking the quiz: "The score needs to be a number between 0 and 10" even though the question is set to a score of 100. Any idea whereabouts this validation is happening?

djdevin’s picture

There's a variable globally that sets the max long answer score. It's in Admin->Quiz under question configuration.

Though I'm not quite sure why that's necessary, you should be able to set the max per-question.

djdevin’s picture

Version: 7.x-5.0-alpha9 » 7.x-5.x-dev
Status: Active » Needs review

The last submitted patch, 3: quiz-maxscore_increase-2482983-3-D7.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 5: quiz-maxscore_increase-2482983-5-D7.patch, failed testing.

djdevin’s picture

Status: Needs work » Needs review
FileSize
4.85 KB

  • djdevin committed e3ddeea on 7.x-5.x
    Issue #2482983 by strategicweb, djdevin: How to create a quiz max score...
djdevin’s picture

Status: Needs review » Fixed

Took out a bunch of unnecessary #maxlengths.

Status: Fixed » Closed (fixed)

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