Quiz is configured to show quiz feedback after quiz. Quiz feedback is configured and has content. No quiz feedback is shown after the quiz is finished.

Install and configure 6.0.0-alpha7 to display quiz feedback after quiz.

Inspecting the content.summary variable in the quiz-result.html.twig template shows nothing renderable, but I'm not even sure that that is what we're looking for. No feedback variable at all is being passed to the template.

There are so many issues relating to feedback in the issue queue that I can't tell whether any of them are related, this is apparently a weak spot for this module.

I'm testing as user 1, so permissions should not be affecting this issue for me.

Comments

stephenplatz created an issue. See original summary.

stephenplatz’s picture

Issue summary: View changes
stephenplatz’s picture

Issue summary: View changes
djdevin’s picture

Actually as user 1 you are considered a quiz scorer so you may see different feedback, but it's not the default.

On /admin/quiz/config/quiz if "Override administrator review options" is set then those will be shown instead of the ones configured on the quiz.

If that isn't the case, please provide more detailed steps to reproduce (how the quiz was configured, where you configured the feedback).

I just tested this and could not reproduce. The automated feedback tests are currently passing (QuizFeedbackTest).

stephenplatz’s picture

I do not have the "Override administrator review options" set on /admin/quiz/config/quiz. I'm configuring the feedback on the Quiz feedback tab on quiz/1/edit. On the Question feedback tab, I currently have every option checked under After the quiz. I'm happy to provide more info, but I'm not sure what other configuration options would be relevant here.

stephenplatz’s picture

I don't think QuizFeedbackTest tests quiz feedback, it looks like it only tests question feedback.

djdevin’s picture

Ah, it's QuizResultTest::testPassRateSummary

That seems to be passing as it's showing the Quiz feedback (pass/fail text) at the end of the quiz, so I'm not quite sure what the issue is.

stephenplatz’s picture

We want to show the result options, not the pass/fail options. I wonder if there is something I step through during runtime to get a better picture of what's happening, I think the tests are a little inconclusive in this case.

djdevin’s picture

QuizResultTest::testPassRateSummary tests both the generic pass/fail text and the result options (grade range feedback).

djdevin’s picture

StatusFileSize
new33.9 KB
new1.55 MB

Try a clean install of D9 and see if you can reproduce the issue there, here is what it should look like

quiz feedback example

I attached a video of what the setup looks like in a clean D9.

stephenplatz’s picture

Thanks for the video, that definitely helps to confirm that my configuration is correct. I'm afraid that testing this on a fresh Drupal installation won't help to uncover what's happening in this case, where the module is living in a complex application together with other modules, which is of course a normal use for it. The site where this is failing is a multi-lingual site, and although I'm not seeing anything logged with regard to the quiz results or feedback, I am able to throw an error here /admin/quiz/reports/results

Drupal\Core\Entity\Sql\SqlContentEntityStorageException: Table information not available for the 'langcode' field. in Drupal\Core\Entity\Sql\DefaultTableMapping->getFieldTableName() (line 391 of /app/web/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php).

I don't think this is related, but I started to think that there may be something else that is conflicting with showing the feedback. The important thing for me to really look at is where the possible places could be that would prevent the feedback from being passed finally to the template. In fact, with only Quiz feedback checked for after the quiz, only the fieldsets using quiz-question-score.html.twig are displayed, which are empty of any results.

stephenplatz’s picture

I noticed that the getRangeFeedback method on the the QuizResultViewBuilder class was not returning values, because the $score variable was always 50, well outside of the ranges that are set in config. In fact, the combined max score of the questions is only 8, so I need to track down where the score is getting set to 50.

djdevin’s picture

It's possible that the issue is language related but I'm not sure what it could be.

Regarding the score, Quiz will scale the final score based on maximum points to give it an N/100 score.

stephenplatz’s picture

That's definitely going to be a problem, since the getRangeFeedback method is comparing an N/100 value with straight range values i.e. 1, 2, 3 etc.

djdevin’s picture

I don't think so, the score passed to getRangeFeedback is between 0-100 and it's comparing the score (not points) entered on the quiz configuration.

Where are you seeing it passed the raw point values?

stephenplatz’s picture

function getRangeFeedback($quiz, $score) {    
     foreach ($quiz->get('result_options')->referencedEntities() as $paragraph) {                                                                                                                                                                                                                    
       $range = $paragraph->get('quiz_feedback_range')->get(0)->getValue();    
       if ($score >= $range['from'] && $score <= $range['to']) {    
          return $paragraph;    
        }    
      }    
    }

The $range['from'] and $range['to'] values are 0-1, or similar, not calculated based on a score that is N/100. If you step through the script, you will see the same.

stephenplatz’s picture

I can see now after re-watching your video, that you have entered percentages for range values on the form, but there isn't any indication to users that these values should be percentages of 100%. For the passing rate, that's indicated, so maybe this can be corrected by simply updating the form to indicate that ranges should be entered as percentages.

stephenplatz’s picture

StatusFileSize
new9.36 KB
djdevin’s picture

StatusFileSize
new18.69 KB

Ah, yes that would be it. We can add some help text.

In the D7 version it looked like this:

d7 range

stephenplatz’s picture

I agree, that's much more clear on the Drupal 7 form.

djdevin’s picture

Title: No quiz feedback shown after quiz » Add helptext for quiz grade range feedback
Status: Active » Fixed

  • 67be095 committed on 6.x
    Issue #3294807: Add helptext for quiz grade range feedback
    

Status: Fixed » Closed (fixed)

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