We have discovered at our instance of sakai that exist lot of registers with duplicated metadata. All the tables of samigo that contain metadata have this problem, such as sam_sectionmetadata_t, sam_assessmetadata_t, sam_itemmetadata_t and their respective published tables.
This bug can be reproduced with the following steps:
- Create an assessment with a section based on a questionpool. Number of questions=1, leave in blank the rest of fields.
- Save the assessment.
- Edit the assessment and the previous section. Fill in both fields 'Point value of questions' with 0.25 and 'Negative point value for incorrect answer selection' with 0.08.
- Save the section
- Now, if we look the table sam_sectionmetadata_t we will see that both metadata POINT_VALUE_FOR_QUESTION and DISCOUNT_VALUE_FOR_QUESTION are duplicated with values null and 0.25, and null and 0.08.
To solve this bug it should be necessary do the following:
- Correct the source code.
- Clean the duplicated metadata.
- Add a constrain unique to all metadata tables.