KITPraktomatTeam / Praktomat

quality control for programming assignments
http://pp.ipd.kit.edu/projects/praktomat/praktomat.php
GNU General Public License v2.0
46 stars 22 forks source link

fixes #316 prevent duplication of RatingScale and RatingScaleItems while importing a task #317

Closed ifrh closed 2 years ago

ifrh commented 2 years ago

we want to save a task which is beeing importable always as new database entry. But we do not want to save RatingScale or RatingScaleItem, if equivalent elements are in database already.

If there is no RatingScale with the name in database, we save the deserialized_object, else we are reusing existent data. If there is no RatingScaleItem with the same name for corresponding RatingScale in database, we save the deserialized_object, else we are reusing existent data.

The consequence is: If you where importing tasks from different praktomat instances having differences in names of RatingScaleItems but using same name for RatingScale, than these ScaleItems become merge into the same RatingScale.

ifrh commented 2 years ago

@ratefuchs : This changes are python 3 only, have no long commit history. The fix is complete. There for I vote for merging it into master.