Skip to content

Import merged evaluation#2747

Open
janno42 wants to merge 1 commit into
e-valuation:mainfrom
janno42:merge-import
Open

Import merged evaluation#2747
janno42 wants to merge 1 commit into
e-valuation:mainfrom
janno42:merge-import

Conversation

@janno42

@janno42 janno42 commented Jun 18, 2026

Copy link
Copy Markdown
Member

fix #2746; support importing evaluations that have been merged into another course

@niklasmohrin niklasmohrin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have some trouble understanding how all the parts come together here. In the issue it says that we have an assumption that two things exist together when they don't really have to, but here it is not obvious how this is split into two now

Comment thread evap/cms/json_importer.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should add a test for this behavior

Comment thread evap/cms/json_importer.py
evaluation = Evaluation.objects.get(cms_evaluation_links__cms_id=data["gguid"])
# get the course from the evaluation in case it was merged into a different course than defined in the
# import data
course = evaluation.course

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there any chance that we can choose the correct course once before calling import_evaluation? I think it is hard to track what course belongs to what now. In the calling code in import_events we have some if course is None: continue and I am not sure how this should interact with this new assignment here (my intuition is that if the original course is None but we find a course here then we should still run the import).

If this is not possible, then one (or both) of the two course variables needs a new name, I guess the course before this is something like course_from_event and this here is like a selected_course? Although selected_course really should just always be evaluation.course, so I guess we could also just use this everywhere?

@richardebeling richardebeling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

code change looks good but I agree that a test would be nice

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.

Import fails after merging Evaluation into other Course

3 participants