Reproduction steps:

1) Create a quiz.
2) In the "results pages" tab add the %RESULT_LINK% template to display a link to your result when finishing the quiz.
3) Publish your quiz or click the preview button.
4) Take the quiz and copy your results link:

format: https://[wp-host]/quiz/[quiz-name]/?result_id=[result_id]

5) Append <"><script>alert(document.domain)</script> to the result_id and reload the page.

Note (WPScanTeam): As the affected function is hooked to the wp_head action, only the result_id is required to perform the attack, no need to go to the quiz page, ie