Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in "Marking Guide Breakdown Report" with Advanced Grading #42

Open
ycordelpro opened this issue Jan 17, 2025 · 1 comment
Open

Comments

@ycordelpro
Copy link

ycordelpro commented Jan 17, 2025

Hello,

In the assignment activity, when "Advanced Grading" is enabled and both the rubric form and the marking guide form are completed, an error occurs when clicking on the "Marking Guide Breakdown Report" tab.

Image

In debug mode, the error message indicates that the 'get_grading_definition' method returns more than one row.

To resolve this issue, we have added the active method to the request.

diff --git a/report/advancedgrading/locallib.php b/report/advancedgrading/locallib.php
--
index a512544e478..25a3f33c24f 100644
--- a/report/advancedgrading/locallib.php
+++ b/report/advancedgrading/locallib.php
@@ -46,7 +46,8 @@ function get_grading_definition(int $assignid): \stdClass {
JOIN {context} ctx ON ctx.instanceid = cm.id
JOIN {grading_areas} ga ON ctx.id=ga.contextid
JOIN {grading_definitions} gdef ON ga.id = gdef.areaid
-             WHERE assign.id = :assignid";
+             WHERE gdef.method = ga.activemethod
+             AND assign.id = :assignid";
$definition = $DB->get_record_sql($sql, ['assignid' => $assignid]);
return $definition;
}

I hope this helps!

Best regards,
Yannick

@marcusgreen
Copy link
Owner

Thank you for reporting this. I appreciate an issue report with a fix. I will look at it properly as soon as I can.
Marcus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants