learninglocker icon indicating copy to clipboard operation
learninglocker copied to clipboard

fix(Exports): Columns ordered incorrectly after JSON edit. (LL-175)

Open gamahachaa opened this issue 6 years ago • 1 comments

What version were you using?

4.4.0

What steps can we follow to reproduce the behaviour?

  1. Create a JSON model for the export expl :
{
    "_id": 1,
    "id": "$statement.id",
    "WHO_NT": "$statement.actor.name",
    "WHO_EMAIL": "$statement.actor.mbox",
    "SUCCESS": "$statement.result.success",
    "POINTS": "$statement.result.score.raw",
    "MAX_POINTS": "$statement.result.score.max",
    "PERCENTAGE": "$statement.result.score.scaled",
    "DURATION": "$statement.result.duration",
    "WHEN": "$statement.timestamp",
    "WHAT": "$statement.object.id"
}
  1. Source > Export Panel > Manage > Add new
  2. Click the "ion-code" button to display the textarea
  3. paste the JSON model
  4. Click the "ion-code" button again to display the the model as table

What is the actual behaviour?

The row are listed in another order than the one of the JSON model

Column Source
POINTS $statement.result.score.raw
SUCCESS $statement.result.success
WHAT $statement.object.id
WHO_NT $statement.actor.name
DURATION $statement.result.duration
PERCENTAGE $statement.result.score.scaled
WHEN $statement.timestamp
id $statement.id
WHO_EMAIL $statement.actor.mbox
MAX_POINTS $statement.result.score.max

What is the expected behavior?

The row SHOULD be listed in the same order than the one of the JSON model hence,

Column Source
id $statement.id
WHO_NT $statement.actor.name
WHO_EMAIL $statement.actor.mbox
SUCCESS $statement.result.success
POINTS $statement.result.score.raw
MAX_POINTS $statement.result.score.max
PERCENTAGE $statement.result.score.scaled
DURATION $statement.result.duration
WHEN $statement.timestamp
WHAT $statement.object.id

Is there any additional information that will help us replicate/understand the problem?

With a JSON model with 8 attributes or less the order is respected.

{
    "_id": 1,
    "id": "$statement.id",
    "WHO_NT": "$statement.actor.name",
    "WHO_EMAIL": "$statement.actor.mbox",
    "SUCCESS": "$statement.result.success",
    "POINTS": "$statement.result.score.raw",
    "MAX_POINTS": "$statement.result.score.max",
    "PERCENTAGE": "$statement.result.score.scaled"
}

Gives

Column Source
id $statement.id
WHO_NT $statement.actor.name
WHO_EMAIL $statement.actor.mbox
SUCCESS $statement.result.success
POINTS $statement.result.score.raw
MAX_POINTS $statement.result.score.max
PERCENTAGE $statement.result.score.scaled

gamahachaa avatar Sep 04 '19 13:09 gamahachaa

Tracked internally by https://learningpool.atlassian.net/browse/LL-175

ryasmi avatar Sep 05 '19 08:09 ryasmi