Skip to content

Conversation

@kkoehn
Copy link
Contributor

  • adds deduplication when the same file is used multiple times (occurs when importing to CodeHarbor and the export to CodeOcean)
  • adds validation for File path

@codecov
Copy link

codecovbot commented Aug 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.26%. Comparing base (152b140) to head (d1c54e4).

Additional details and impacted files
@@ Coverage Diff @@## main #3059 +/- ## ========================================== + Coverage 70.24% 70.26% +0.01%  ========================================== Files 215 215 Lines 6850 6853 +3 ========================================== + Hits 4812 4815 +3  Misses 2038 2038 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kkoehnkkoehnforce-pushed the 3004-improve-proforma-compatibility-between-codeocean-and-codeharbor-for-multi-referenced-files branch from ca97dd2 to 626892aCompareAugust 5, 2025 20:16
@kkoehnkkoehnforce-pushed the 3004-improve-proforma-compatibility-between-codeocean-and-codeharbor-for-multi-referenced-files branch from 626892a to d1c54e4CompareAugust 5, 2025 20:38
validates:weight,absence: true,unless: :teacher_defined_assessment?
validates:file,presence: trueif:context.is_a?(Submission)
validates:context_type,inclusion: {in: ALLOWED_CONTEXT_TYPES}
validates:path,uniqueness: {scope: %I[namefile_typecontext_idcontext_typerole]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have records that have this issue right now? I am worried that this migration will suddenly stop teachers from editing the file.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about any existing records, since I don't have access, but it would indeed be important to check before merging this PR.

expect{convert_to_exercise_service.save!}.tochange(Exercise,:count).by(1)
end

context'with two files with similar contents'do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize for my lack of understanding. Should we not ensure that the exported file has no duplicates? Won't we have the same issue in CodeHarbor after exporting the it from CodeHarbor and importing it again to CodeHarbor?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the duplicates some requirement in the ProformaXML spec?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be preferable to also fix the export of CodeHarbor, since I only addressed the import of tasks with multi-referenced files and not the export.

It would be even better to enable CodeHarbor to support the multi-referenced files directly (which would require a serious time investment).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve ProFormA compatibility between CodeOcean and CodeHarbor for multi-referenced files

3 participants

@kkoehn@arkirchner