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_problem_responses to DRF #35060

Open
Tracked by #35057
awais786 opened this issue Jul 2, 2024 · 18 comments
Open
Tracked by #35057

update get_problem_responses to DRF #35060

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

Comments

@awais786
Copy link
Contributor

awais786 commented Jul 2, 2024

This api needs to be converted using DRF.

API URL for local
http://local.edly.io:8000/courses/course-v1:edx+cs222+2311/instructor/api/get_problem_responses for local machine using tutor. Use course id as per ur instance.

Updating api code using DRF.

  1. Add standard authentication_classes.
  2. Add permission_classes.
  3. make sure all response code remains same and response remains same.

verify this on local machine.

  1. Log in to the local instance and open the instructor dashboard for course.
  2. Search this label Create a report of problem responses on this page.
  3. select a section or problem and press this button Create a report of problem responses

Screenshot 2024-07-27 at 1 29 23 AM
@pnaskardev
Copy link

Hi @awais786 can you please assign this task to me as I would like to contribute, while solving this issue it will also give me an opportunity to go through the vast code as well.
Thanks.

@feanil
Copy link
Contributor

feanil commented Jul 26, 2024

@pnaskardev I think that's fine as long as the PR is a draft PR.

@awais786
Copy link
Contributor Author

@pnaskardev I will add more information in this ticket and testing steps. Thanks for picking this ticket.

@awais786
Copy link
Contributor Author

@pnaskardev I have added testing steps in the description, please let me know if you have any questions.

@pnaskardev
Copy link

@awais786 this is not related to coding purpose but I signed Individual contributor agreement and I still haven't received a confirmation I am not sure what to do

@pnaskardev
Copy link

image

@awais786 to test the API I want to create a course to get the course_id, but since I am new to the repository I am unable to find where should I approve my request so that I can start creating the courses and do the rest of the work.

Can you please help me with this

@awais786
Copy link
Contributor Author

  1. http://apps.local.edly.io:2001/course-authoring/home
  2. Press New course button
  3. fill the form and press save.
  4. http://apps.local.edly.io:1999/authn/login?next=%2F ( login here with your credentials )

@awais786
Copy link
Contributor Author

@awais786 this is not related to coding purpose but I signed Individual contributor agreement and I still haven't received a confirmation I am not sure what to do

I think it will take few days.

@pnaskardev
Copy link

pnaskardev commented Jul 30, 2024

  1. http://apps.local.edly.io:2001/course-authoring/home
  2. Press New course button
  3. fill the form and press save.
  4. http://apps.local.edly.io:1999/authn/login?next=%2F ( login here with your credentials )

image

  1. as I have attached the screenshot I am on the same route and its not letting me add a new course
  2. Also I am not even getting the new course button as well

@awais786
Copy link
Contributor Author

  1. I think your user does not have superuser permissions or course-authoring perms.

You can do this.

https://docs.tutor.edly.io/local.html#creating-a-new-user-with-staff-and-admin-rights

@pnaskardev
Copy link

pnaskardev commented Aug 8, 2024

Hi @awais786 I was making some requests to the development server and because of CSRF verification failed. Request aborted. I am unable to make requests can you please give me the Headers format required to make requests so that I can progress?
Below is the Cookie header that I am passing
edx-jwt-cookie-header-payload=eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJvcGVuZWR4IiwiZXhwIjoxNzIzMDkzMDQ0LCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJpYXQiOjE3MjMwODk0NDQsImlzcyI6Imh0dHA6Ly9sb2NhbC5lZGx5LmlvL29hdXRoMiIsInByZWZlcnJlZF91c2VybmFtZSI6Imxtc3BuYXNrYXJkZXYiLCJzY29wZXMiOlsidXNlcl9pZCIsImVtYWlsIiwicHJvZmlsZSJdLCJ2ZXJzaW9uIjoiMS4yLjAiLCJzdWIiOiJlZjU3YTk5Y2UwMDJlMzc3OTNlYTI2YzdiYjkxMjAyYyIsImZpbHRlcnMiOlsidXNlcjptZSJdLCJpc19yZXN0cmljdGVkIjpmYWxzZSwiZW1haWxfdmVyaWZpZWQiOnRydWUsInVzZXJfaWQiOjcsImVtYWlsIjoibG1zcG5hc2thcmRldkBnbWFpbC5jb20iLCJuYW1lIjoiUHJpeWFuc2h1IE5hc2thciIsImZhbWlseV9uYW1lIjoiIiwiZ2l2ZW5fbmFtZSI6IiIsImFkbWluaXN0cmF0b3IiOmZhbHNlLCJzdXBlcnVzZXIiOmZhbHNlfQ; edx-jwt-cookie-signature=O2r_ncqplvyVj5vMKRq2jjJkC4IoAs52u2OhsXwlwS2P5o941k3gHP0MlsIXm47Rc4RDS28iMW7_TOrJ8G2lnryIhoYqSMZOGBu-0hYQWfus5Yf-NpDstMTi9BfH_PfaGdHG1oWENq9vzJvycbCReNnAMP5aZmrz6JM3pRCUhlK9S2bqUgkWR84U3ZNhmLXIY7Rlnd2M8ooOKvDBBm--09FEduOpuz1uFPyKI_6UQLCiMEAsIs-nJZhH1c1Mvxqvfo1_D86PnrK3lnFZrYQDE2AmvfFtQ-5nUrTc3XdlbPC9U-5N39Tjw2XHf6a6WVNnlj2Op6fiirTGci_u8RuUmA; edx-user-info="{\\\"version\\\": 1\\054 \\\"username\\\": \\\"lmspnaskardev\\\"\\054 \\\"email\\\": \\\"[email protected]\\\"\\054 \\\"header_urls\\\": {\\\"logout\\\": \\\"http://local.edly.io:8000/logout\\\"\\054 \\\"account_settings\\\": \\\"http://local.edly.io:8000/account/settings\\\"\\054 \\\"learner_profile\\\": \\\"http://local.edly.io:8000/u/lmspnaskardev\\\"\\054 \\\"resume_block\\\": \\\"http://local.edly.io:8000/courses/course-v1:OpenedX+DemoX+DemoCourse/jump_to/block-v1:OpenedX+DemoX+DemoCourse+type@html+block@9dc5a2d3e24d4531889b41a242e930b1\\\"}\\054 \\\"user_image_urls\\\": {\\\"full\\\": \\\"http://local.edly.io:8000/static/images/profiles/default_500.png\\\"\\054 \\\"large\\\": \\\"http://local.edly.io:8000/static/images/profiles/default_120.png\\\"\\054 \\\"medium\\\": \\\"http://local.edly.io:8000/static/images/profiles/default_50.png\\\"\\054 \\\"small\\\": \\\"http://local.edly.io:8000/static/images/profiles/default_30.png\\\"}}"; edxloggedin=true; lms_sessionid=1|rz0j4r0kofc8mk0qlccye47ki9h57j2w|ADOQnHkTDxE4|ImJmMzJjZDNhOTRmOTQzYjMyYmNlNzVkNjYyMzk0Njk1ZDdjNjU2ZDkyN2ExZjNmMDI3OWY2MjJiYjVhYzJmMzci:1sbuIS:TGC5lCmfheDBxJI0jMx5-FwTrB__DdJlbYBo5ycl90c; openedx-language-preference=en

To solve this CSRF Token issue I thought of copying the CSRF tokens from the browser itself but I couldn't find it
image

@awais786
Copy link
Contributor Author

awais786 commented Aug 8, 2024

@pnaskardev I am happy you are making good progress. For csrf please try this in post man

  1. http://local.edly.io:8000/csrf/api/v1/token ( its a get request ).
  2. Now use this token and pass in headers like this x-CSRFToken: your csrf token.

@AmauryVanEspen
Copy link

Hi @awais786 & @pnaskardev
i'm very interested in this feature, how can i support your work ?
from get_problem_responses, i would like to get results and changes in polls & surveys,
ready to plan & execute tests if it could help
let me know where can i find the postman workspace & collections.
regards
Amaury

@awais786
Copy link
Contributor Author

@AmauryVanEspen & @pnaskardev
I have a added a document for apis testing. Please let me know if you are facing any issues.

@AmauryVanEspen
Copy link

AmauryVanEspen commented Aug 14, 2024

@AmauryVanEspen & @pnaskardev I have a added a document for apis testing. Please let me know if you are facing any issues.

@awais786 : "405 Method Not Allowed"

@awais786
Copy link
Contributor Author

awais786 commented Aug 14, 2024

@AmauryVanEspen which api you are hitting please share some screenshot ? Body and Header information as well.

@pnaskardev
Copy link

@AmauryVanEspen & @pnaskardev I have a added a document for apis testing. Please let me know if you are facing any issues.

There are no changes in get_problem_responses api right?? the response structured remains the same right?
I am a bit unclear about this

@awais786
Copy link
Contributor Author

@AmauryVanEspen & @pnaskardev I have a added a document for apis testing. Please let me know if you are facing any issues.

There are no changes in get_problem_responses api right?? the response structured remains the same right? I am a bit unclear about this

Yes, response should be same.

@awais786 awais786 changed the title get_problem_responses to DRF update get_problem_responses to DRF Aug 23, 2024
@awais786 awais786 self-assigned this Oct 8, 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

4 participants