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

update get_students_features to DRF #35064

Closed
Tracked by #35057
awais786 opened this issue Jul 2, 2024 · 0 comments
Closed
Tracked by #35057

update get_students_features to DRF #35064

awais786 opened this issue Jul 2, 2024 · 0 comments
Assignees

Comments

@awais786
Copy link
Contributor

awais786 commented Jul 2, 2024

Step to verify using postman

  1. Try this URL in postman http://local.edly.io:8000/courses/course-v1:edx+cs222+2311/instructor/api/get_students_features/csv

expected result. It will trigger the celery task and csv file will appear inside admin portal in instructor dashboard.

Without csv param

  1. Try this URL in postman http://local.edly.io:8000/courses/course-v1:edx+cs222+2311/instructor/api/get_students_features/

expected result.
It will return json response

{
  "course_id": "course-v1:edx+cs222+2311",
  "students": [
    {
      "id": "4",
      "username": "admin",
      "email": "admin@example.com",
      "date_joined": "2024-07-04T08:26:43Z",
      "last_login": "2024-08-18T18:48:11.680Z",
      "name": "",
      "language": "",
      "location": "",
      "gender": "None",
      "level_of_education": "None",
      "mailing_address": "None",
      "goals": "None",
      "city": "None",
      "country": "",
      "cohort": "[unassigned]",
      "enrollment_mode": "audit",
      "external_user_key": ""
    },
    {
      "id": "7",
      "username": "awaisq",
      "email": "awais@example.com",
      "date_joined": "2024-07-31T08:04:28Z",
      "last_login": "None",
      "name": "",
      "language": "",
      "location": "",
      "gender": "None",
      "level_of_education": "None",
      "mailing_address": "",
      "goals": "aa",
      "city": "",
      "country": "",
      "cohort": "[unassigned]",
      "enrollment_mode": "audit",
      "external_user_key": ""
    }
  ],
  "students_count": 3,
  "queried_features": [
    "id",
    "username",
    "name",
    "email",
    "language",
    "location",
    "gender",
    "level_of_education",
    "mailing_address",
    "goals",
    "enrollment_mode",
    "last_login",
    "date_joined",
    "external_user_key",
    "cohort",
    "city",
    "country"
  ],
  "feature_names": {
    "id": "User ID",
    "username": "Username",
    "name": "Name",
    "email": "Email",
    "language": "Language",
    "location": "Location",
    "gender": "Gender",
    "level_of_education": "Level of Education",
    "mailing_address": "Mailing Address",
    "goals": "Goals",
    "enrollment_mode": "Enrollment Mode",
    "last_login": "Last Login",
    "date_joined": "Date Joined",
    "external_user_key": "External User Key",
    "cohort": "Cohort",
    "city": "City",
    "country": "Country"
  },
  "available_features": [
    "id",
    "username",
    "first_name",
    "last_name",
    "is_staff",
    "email",
    "date_joined",
    "last_login",
    "name",
    "language",
    "location",
    "year_of_birth",
    "gender",
    "level_of_education",
    "mailing_address",
    "goals",
    "meta",
    "city",
    "country",
    "external_user_key"
  ]
}

Step to verify on dashboard

  1. open this URL instructor page-> data-download.
  2. Click the button Download profile information as a CSV.

It will down the file contains

id,username,name,email,language,location,gender,level_of_education,mailing_address,goals,enrollment_mode,last_login,date_joined,external_user_key,cohort,city,country
4,admin,,admin@example.com,,,None,None,None,None,audit,2024-08-18 18:48:11.680830+00:00,2024-07-04 08:26:43+00:00,,[unassigned],None,
5,audot,Awais Qureshi,audot@example.com,,,m,p,lahore,,audit,2024-07-27 10:40:35+00:00,2024-07-27 10:37:58+00:00,,[unassigned],,PK
7,awaisq,,awais@example.com,,,None,None,,aa,audit,None,2024-07-31 08:04:28+00:00,,[unassigned],,
Screenshot 2024-08-19 at 2 42 32 PM
@awais786 awais786 self-assigned this Aug 19, 2024
@awais786 awais786 changed the title get_students_features to DRF update get_students_features to DRF Aug 23, 2024
@awais786 awais786 closed this as completed Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant