Skip to content

EVALSYS-1445 Handle null instructor view-all results - #186

Open
ottenhoff wants to merge 3 commits into
sakaicontrib:masterfrom
ottenhoff:fix-evalsys-1445-null-instructor-view-results
Open

EVALSYS-1445 Handle null instructor view-all results#186
ottenhoff wants to merge 3 commits into
sakaicontrib:masterfrom
ottenhoff:fix-evalsys-1445-null-instructor-view-results

Conversation

@ottenhoff

Copy link
Copy Markdown
Contributor

Summary

Treat null EvalEvaluation.instructorViewAllResults values as false in report export and reporting permission paths.

This prevents legacy rows with EVAL_EVALUATION.INSTRUCTOR_VIEW_ALL_RESULTS = NULL from throwing when PDF reports, individual PDF reports, CSV/XLS report paths, or related reporting permission logic unbox the nullable Boolean.

Root cause

The database column and Hibernate mapping allow null, but several consumers directly unboxed getInstructorViewAllResults(). Existing defaults cover many newly saved evaluations, but legacy null values can still reach report generation.

Validation

  • mvn -pl sakai-evaluation-impl,sakai-evaluation-tool -am -DskipTests compile

@ottenhoff
ottenhoff marked this pull request as ready for review July 10, 2026 15:59
@ottenhoff ottenhoff changed the title Handle null instructor view-all results EVALSYS-1445 Handle null instructor view-all results Jul 10, 2026
@ottenhoff
ottenhoff requested a review from danielmerino July 10, 2026 16:00
@danielmerino

Copy link
Copy Markdown
Contributor

Thanks, Sam. Looks correct to me, but one spot with the same unboxing bug doesn't seem to be covered by this PR: ControlEvaluationsController.java:399

if ((eval.getInstructorViewResults() &&
(eval.getOwner().equals(currentUserId) || isUserAdmin)) ||
eval.getInstructorViewAllResults()) {

This has the identical pattern you just fixed in ReportingPermissionsImpl.java (direct unboxing inside an ||), so it would NPE on the same legacy null values. Might be worth including it here for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants