Problem/Motivation

I was trying to do #2378359: Convert Questions to D7 Entity API when I noticed that we have redundant data storage and cannot correctly make Quiz questions entities. Any efforts would just be heading in the wrong direction.

Now that quiz "questions" {quiz_question_properties table} are considered an entity internally let's make the built in question types relate to them only on the question ID instead of nid/vid. We gain a couple things from this including Entity definitions and Views support now that they will relate on 1 field. Having redundant primary keys is also bad practice.

This also will take the versioning responsibility off of the question and question types as it will allow us to take advantage of EntityAPIControllerRevisionableInterface later.

For example

quiz_question_properties ("question" table)
- nid
- vid
- qqp_id

Proposed resolution

quiz_truefalse_node
- nid
- vid
(should be:)

quiz_truefalse_node
- qqp_id

This helps with #2378359: Convert Questions to D7 Entity API, as when using entity API/Views we prefer single non-redundant keys on tables when linking to another table.

Remaining tasks

- Migrate question types schema nid/vid to qqp_id
- Update entity reference definitions so that questions types relate back to the qqp table.
- Change "saveNodeProperties" to just "saveProperties" as we are not saving nid/vid anymore.

User interface changes

None

API changes

Schema fields (not yet accessible to Views) change.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

djdevin’s picture

Issue summary: View changes
djdevin’s picture

Issue summary: View changes
djdevin’s picture

Issue summary: View changes
djdevin’s picture

Issue summary: View changes
djdevin’s picture

Issue summary: View changes
djdevin’s picture

Status: Active » Needs review
FileSize
5.26 KB

PoC with truefalse.

Status: Needs review » Needs work

The last submitted patch, 6: remove_redundant-2399209-6.patch, failed testing.

djdevin’s picture

djdevin’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: remove_redundant-2399209-8.patch, failed testing.

djdevin’s picture

Issue summary: View changes
djdevin’s picture

Status: Needs work » Needs review
FileSize
7.99 KB

Status: Needs review » Needs work

The last submitted patch, 12: remove_redundant-2399209-12.patch, failed testing.

djdevin’s picture

Status: Needs work » Needs review
FileSize
8.03 KB
djdevin’s picture

FileSize
12.11 KB

The last submitted patch, 14: remove_redundant-2399209-14.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 15: remove_redundant-2399209-15.patch, failed testing.

djdevin’s picture

Status: Needs work » Needs review
FileSize
17.89 KB

Status: Needs review » Needs work

The last submitted patch, 18: remove_redundant-2399209-18.patch, failed testing.

djdevin’s picture

Status: Needs work » Needs review
FileSize
18.46 KB

Status: Needs review » Needs work

The last submitted patch, 20: remove_redundant-2399209-20.patch, failed testing.

djdevin’s picture

Status: Needs work » Needs review
FileSize
23.07 KB

Status: Needs review » Needs work

The last submitted patch, 22: remove_redundant-2399209-22.patch, failed testing.

djdevin’s picture

Status: Needs work » Needs review
FileSize
25.47 KB

Status: Needs review » Needs work

The last submitted patch, 24: remove_redundant-2399209-24.patch, failed testing.

djdevin’s picture

Status: Needs work » Needs review
FileSize
28.14 KB

Status: Needs review » Needs work

The last submitted patch, 26: remove_redundant-2399209-26.patch, failed testing.

djdevin’s picture

Status: Needs work » Needs review
FileSize
26.34 KB

Status: Needs review » Needs work

The last submitted patch, 28: remove_redundant-2399209-28.patch, failed testing.

djdevin’s picture

Status: Needs work » Needs review
FileSize
26.35 KB

Status: Needs review » Needs work

The last submitted patch, 30: remove_redundant-2399209-30.patch, failed testing.

djdevin’s picture

Status: Needs work » Needs review
FileSize
26.6 KB

Status: Needs review » Needs work

The last submitted patch, 32: remove_redundant-2399209-32.patch, failed testing.