1

I have a quiz with 5 questions of 10 points each one. When I score them, some exams save the result of the quiz with more than 100 points.

enter image description here

As you can see, I have an exam with 112 but if I open:

enter image description here

Look that the total score is 92% (but his score is 112).

In the other hand, the user with 100 scores is right.

So, as summary of this, I've got users with right total score but some of them have a wrong final score.

The module that I'm using is Quiz drupal.org/project/quiz version 7.x-5.0-alpha9.

Any idea?

Thanks!

closed as off-topic by Mołot, Shawn Conn, Geoff, Yusef Mohamadi, Krishna Mohan Aug 18 '15 at 6:58

  • This question does not appear to be about Drupal within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    I'm voting to close this question as off-topic because it looks like a bugreport to whatever module you are using. And even if bugreports weren't defined off-topic here, you didn't post relevant data - link to module you are using, definition of your quiz, information on debug steps you already did, and so on. – Mołot Aug 6 '15 at 12:09
  • The module that I'm using is Quiz drupal.org/project/quiz version 7.x-5.0-alpha9. Maybe it can be a common error of the module. I haven't just found about it. – Andres Rojano Ruiz Aug 6 '15 at 12:33
  • Alpha versions are known to have bugs. They are early tests, before beta ("I hope there are no bugs") and release candidate ("I believe there are no bugs, but let's test one last time") – Mołot Aug 6 '15 at 13:48
  • @Mołot ... You're mostly right, except when there are alfa versions used in like 30K sites, such as drupal.org/project/usage/conditional_fields ... A sample of "versions" that are not correctly named anymore I think, would you agree that most of these 30K sites just ASSUME there are no bugs? – Pierre.Vriens Aug 6 '15 at 15:41
  • @Pierre.Vriens nope. All we know is that they assume quality level they are willing to accept. Apart from that, it's either a bug report or question lacks data needed to answer, version number on module changes nothing. – Mołot Aug 6 '15 at 16:12
1

Thanks everyone for your answer. Finally, I've achived to solve the problem. At first, this bug comes from last versions.

If you create in this module a Long Question which max score is 0, it creates an inconsistency because you cannot divide by 0.

Some months ago, I found a patch to solve it:

https://www.drupal.org/node/2394759

But it's incomplete, because the module save the scores of each question in database and then it updates the total score adding the score of each one.

So, the way to solve that is changing the next lines in the same file that the patch file (../question_types/long_answer/long_answer.module):

db_update('quiz_node_results_answer')
  ->fields(array(
     'points_awarded' => $points_awarded,
     'is_correct' => $is_correct,
))

to

db_update('quiz_node_results_answer')
  ->fields(array(
     'points_awarded' => $calculated_score,
     'is_correct' => $is_correct,
))

To note the change is the variable $points_awarded for the variable calculated in the patch: $calculated_score.

With these changes, the patch is complete and everything is working.

Not the answer you're looking for? Browse other questions tagged or ask your own question.