Commit Graph

49 Commits

Author SHA1 Message Date
usamasadiq
f9cfbf027c Ran pyupgrade on lms/djangoapps
Ran pyupgrade on lms/djangoapps/lms_xblock
Ran pyupgrade on lms/djangoapps/lti_provider
2021-02-20 21:46:03 +05:00
Awais Qureshi
28307c0a0a BOM-2283
Apply pylint-amnesty.
2021-02-02 11:31:34 +05:00
Kyle McCormick
d1a775d3cd Use full names for lms.djangoapps imports (#25401)
* Use full LMS imports paths in LMS settings and urls modules
* Use full LMS import paths in Studio settings and urls modules
* Import from lms.djangoapps.badges instead of badges
* Import from lms.djangoapps.branding instead of branding
* Import from lms.djangoapps.bulk_email instead of bulk_email
* Import from lms.djangoapps.bulk_enroll instead of bulk_enroll
* Import from lms.djangoapps.ccx instead of ccx
* Import from lms.djangoapps.course_api instead of course_api
* Import from lms.djangoapps.course_blocks instead of course_blocks
* Import from lms.djangoapps.course_wiki instead of course_wiki
* Import from lms.djangoapps.courseware instead of courseware
* Import from lms.djangoapps.dashboard instead of dashboard
* Import from lms.djangoapps.discussion import discussion
* Import from lms.djangoapps.email_marketing instead of email_marketing
* Import from lms.djangoapps.experiments instead of experiments
* Import from lms.djangoapps.gating instead of gating
* Import from lms.djangoapps.grades instead of grades
* Import from lms.djangoapps.instructor_analytics instead of instructor_analytics
* Import form lms.djangoapps.lms_xblock instead of lms_xblock
* Import from lms.djangoapps.lti_provider instead of lti_provider
* Import from lms.djangoapps.mobile_api instead of mobile_api
* Import from lms.djangoapps.rss_proxy instead of rss_proxy
* Import from lms.djangoapps.static_template_view instead of static_template_view
* Import from lms.djangoapps.survey instead of survey
* Import from lms.djangoapps.verify_student instead of verify_student
* Stop suppressing EdxPlatformDeprecatedImportWarnings
2020-11-04 08:48:33 -05:00
Calen Pennington
f9619d6cad Add a pluggable CallToAction service for XBlocks
This also has an initial use case for Personalized Learner Schedules
to add CTAs to capa and vertical blocks to allow users to shift their
course deadlines.
2020-08-06 14:38:26 -04:00
Sid Verma
99220e0967 Add "Source from library" XBlock
This lets the user import a block from a blockstore-based content library into a (modulestore based) course, by copying the block into the course.
2020-07-24 13:32:37 +05:30
Waheed Ahmed
a23a31c2be Allow Block Structures Collect to work in Studio.
The collect process was broken before this commit because Studio's
runtime does not permit handler_url invocation on "thirdparty"
XBlocks.

PROD-1393
2020-03-30 13:24:34 +05:00
Jansen Kantor
2043a29477 change lms team config (#22893) 2020-01-17 11:40:12 -05:00
Jansen Kantor
cec55074e8 jkantor/teamconfig (#22863)
Add TeamsConfigurationService to lms xblock runtime
2020-01-15 14:27:27 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Jansen Kantor
92e833d565 add api function and teams service (#22515)
* add api function and teams service
2019-12-18 15:05:02 -05:00
Braden MacDonald
5fc73468b3 Change completion API to work with any learning context 2019-10-22 14:04:31 -04:00
David Ormsbee
95a4e9ba3c Fix BlockTransformer Py3 issues (#21376)
Django's reverse can handle Unicode for arguments.
2019-08-19 12:16:39 -04:00
Amit
b8b910d132 INCR-460: Make compatible with Python 3.x and disable: import-error f… (#20989)
* INCR-460: Make compatible with Python 3.x and disable: import-error for urlparse

* INCR-460: Fixes for useless suppression
2019-07-16 14:28:03 -04:00
Matthew Piatetsky
764319d3e0 fix unicode strings in lms/ part 2 2019-02-13 10:35:56 -05:00
Pooja Kulkarni
6f0e5d68d7 Make video contents visible to unenrolled users
This is based on PR #19284 and is part of the
series of work related to the proposal #18134.

Adds VideoModule.public_view() to enable
unenrolled and anonymous users to view the video
contents of a public course.
When an unenrolled or anonymous user accesses the
video content of a public course, the
public_view() introduced in the previous PR is
used instead of student_view() method.
2018-12-20 11:56:43 +05:30
Gavin Sidebottom
3dad2be55d Refactored XBlockAside rendering and added support for student view 2018-12-11 12:27:03 +05:00
Robert Raposa
ba4cc62ff8 Retire deprecated RequestCache (Take 2)
ARCH-223
2018-09-08 15:09:28 -04:00
Nimisha Asthagiri
4ca165f690 Revert "ARCH-223: Retire deprecated RequestCache." 2018-08-30 16:33:03 -04:00
Robert Raposa
3df339a56a Retire deprecated RequestCache.
ARCH-223
2018-08-30 08:55:19 -04:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
Alex Dusenbery
7e51f02884 Get edx-platform working with external completion lib, add integration tests. 2018-02-14 15:54:27 -05:00
Qubad786
64555c60c0 Move request_cache to openedx.core.djangoapps 2018-01-26 15:09:25 +05:00
J. Cliff Dyer
b8202e40de Handle default complete-by-viewing completion method.
* Vertical marks blocks completed when viewed.
* Functionality is hidden behind a waffle switch
* Submissions from front-end are limited to known-incomplete blocks
* Upgrades xblock to version 1.1.1
* Related future requirements listed in TODO tagged with EDUCATOR-1778
  and relevant opencraft OC-* ticket IDs.

OC-3088
2017-11-28 15:07:06 -05:00
Brandon Baker
7d2d0657fe Merge pull request #15290 from edx/bbaker/educator-344
Bbaker/educator 344
2017-06-13 10:42:35 -04:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Brandon Baker
f4c9044d2e EDUCATOR-344
Removed instances of track function
2017-06-09 18:51:10 +00:00
John Eskew
3b57542ab0 Revert "Merge pull request #15170 from edx/jeskew/PLAT_1316_partitions_inheritance"
This reverts commit f97f052591, reversing
changes made to 800bcd8e20.
2017-05-30 12:42:54 -04:00
John Eskew
76389d8678 Run all files touched in inheritance/partition work through isort. 2017-05-25 13:24:08 -04:00
John Eskew
66f3aa5ccf Move fields.py, inheritance.py, and partitions to openedx/core. 2017-05-25 13:24:08 -04:00
cahrens
e5035746bf Introduce EnrollmentTrackUserPartition.
TNL-6674
2017-03-30 12:24:48 -04:00
Nimisha Asthagiri
15d9883f76 Create core/url_utils.py, moving utilities from lms_xblock/runtime 2016-10-06 21:59:11 -04:00
Dmitry Viskov
21bbcc9f35 Connected aside information is included in the emitted event (on check) 2016-05-19 17:37:40 +03:00
Christina Roberts
2497f0a0eb WIP: xblock pipeline work (#10176)
[PERF-303] Integer XBlocks/XModules into the static asset pipeline.

This PR, based on hackathon work from Christina/Andy, implements a way to discover all installed XBlocks and XModules and to enumerate their public assets, then pulling them in during the collectstatic phase and hashing them.  In turn, the methods for generating URLs to resources will then returned the hashed name for assets, allowing them to be served from nginx/CDNs, and cached heavily.
2016-04-29 10:52:42 -04:00
Jonathan Piacenti
17ec12c650 Address platform final review notes. 2016-04-01 21:06:07 +00:00
Jonathan Piacenti
cb4ed42075 Disable badge issuance for courses where badges are disabled. 2016-04-01 10:13:09 -05:00
Jonathan Piacenti
25958febbf Add XBlock Badging Service. 2016-04-01 10:13:08 -05:00
Matt Drayer
3ed3fea2fb mattdrayer/xblock-translations: Add I18N/L10N support to XBlocks via the runtime
* mattdrayer:  Latest proto code
* mattdrayer:  Add translation.py
* asadiqbal08: Xblock translation ugettext update, remove translation.py
* mattdrayer:  Additional I18N work -- starting to see some translations!
* asadiqbal08: Trying to make xBlock message catalog files path dynamic
* mattdrayer:  Remove unnecessary modifications
* mattdrayer:  Cleaned up implementation
* mattdrayer:  Moved import statement
* asadiqbal08: update as suggested
* asadiqbal08: xblock its own domain
* asadiqbal08: translation: secure none object
* asadiqbal08: pylint
* asadiqbal08: get locale from xblock
* asadiqbal08: update
* mattdrayer:  Determine XBlock locale path within runtime service
* mattdrayer:  Determine module location via the runtime
* mattdrayer:  Remove ModuleI18nService reference
* asadiqbal08: override the service in studio
* asadiqbal08: remove import
* asadiqbal08: update the Modulei18nService
* asadiqbal08: update the Modulei18nService
* mattdrayer:  Remove redundant __class__ reference
* asadiqbal08: update the docstring
* asadiqbal08: tests
* mattdrayer:  Remove specific ugettext override from ModuleI18nService
* mattdrayer:  Move service operation to base class
* mattdrayer:  Address quality violations
* asadiqbal08: Investigating the test failure issue on jenkins and solved
* asadiqbal08: First utilizing the parent class method
* mattdrayer:  Use recommended callable approach
* asadiqbal08: remove unused code
* asadiqbal08: Updated the test to use cms preview module system runtime in order to get i18n service.
* asadiqbal08: Pylint quality
* asadiqbal08: update the service call to check xblock declarations
* asadiqbal08: update doc string
* asadiqbal08: i18n callable test in studio
* asadiqbal08: test lms runtime for modulei18n service
* asadiqbal08: add doc strings
* asadiqbal08: Rename locale and domain to Flask-Babel convention
2016-03-11 09:55:15 -05:00
David Ormsbee
9b88bdb072 Changes to handler URL generation
* The LMS now also monkey-patches
  xmodule.x_module.descriptor_global_handler_url and
  xmodule.x_module.descriptor_global_local_resource_url so that we can
  get LMS XBlock URLs from the DescriptorSystem. That functionality is
  needed in the block transforms collect() phase for certain XModules
  like Video. For instance, say we want to generate the transcripts
  URLs. The collect phase is run asynchronously, without a user context.

* The URL handler monkey-patching is now done in the startup.py files
  for LMS and Studio. Studio used to do this in the import of
  cms/djangoapps/contentstore/views/item.py. This was mostly just
  because it seemed like a sane and consistent place to put it.

* LmsHandlerUrls was removed, its handler_url and local_resource_url
  methods were moved to be top level functions. The only reason that
  class existed seems to be to give a place to store course_id state,
  and that can now be derived from the block location.

* To avoid the Module -> Descriptor ProxyAttribute magic that we do
  (which explodes with an UndefinedContext error because there is no
  user involved), when examining the block's handler method in
  handler_url, I made a few changes:

** Check the .__class__ to see if the handler was defined, instead of the
   block itself.

** The above required me to relax the check for _is_xblock_handler on the
   function, since that will no longer be defined.

90% of this goes away when we kill XModules and do the refactoring we've
wanted to do for a while.
2015-10-28 09:42:59 -04:00
Ned Batchelder
f54fe787c6 Remove needless 'disable=no-member' pragmas 2015-08-03 17:47:44 -04:00
David Ormsbee
ff77505f42 Add caching to partitions_service. 2015-03-18 14:55:16 -04:00
Andy Armstrong
6976a33a85 Add the preferences endpoint to the User API
TNL-1493

See https://openedx.atlassian.net/wiki/display/TNL/User+API for details
2015-03-16 23:34:35 -04:00
E. Kolpakov
c225d86e83 SettingsService for accessing server-wide settings from XBlock 2015-03-05 18:24:47 +03:00
Xavier Antoviaque
2ba4957951 xblock-external-ui: Add XBlock API call to render XBlock views
xblock-external-ui: Include CSRF token in the API answer
xblock-external-ui: Include full path when building local_url
xblock-external-ui: Fix TestHandleXBlockCallback & bok_choy, add tests
xblock-external-ui: Only return `instance` in `_invoke_xblock_handler()`
xblock-external-ui: Group resources by hash tag to avoid duplicate loads
xblock-external-ui: PEP8
xblock-external-ui: Fail early if the XBlock view is called anonymously

    We used to serve anonymous requests, but most XBlocks assume that the
    user is logged in, which can generate a lot of errors when the user is
    accessed or when an XBlock ajax callback is queried. Fail early to only
    get one error per page load, and prevent displaying the XBlock
    altogether when the LMS doesn't find an active user session.

xblock-external-ui: Add request params in view render context
xblock-external-ui: HTTP error status when file is too large for handler
xblock-external-ui: Fix unicode encodings in XBlock rendering
xblock-external-ui: Feature flag for API call ENABLE_XBLOCK_VIEW_ENDPOINT
2015-02-16 12:39:38 +01:00
Braden MacDonald
3973317aa9 Report the original LibraryUsageLocator in LMS analytics 2015-01-12 10:39:12 -08:00
muhammad-ammar
5ba492ecf3 Get students experiments, groups, and cohorts
TNL-498
2015-01-08 14:29:53 +05:00
Don Mitchell
4360a78142 Studio render XBlockAside views
PLAT-280
2014-12-17 15:44:49 -05:00
Don Mitchell
de5e88561f Make XmlModuleStore handle asides
PLAT-221
2014-12-17 13:51:10 -05:00
Calen Pennington
d919d2ae46 Teach LMS how to render XBlockAsides
[PLAT-217]
2014-12-13 08:26:28 -05:00
Calen Pennington
980f30c17f Move lms.lib.xblock into lms.djangoapps.lms_xblock in preparation add database backed configuration to it 2014-12-12 21:45:21 -05:00