Commit Graph

117 Commits

Author SHA1 Message Date
Silvio Tomatis
99bdb23375 Add xblock.v1 and xmodule.v1 entrypoints for NonStaffErrorDescriptor
If an error occurs while rendering an xmodule, the LMS chokes with the
following error if accessed by a non admin user.

In the admin user case the existing line that registers ErrorDescriptor
ensures that everything works. But for the non admin case we need this
additional directive.

Traceback (most recent call last):
  File "/openedx/edx-platform/lms/djangoapps/courseware/views/index.py", line 153, in get
    return self.render(request)
  File "/openedx/edx-platform/lms/djangoapps/courseware/views/index.py", line 217, in render
    return render_to_response('courseware/courseware.html', self._create_courseware_context(request))
  File "/openedx/edx-platform/lms/djangoapps/courseware/views/index.py", line 468, in _create_courseware_context
    courseware_context['fragment'] = self.section.render(self.view, section_context)
  File "/usr/local/lib/python2.7/site-packages/xblock/core.py", line 202, in render
    return self.runtime.render(self, view, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1914, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1335, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/usr/local/lib/python2.7/site-packages/xblock/runtime.py", line 831, in render
    frag = view_fn(context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 262, in student_view
    return self._student_or_public_view(context, prereq_met, prereq_meta_info, banner_text)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 343, in _student_or_public_view
    items = self._render_student_view_for_items(context, display_items, fragment, view) if prereq_met else []
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 485, in _render_student_view_for_items
    rendered_item = item.render(view, context)
  File "/usr/local/lib/python2.7/site-packages/xblock/core.py", line 202, in render
    return self.runtime.render(self, view, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1914, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1335, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/usr/local/lib/python2.7/site-packages/xblock/runtime.py", line 831, in render
    frag = view_fn(context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/vertical_block.py", line 118, in student_view
    return self._student_or_public_view(context, STUDENT_VIEW)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/vertical_block.py", line 85, in _student_or_public_view
    rendered_child = child.render(view, child_block_context)
  File "/usr/local/lib/python2.7/site-packages/xblock/core.py", line 202, in render
    return self.runtime.render(self, view, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1914, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1335, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/usr/local/lib/python2.7/site-packages/xblock/runtime.py", line 831, in render
    frag = view_fn(context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/library_content_module.py", line 314, in student_view
    rendered_child = displayable.render(STUDENT_VIEW, child_context)
  File "/usr/local/lib/python2.7/site-packages/xblock/core.py", line 202, in render
    return self.runtime.render(self, view, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1914, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1335, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/usr/local/lib/python2.7/site-packages/xblock/runtime.py", line 835, in render
    updated_frag = self.wrap_xblock(block, view_name, frag, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1287, in wrap_xblock
    frag = wrapper(block, view, frag, context)
  File "/openedx/edx-platform/openedx/core/lib/xblock_utils/__init__.py", line 155, in wrap_xblock
    add_webpack_to_fragment(frag, class_name)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/util/xmodule_django.py", line 28, in add_webpack_to_fragment
    for chunk in webpack_loader.utils.get_files(bundle_name, extension, config):
  File "/usr/local/lib/python2.7/site-packages/webpack_loader/utils.py", line 31, in get_files
    return list(_get_bundle(bundle_name, extension, config))
  File "/usr/local/lib/python2.7/site-packages/webpack_loader/utils.py", line 23, in _get_bundle
    bundle = get_loader(config).get_bundle(bundle_name)
  File "/usr/local/lib/python2.7/site-packages/webpack_loader/loader.py", line 83, in get_bundle
    raise WebpackBundleLookupError('Cannot resolve bundle {0}.'.format(bundle_name))
WebpackBundleLookupError: Cannot resolve bundle NonStaffErrorModule.
2020-02-04 16:12:57 +01: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
Braden MacDonald
d3f6ed09d8 Learning Contexts, New XBlock Runtime, Blockstore API Client + Content Libraries
https://github.com/edx/edx-platform/pull/20645

This introduces:
* A new XBlock runtime that can read and write XBlocks that are persisted using
  Blockstore instead of Modulestore. The new runtime is currently isolated so
  that it can be tested without risk to the current courseware/runtime.
* Content Libraries v2, which store XBlocks in Blockstore not modulestore
* An API Client for Blockstore
* "Learning Context" plugin API. A learning context is a more abstract concept
  than a course; it's a collection of XBlocks that serves some learning purpose.
2019-08-30 10:31:15 -07:00
David Ormsbee
b3614f3a00 Merge pull request #20954 from open-craft/symbolist/html-block
HtmlModule to HtmlBlock [SE-1089]
2019-08-01 11:36:23 -04:00
Usman Khalid
8dfc8e5fda Convert AboutModule, CourseInfoModule, HtmlModule and StaticTabModule to XBlocks. 2019-07-24 20:19:44 +05:00
Ayub khan
0069d7db33 INCR-419 python3 compatibility 2019-07-16 16:11:02 +05:00
Usman Khalid
0b27c62ca6 Convert VideoModule to VideoBlock.
Some deprecated functionality has been removed:

- Reading data field and transforms being applied in the init() method.
- The source field.
- The source_visible attribute.
2019-06-20 22:12:39 +05:00
Jeremy Bowman
45e390d0ea Upgrade to edx-opaque-keys 1.0.1 (#20817) 2019-06-14 12:15:44 -04:00
Usman Khalid
41c6236e0a Convert CapaModule to ProblemBlock.
* Minimum possible changes were made to merge CapaModule & CapaDescriptor into
  one ProblemBlock class.
* There are no known changes in behavior.
* CapaModule and CapaDescriptor inherited from a number of classes which inherit
  from XModule or XModuleDescriptor but did not depend on them. For all these
  classes the methods were moved to mixins which did not inherit from either and
  then these mixins were added to ProblemBlock in the order which maintains MRO.
2019-05-01 20:08:36 +05:00
Jeremy Bowman
713d64e1e2 TE-2702 Update Read the Docs links to HTTPS 2018-08-15 17:34:01 -04:00
lduarte1991
a9b61c06d3 Remove the annotations feature introduced by Harvard.
There are other annotations features still in the platform but this one
is the one that works with an annotations server that was specialized
and not generally used by most instances of the platform.

The initial PR to remove this was made by 'lduarte1991' and can be found
here: https://github.com/edx/edx-platform/pull/17299

The work done based on the squashed commits:
removed advanced modules config for annotations
remove module files and config for annotations
remove js and css files related to annotations, under ova folders
removed js and css annotator file configs for cms and lms
remove template html files for annotations
removed annotations options from static html book
Added back some files that were originally marked "for OVA" but others used as per acceptance tests
Added back css file configs incorrectly marked as ova
Remove annotation related advanced settings from test.
Correct hls require.js pathing.
2018-07-16 16:55:08 -04:00
George Schneeloch
6aa87d43c0 Fix broken link in comment 2018-02-14 14:48:07 -05:00
David Ormsbee
b87ab764df Separate SectionDescriptor and add highlights field. 2017-10-18 15:54:33 -04:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Calen Pennington
fd0d69594a Upgrade to the latest version of opaque-keys 2016-12-01 13:04:31 -05:00
John Eskew
9e07bb530c Bump edx-opaque-keys version to 0.3.4 2016-09-13 14:54:32 -04:00
E. Kolpakov
33b3dfcc92 Converts Discussion XModule to Discussion XBlock
* Renames discussion_module to discussion_xblock
* Moves common/lib/xmodule/xmodule_discussion to openedx/core/lib/xblock_builtin/xblock_discussion
2016-06-29 06:47:04 +12:00
cahrens
ba06c899de Delete crowdsource_hinter prototype xmodule.
TNL-4195
2016-03-04 15:34:48 -05:00
Calen Pennington
1d60c40bd2 Merge pull request #11215 from CredoReference/xblock_aside_example
XBlockAsides: little example of usage
2016-02-02 10:45:20 -05:00
Clinton Blackburn
29f0a5b172 Updated XModule opaque-keys dependency
Using edx-opaque-keys instead of opaque-keys
2016-01-27 17:19:39 -05:00
Dmitry Viskov
efb86f2169 XBlockAsides Hello world example 2016-01-14 03:19:23 +03:00
Sarina Canelake
2bc7b954ab Remove the graphical slider tool 2015-12-17 13:24:00 -05:00
Sarina Canelake
5386d0a4ca Merge pull request #10845 from edx/kill-ora1
Remove ORA1: Main Pull Request
2015-12-11 17:31:41 -05:00
Sarina Canelake
f689271639 Remove combined_open_ended XModule Python code (ORA1) 2015-12-11 15:07:10 -05:00
Sarina Canelake
46bbd0a668 Remove outdated abtest_module 2015-12-11 14:54:45 -05:00
Sarina Canelake
84a96e40c4 Remove 'Fold It' XModule 2015-12-06 11:38:05 -05:00
David Baumgold
ebe8b25210 Upgrade setuptools to 18.0.1
This reverts commit 1a3f0958b9.
2015-07-30 16:22:42 -04:00
David Baumgold
1a3f0958b9 Revert setuptools upgrade 2015-07-15 09:36:56 -04:00
Régis Behmo
95ebf7f675 Upgrade distribute to the latest stable version of setuptools
'distribute' is the ancestor of 'setuptools', and many packages require
setuptools to be installed.

Upgrade of MySQL-python from 1.2.4 to 1.2.5 is required because of an
incompatibility with setuptools>0.7.
2015-07-09 13:04:33 -04:00
Calen Pennington
a0bae0c794 Convert VerticalModule/VerticalDescriptor to a pure XBlock: VerticalBlock 2015-03-31 09:43:52 -04:00
Braden MacDonald
eddf44d853 Library Content XModule 2015-01-12 13:37:56 +03:00
Braden MacDonald
0ded669909 Split mongo support for libraries and Library XBlock 2014-12-04 21:39:10 +07:00
Calen Pennington
cfcbdc0145 Move to OpaqueKey implementations from the external library
[LMS-2757]
2014-05-29 17:03:35 -04:00
lduarte1991
32e96681f6 Image Annotation Tool: create xmodule and install js files 2014-05-23 14:57:23 -04:00
Don Mitchell
aa7a4cedaa BlockUsageLocators are not AssetKeys. 2014-05-15 08:39:58 -04:00
Don Mitchell
ded28af8b4 Make Locators comply with UsageKey accessors 2014-05-12 15:35:54 -04:00
Calen Pennington
d654798856 Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit updates common/lib/xmodule.

These keys are now objects with a limited interface, and the particular
internal representation is managed by the data storage layer (the
modulestore).

For the LMS, there should be no outward-facing changes to the system.
The keys are, for now, a change to internal representation only. For
Studio, the new serialized form of the keys is used in urls, to allow
for further migration in the future.

Co-Author: Andy Armstrong <andya@edx.org>
Co-Author: Christina Roberts <christina@edx.org>
Co-Author: David Baumgold <db@edx.org>
Co-Author: Diana Huang <dkh@edx.org>
Co-Author: Don Mitchell <dmitchell@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Nimisha Asthagiri <nasthagiri@edx.org>
Co-Author: Sarina Canelake <sarina@edx.org>

[LMS-2370]
2014-05-08 20:28:53 -04:00
Victor Shnayder
281ad63d2b split testing support in the LMS.
Adds a split_test_module XModule, that can choose one of its children
to display, based on a get_condition_for_user API added to the runtime.

To test, add something like this to an xml course, or make equivalent
 tweaks in mongo.

 <vertical url_name="split_test_vert">
    <split_test url_name="split1" experiment_id="0" condition_id_to_child='{"0": "i4x://MITx/6.00x/html/split_test_cond0", "1": "i4x://MITx/6.00x/html/split_test_cond1"}'>
       <html url_name="split_test_cond0">condition 0</html>
       <html url_name="split_test_cond1">condition 1</html>
    </split_test>
  </vertical>

Also needs an experiment configured in the course policy json: e.g.

        "user_partitions": [{"id": 0,
                                      "name": "Experiment 0",
                                      "description": "Unicorns?",
                                      "version": 1,
                                      "groups": [{"id": 0,
                                                        "name": "group 0",
                                                        "version": 1},
                                                        {"id": 1,
                                                        "name": "group 1",
                                                        "version": 1}]}]

(This particular snippet will work inside a course with org MITx
 and course name 6.00x)

Co-Author: Sarina Canelake <sarina@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Diana Huang <diana@edx.org>
Co-Author: Calen Pennington <cale@edx.org>

[LMS-2095]
2014-03-05 13:45:08 -05:00
daniel cebrian
7e2652b5a8 annotation tools
First set of fixes from the pull request

This does not include some of the testing files. The textannotation and
videoannotation test files are not ready. waiting for an answer on the
issue.

Deleted token line in api.py and added test for token generator

Added notes_spec.coffee

remove spec file

fixed minor error with the test

fixes some quality errors

fixed unit test

fixed unit test

added advanced module

Added notes_spec.coffee

remove spec file

Quality and  Testing Coverage

1. in test_textannotation.py I already check for line 75 as it states
in the diff in line 43, same with test_videoanntotation
2. Like you said, exceptions cannot be checked for
firebase_token_generator.py. The version of python that is active on
the edx server is 2.7 or higher, but the code is there for correctness.
Error checking works the same way.
3. I added a test for student/views/.py within tests and deleted the
unused secret assignment.
4. test_token_generator.py is now its own file

Added Secret Token data input

fixed token generator

Annotation Tools in Place

The purpose of this pull request is to install two major modules: (1) a
module to annotate text and (2) a module to annotate video. In either
case an instructor can declare them in advanced settings under
advanced_modules and input content (HTML in text, mp4 or YouTube videos
for video). Students will be able to highlight portions and add their
comments as well as reply to each other. There needs to be a storage
server set up per course as well as a secret token to talk with said
storage.

Changes:
1. Added test to check for the creation of a token in tests.py (along
with the rest of the tests for student/view.py)
2. Removed items in cms pertaining to annotation as this will only be
possible in the lms
3. Added more comments to firebase_token_generator.py, the test files,
students/views.py
4. Added some internationalization stuff to textannotation.html and
videoannotation.html. I need some help with doing it in javascript, but
the html is covered.

incorporated lib for traslate

fixed quality errors

fixed my notes with catch token

Text and Video Annotation Modules - First Iteration

The following code-change is the first iteration of the modules for
text and video annotation.

Installing Modules:
1. Under “Advanced Settings”, add “textannotation” and
“videoannotation” to the list of advanced_modules.
2. Add link to an external storage for annotations under
“annotation_storage_url”
3. Add the secret token for talking with said storage under
“annotation_token_secret”

Using Modules
1. When creating  new unit, you can find Text and Video annotation
modules under “Advanced” component
2. Make sure you have either Text or Video in one unit, but not both.
3. Annotations are only allowed on Live/Public version and not Studio.

Added missing templates and fixed more of the quality errors

Fixed annotator not existing issue in cmd and tried to find the get_html() from the annotation module class to the descriptor

Added a space after # in comments

Fixed issue with an empty Module and token links

Added licenses and fixed vis naming scheme and location.
2014-01-27 13:47:58 -05:00
Ned Batchelder
c8a7b259ff Resolve conflicts merging master to rc/2013-11-21 2013-11-27 11:55:44 -05:00
Jay Zoldak
341875bb18 Remove code related to Pearson Testing Centers 2013-11-26 17:04:19 -05:00
Calen Pennington
9b6edea406 Rename the LTIModuleDescriptor to LTIDescriptor to follow convention 2013-11-26 16:29:34 -05:00
Calen Pennington
864d831ce3 Use XBlock handlers for handle_ajax in XModules
Adds xblock handler_url support to the LMS, and makes handle_ajax use
that code.

[LMS-230] [LMS-229]
2013-11-08 11:08:48 -05:00
Ned Batchelder
a1d464aed9 Update XBlock requirement to new XML code. 2013-09-30 21:09:43 -04:00
Ned Batchelder
3a6450c3fc Use XModuleDescriptor.parse_xml to interpret XML. 2013-09-30 21:09:43 -04:00
Valera Rozuvan
d02ef8bc12 Add Learning Tools Interoperability (LTI) blade.
LTI blade allows to include LTI components to courses.
Python integration, Jasmine and acceptance tests are included.
2013-09-09 23:54:49 +03:00
Alexander Kryklia
719ec8f9d8 Revert "Merge pull request #804 from edx/valera/lti_module"
This reverts commit 2894b21c32, reversing
changes made to 34d0fe1554.
2013-09-09 22:51:57 +03:00
Valera Rozuvan
417ddcaaa1 LTI module with tests 2013-09-09 19:13:20 +03:00
Vasyl Nakvasiuk
b33b5c7bd4 Python: videoalpha -> video. 2013-08-12 14:31:48 +03:00
Felix Sun
6f6a451784 Working prototype of crowdsourced hinting module.
Conflicts:
	common/static/coffee/src/logger.coffee
2013-07-01 10:25:03 -04:00