Get user info (username, email) in Custom JavaScript application or in the Python parsing code

hi all,
i am using custom java script application for my problem but i am unable to get username in javascript or the parsing python code, how to get user id or username in python. i want to save student submissions on a separate database.

1 Like

Hi @Muhammad_Bilal

Unfortunately, the custom Javascript problems don’t have access to user ID or username.

You’re better off using an XBlock or LTI integration if you need this information with your submissions. See:

Thank you very much. but i managed to get username from the browser cookies in Javascript problem, then i fetched userID against that username from the local Edx database. All done in python code [problem component editor], i just had to disable the code_jail module.
Problem solved. :slight_smile:

Many Thanks !