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

Make common(CAPA) problems publicly accessible and intractable #263

Conversation

danialmalik
Copy link

@danialmalik danialmalik commented Apr 1, 2020

Description

By default, edX allows public access to non-problem xBlocks. This PR adds the public access for Capa problems (Common Problems) provided by Open edX.

Message on course outline page for public courses is also updated
image

How to test

How to run unit tests

paver test_system -s lms -t lms/djangoapps/courseware/tests/test_module_render.py::ModuleRenderTestCase::test_anonymous_post_xblock_callback_with_public_access_enabled

paver test_system -s lms -t common/lib/xmodule/xmodule/tests/test_capa_module.py::CapaModuleTest::test_public_view

paver test_system -s lms -t common/lib/xmodule/xmodule/tests/test_capa_module.py::CapaModuleTest::test_submit_problem_with_authenticated_user

paver test_system -s lms -t common/lib/xmodule/xmodule/tests/test_capa_module.py::CapaModuleTest::test_submit_problem_with_anonymous_user

paver test_system -s lms -t common/lib/xmodule/xmodule/tests/test_capa_module.py::CapaModuleTest::test_save_problem_with_anonymous_user

paver test_system -s lms -t openedx/features/course_experience/tests/views/test_course_home.py::TestCourseHomePageAccess

@danialmalik danialmalik force-pushed the danial/EDE-338-make-common-problems-public branch 3 times, most recently from 6d3a4f6 to 3c563b2 Compare April 2, 2020 12:16
@danialmalik danialmalik self-assigned this Apr 2, 2020
@danialmalik danialmalik requested a review from tasawernawaz April 2, 2020 12:17
@danialmalik danialmalik force-pushed the danial/EDE-338-make-common-problems-public branch from 3c563b2 to b91ad30 Compare April 2, 2020 12:29
@danialmalik danialmalik marked this pull request as ready for review April 2, 2020 12:39
self.track_function_unmask('save_problem_fail', event_info)
next_url = urlquote_plus(reverse('jump_to', kwargs={'course_id':self.location.course_key, 'location':self.location}))

regiteration_link = u'{lms_root}/register?next={next_url}'.format(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use reverse('register_user') here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


def test_public_view(self):
"""
Test that public view for capa problems returns

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Test that public view for capa problems returns
Tests that public view for capa problems returns

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentionally an imperative sentence.

@danialmalik danialmalik force-pushed the danial/EDE-338-make-common-problems-public branch 2 times, most recently from 83ce7e0 to ccaced1 Compare April 3, 2020 12:09
Copy link

@tasawernawaz tasawernawaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I wish someone can test this by checking our locally.

@danialmalik danialmalik force-pushed the danial/EDE-338-make-common-problems-public branch from ccaced1 to 8c1da29 Compare April 3, 2020 12:56
@imhassantariq
Copy link
Member

@danialmalik @tasawernawaz Tested this PR locally. Everything is working fine you can merge the changes.

Comment on lines 730 to 733
if not self.runtime.user_id:
attempts_allowed = 0
else:
attempts_allowed = self.max_attempts

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not self.runtime.user_id:
attempts_allowed = 0
else:
attempts_allowed = self.max_attempts
attempts_allowed = self.max_attempts if self.runtime.user_id else 0

@danialmalik danialmalik force-pushed the danial/EDE-338-make-common-problems-public branch 5 times, most recently from a210b79 to 42c23c0 Compare April 14, 2020 08:08
@danialmalik danialmalik force-pushed the danial/EDE-338-make-common-problems-public branch from 42c23c0 to 102ef22 Compare April 14, 2020 08:21
@danialmalik danialmalik merged commit 6c8ebcd into openlearninglibrary/ironwood Apr 17, 2020
@danialmalik danialmalik deleted the danial/EDE-338-make-common-problems-public branch April 17, 2020 11:14
@danialmalik danialmalik changed the title Danial/ede 338 make common problems public Make common(CAPA) problems publicly accessible and intractable Apr 17, 2020
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

Successfully merging this pull request may close these issues.

4 participants