Commit Graph

143 Commits

Author SHA1 Message Date
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
David Ormsbee
d0c353609d Don't break exports for uninstalled XBlock content
When an unknown content type is encountered, it's imported as a
RawDescriptor, which will preserve the OLX and export it back out. But
if we import a course while an XBlock is installed and then export it
after that XBlock is removed, we export RawDescriptors that never got to
save the original OLX and have a blank "data" field. Attempting to
export this used to fail and break export altogether. We now test that
the export continues to complete, and just skips over anything it can't
serialize out.

Note that this will stil export pointers in the export, so if you
uninstalled a "AmazingBlock" and exported, you might see something like
the following in a vertical's XML::

<vertical display_name="Unit">
  <amazing url_name="2edebb68d5734395a06b8a62b9bb677e"/>
</vertical>

However there would be no corresponding file at:
  /amazing/2edebb68d5734395a06b8a62b9bb677e.xml

In fact, there would be no /amazing directory at all in the export.

The better long term solution is probably to leave the pointer as-is
and export some generic file that can't be mistaken for OLX (say a
JSON file) that represents the raw key-value data we have in
Modulstore for the now unknown XBlock type. However, this commit at
least keeps export from crashing out entirely.
2019-02-06 15:36:59 -05:00
Diana Huang
6572d99e76 Remove all references to datadog from our code. 2019-01-08 15:41:24 -05:00
Amir Qayyum Khan
0e2febbce2 OLX export: Reverted url_name from a constant to course run
- New exported courses include course run information in:
  - `url_name` of root course node
  - file name of root node in course folder
  - root key name in policy.json
  - directory name inside policies folder

- when imported via management command, the OLX will overwrite an
available existing course with the same course key (i.e. same org,
course number and course run)
  - if there is no matching course, one will be created

- when imported via the studio web ui (or import API), the OLX will
replace the current course (no change in behavior)

- courses exported with this commit have been tested to import via
management command and studio web UI in hawthorn and ginkgo releases.
They should also work in prior releases, but have not been tested.
2018-09-14 14:50:40 +05:00
Qubad786
f9476ab4ff Update old transcripts metadata present in video xml with the new transcripts for backward compatibility. 2018-05-25 21:29:26 +05:00
Jeremy Bowman
65472399df PLAT-1861 Upgrade to pyfilesystem2 2017-12-22 14:44:24 -05:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
E. Kolpakov
fe6a942baa [TNL-5001] Import-export issues when importing legacy discussion OLX format
Observed Problems:
1. Discussion categories and targets were missing
2. When imported over existing course Discussion IDs have changed unexpectedly - all posts were missing

Solutions:
* Parsing legacy discussion OLX
* Do not force exporting discussion ID
2016-07-25 14:35:19 -07: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
Dmitry Viskov
0151a149b0 Asides can be exported with the rest of courseware through the Export function within CMS 2016-04-16 03:48:23 +03:00
Dmitry Viskov
209ddc700d Difficulty selectbox in Studio (based on new XBlockAside functionality). Include:
- adaptation asides to be imported from the XML
- updating SplitMongo to handle XBlockAsides (CRUD operations)
- updating Studio to handle XBlockAsides handler calls
- updating xblock/core.js to properly init XBlockAsides JavaScript
2016-03-02 03:37:13 +03:00
Sarina Canelake
ade863e994 Remove CMS Course Checklists feature 2015-12-11 10:32:14 -05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Ned Batchelder
f54fe787c6 Remove needless 'disable=no-member' pragmas 2015-08-03 17:47:44 -04:00
Syed Hassan Raza
1175047d12 update the attrib using dict-->update() function 2015-05-04 21:07:40 +05:00
Calen Pennington
da2964421e Extract a pure-XBlock version of XmlDescriptor 2015-03-31 09:43:51 -04:00
John Eskew
34adb256a6 Add datadog counters everywhere a "VS[compat]" comment exists.
Conflicts:
	common/lib/xmodule/xmodule/xml_module.py
2015-03-26 16:18:15 -04:00
Don Mitchell
de5e88561f Make XmlModuleStore handle asides
PLAT-221
2014-12-17 13:51:10 -05:00
Don Mitchell
85fa712fdf Change published_date to published_on
to make consistent with other edit info timestamps
LMS-11184
2014-09-02 13:20:23 -04:00
Don Mitchell
3b43f34b20 XML export maps keys into xml expected format 2014-08-15 16:02:48 -04:00
cahrens
77702fae09 Getting draft split_test_module instances to import/export.
STUD-327
2014-07-23 11:27:23 -04:00
Calen Pennington
d354571e95 Use field scopes to compute which metadata to strip from the definition during XML import of XMLModule subclasses 2014-07-17 10:35:37 -04:00
Nimisha Asthagiri
a9213509c3 Enable Mixed Modulestore STUD-1540
Refactor get_parent_locations STUD-1663
2014-06-26 18:00:11 -04:00
Calen Pennington
db17bf4c15 Add tests of XML exporting to test_xblock_wrappers 2014-02-07 15:50:34 -05:00
Calen Pennington
79e1dae0e7 Fix pylint violations from #2129 2014-01-15 11:05:56 -05:00
Calen Pennington
46109bb3e8 Use XBlock xml serialization and deserialization
XModules continue to use their own interface for xml, but provide an
adaptor that makes the the XBlock interface available.

[LMS-179]
2014-01-14 13:28:47 -05:00
Ned Batchelder
1932c126b8 Rename DbModel to KvsFieldData. 2014-01-14 13:09:36 -05:00
Ned Batchelder
b6bd293266 Clean up some pre-existing formatting. 2014-01-14 13:09:35 -05:00
cahrens
df5b22e545 Fix exception to support unicode (and print url_name).
Part of STUD-868
2013-12-20 12:52:08 -05:00
Jay Zoldak
341875bb18 Remove code related to Pearson Testing Centers 2013-11-26 17:04:19 -05:00
Ned Batchelder
3bbdd2f4c3 No need to invoke classmethods through self.__class__ 2013-10-02 10:35:58 -04:00
Ned Batchelder
c36adf84a0 Minor cosmetic code fixes. 2013-09-30 21:09:43 -04:00
Ned Batchelder
d7e441088b Adjust parameters to construct_xblock_from_class to match XBlock repo. 2013-09-30 21:09:43 -04:00
Calen Pennington
f500b72290 Make sure that we have the right set of fields available during xml parsing
We had a bug where mixins weren't being applied before `load_from_xml`
was called. This meant that not all of the fields were being loaded
correctly. To fix it, we used the mixoligist from the runtime to apply
the mixins earlier in the process. However, that caused the mixins to be
applied twice.

The included fixes to xblock resolved the multiply-applied mixins, and
the fixes to the parsing code make it simpler to understand, and add
some unit tests of the parsing to boot.
2013-09-27 10:57:39 -04:00
Julian Arni
920b76410c Revert "don't remove comments from xml module"
This reverts commit 343456e314.
2013-09-22 21:39:36 -04:00
Adam
343456e314 don't remove comments from xml module 2013-09-18 15:39:18 -04:00
cahrens
1184a97b0b Do not store expanded action URLs.
They are not portable. STUD-681.

Minor updates.
2013-09-12 09:47:30 -04:00
Don Mitchell
fc131fa841 Add InheritanceKVS and standardize inherited attr patterns 2013-09-06 12:19:50 -04:00
Calen Pennington
8201b1412e Use XBlock 0.3 2013-09-06 09:45:59 -04:00
cahrens
96b4914fef Make our deserializing consistent with serializing.
Also fixes problems with double-quoted strings (historical artifact).

STUD-640

Conflicts:

	common/lib/xmodule/xmodule/video_module.py
2013-08-15 16:17:29 -04:00
Chris Dodge
22802a4d29 change from_xml class method on video class to make sure we honor the fact that the xml string could actually be a pointer to another file on disk which actually contains the attributes 2013-07-19 13:54:22 -04:00
Don Mitchell
3722685e1a No longer persist XModule templates
Instead, we use XModule field default values when creating an empty
XModule. Driven by this use case, we also allow for XModules to be
created in memory without being persisted to the database at all. This
necessitates a change to the Modulestore api, replacing clone_item with
create_draft and save_xmodule.
2013-07-16 14:33:58 -04:00
Chris Dodge
ac4e20b4f3 change serialize_field to check for type. If value is a string, simply return that, otherwise do a json.dumps 2013-07-12 15:27:36 -04:00
Chris Dodge
958ecdb053 raise a more appropriate Exception 2013-07-12 12:47:51 -04:00
Chris Dodge
50bea28d75 Add a 'string literal' serialization method and use it in the lambda function mapping table when the value to xml serialize is of basestring type. Also a couple of drive-by pep8 fixes. 2013-07-12 11:13:59 -04:00
Don Mitchell
1c5706fb1f Add JSON encoder for datetimes to xml export
During policy export, we want to write any python datetime objects found
as iso timestamps, rather than throwing exceptions.
2013-06-28 14:19:10 -04:00
Don Mitchell
8b23eeca7e Minor pylint/whitespace changes 2013-06-25 22:34:29 -04:00
Don Mitchell
1ff022e181 Incidental pep8 changes 2013-06-18 17:25:06 -04:00
Calen Pennington
82606a062c Make XModuleDescriptor use __init__ from XBlock
Fixes JIRA LMS-203
2013-06-17 13:38:57 -04:00
cahrens
6e92ddf3dd Cannot set String field to a dict anymore! 2013-06-12 17:07:41 -04:00