Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data exportation to CVS with JS array #1609

Open
Matthieu-BRANTHOME opened this issue Jan 24, 2022 · 1 comment
Open

Data exportation to CVS with JS array #1609

Matthieu-BRANTHOME opened this issue Jan 24, 2022 · 1 comment

Comments

@Matthieu-BRANTHOME
Copy link

I have data stored in xAPI format in my Learning Locker LRS and I am trying to export it to CSV format.

I followed xAPI to the letter and so I have in my statements some data stored in the JSON tree in JS arrays. See for example below my "level" parameter which is in an array with the key "other".

"context": {

    "contextActivities": {

      "other": [

        {

          "objectType": "Activity",

          "id": "https://py-rates.org/xAPI/activities/levels/level1",

          "definition": {

            "name": {

              "en-US": "Level 1",

              "fr": "Niveau 1"

            },

            "type": "https://py-rates.org/xAPI/activities/level"

          }

        }

      ]

    },

When I export my data to CSV from the Learing Locker web interface, there is the possibility to choose some fields by giving their path in the JSON tree. For example for the column "_level", I indicated: "statement.context.contextActivities.other" (see screenshot link below).

1642765160022blob

The problem is that I get the whole array in my CSV, so I need a post-processing to get only the level. I would like to be able to choose the first element of the array to retrieve only the id of the level and not the whole array. Basically, I would like to give the following path: "statement.context.contextActivities.other[0].id ".
Unfortunately this syntax does not work.

Do you have any idea how to do it?

Thank you in advance for your help,

MatthieuB

@Matthieu-BRANTHOME
Copy link
Author

There is a strange thing in learning locker, the notation:
statement.context.contextActivities.other.0.definition.name.en-US
Works in the preview

2022_10_12_09_28_45_Learning_Locker_Welcome

but not in the exported files!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant