I would create reporting.quiz_score_report as a function and return the cursor to the calling block.