Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#11 | how_to_create_a_quiz-2482983-11.patch | 4.85 KB | djdevin |
#6 | maxscore.jpg | 143.29 KB | strategicweb |
#5 | quiz-maxscore_increase-2482983-5-D7.patch | 597 bytes | strategicweb |
#3 | quiz-maxscore_increase-2482983-3-D7.patch | 598 bytes | strategicweb |
#2 | quiz-maxscore_increase-2482983-2-D7.patch.txt | 598 bytes | strategicweb |
Comments
Comment #1
djdevinI 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.
Comment #2
strategicweb CreditAttribution: strategicweb commentedNot 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.
Comment #3
strategicweb CreditAttribution: strategicweb commentedUpdating file (Starting line number) - made the change against the wrong file version
Comment #4
djdevinWith 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.
Comment #5
strategicweb CreditAttribution: strategicweb commentedMakes sense to me
Comment #6
strategicweb CreditAttribution: strategicweb commentedGetting 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?
Comment #7
djdevinThere'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.
Comment #8
djdevinComment #11
djdevinComment #13
djdevinTook out a bunch of unnecessary #maxlengths.