SAK-51713 Tests & Quizzes Instructors should see all student submissions when a assessment is published to the entire site#278
Conversation
WalkthroughAdds database migration scripts for Sakai 25.1 to 25.2 supporting MySQL and Oracle. Introduces 'assessment.all.groups' permission and uses temporary tables to map roles to functions, applying permissions across realms while preventing duplicates via NOT EXISTS clauses. Changes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/conversion/sakai_26_mysql_conversion.sql(1 hunks)docs/conversion/sakai_26_oracle_conversion.sql(1 hunks)
…ons when a assessment is published to the entire site
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
docs/conversion/sakai_25_1-25_2_mysql_conversion.sql (1)
8-8: Temporary table operations lack defensive guards.
CREATE TABLEwill fail if tables already exist from a partial previous run, andDROP TABLEwill fail if tables were never created. Adding defensive guards improves script resilience.🔎 Suggested fix:
-- Add this to populate existing sites with the permission +DROP TABLE IF EXISTS PERMISSIONS_SRC_TEMP; CREATE TABLE PERMISSIONS_SRC_TEMP (ROLE_NAME VARCHAR(99), FUNCTION_NAME VARCHAR(99));+DROP TABLE IF EXISTS PERMISSIONS_TEMP; CREATE TABLE PERMISSIONS_TEMP (ROLE_KEY INTEGER, FUNCTION_KEY INTEGER);-DROP TABLE PERMISSIONS_TEMP; -DROP TABLE PERMISSIONS_SRC_TEMP; +DROP TABLE IF EXISTS PERMISSIONS_TEMP; +DROP TABLE IF EXISTS PERMISSIONS_SRC_TEMP;Also applies to: 12-12, 32-33
docs/conversion/sakai_25_1-25_2_oracle_conversion.sql (1)
16-16: Temporary table operations may fail on partial re-runs.Oracle's
CREATE TABLEfails if the table exists, andDROP TABLEfails if it doesn't. For robustness, consider dropping before creating. In Oracle 12.2+, you can use thePRIVATE TEMPORARY TABLEfeature, or for older versions, add a preceding drop with exception handling.🔎 Simpler approach - drop before create:
-- Add this to populate existing sites with the permission +BEGIN EXECUTE IMMEDIATE 'DROP TABLE PERMISSIONS_SRC_TEMP'; EXCEPTION WHEN OTHERS THEN NULL; END; +/ CREATE TABLE PERMISSIONS_SRC_TEMP (ROLE_NAME VARCHAR(99), FUNCTION_NAME VARCHAR(99));+BEGIN EXECUTE IMMEDIATE 'DROP TABLE PERMISSIONS_TEMP'; EXCEPTION WHEN OTHERS THEN NULL; END; +/ CREATE TABLE PERMISSIONS_TEMP (ROLE_KEY INTEGER, FUNCTION_KEY INTEGER);Or at the end:
-DROP TABLE PERMISSIONS_TEMP; -DROP TABLE PERMISSIONS_SRC_TEMP; +BEGIN EXECUTE IMMEDIATE 'DROP TABLE PERMISSIONS_TEMP'; EXCEPTION WHEN OTHERS THEN NULL; END; +/ +BEGIN EXECUTE IMMEDIATE 'DROP TABLE PERMISSIONS_SRC_TEMP'; EXCEPTION WHEN OTHERS THEN NULL; END; +/Also applies to: 20-20, 41-42
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/conversion/sakai_25_1-25_2_mysql_conversion.sql(1 hunks)docs/conversion/sakai_25_1-25_2_oracle_conversion.sql(1 hunks)
🔇 Additional comments (3)
docs/conversion/sakai_25_1-25_2_mysql_conversion.sql (1)
19-30: LGTM!The bulk insert logic correctly uses
NOT EXISTSfor idempotency and appropriately excludes helper and user template realms. The join strategy to propagate permissions to existing realms is sound.docs/conversion/sakai_25_1-25_2_oracle_conversion.sql (2)
3-11: LGTM!The
MERGEstatement properly handles idempotent insertion of the function, avoiding errors on re-run. This is the correct Oracle pattern for "insert if not exists".
27-39: LGTM!The bulk insert logic is correct and idempotent. The
NOT EXISTSclause prevents duplicates, and the realm exclusions are appropriate.
|
is it necessary to address rabbit comments? they are meant to prevent errors if the scripts are executed twice, which isn't something that should really be considered, right? I'm going to mark both comments as resolved |
|
ignore the rabbit comments. this looks fine. |
https://sakaiproject.atlassian.net/browse/SAK-51713
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.