16 Commits

Author SHA1 Message Date
Kaustav Banerjee
702866b225 feat: delete XModuleDescriptorToXBlockMixin (#29927)
This:
1. Deletes XModuleDescriptorToXBlockMixin
2. Deletes `metadata_traslations` and `_translate()` from `XmlParserMixin`,
    and all related implementations.
3. Removes translations of deprecated OLX attributes during import/export:
    <old_attr> : <new_attr>
    - 'slug' : 'url_name'
    - 'name' : 'display_name'
    - 'id' : 'discussion_id' (Discussion XBlock)
    - 'for' : 'discussion_target' (Discussion XBlock)
    - 'attempts' : 'max_attempts' (CAPA)
2022-04-21 16:15:00 +01:00
Carlos Muniz
37bf73ca50 refactor: Replace videosequence & problemset (#29905)
`videosequence` and `problemset` have been replaced with `sequential`.

`problemset` and `videosequence` are old-but-not-entirely-unused aliases to the `sequential` block type (in Studio-speak, "Subsection").
Since [these block types have been removed from the 6 courses that used them](https://openedx.atlassian.net/browse/DEPR-151?focusedCommentId=588197), this ticket removes the support for the `problemset` and `videosequence` block-types.

For more information, see ticket: [DEPR-151](https://openedx.atlassian.net/browse/DEPR-151)
2022-02-16 10:21:31 -05:00
Kyle McCormick
8813a61da2 feat!: remove SemanticSectionDescriptor, the final XModule (#26990)
A "section" tag in an OLX upload used to map to the
SemanticSectionDescriptor, which translated it into a Sequence
("sequential" tag). This is both obscure and confusing, since it uses
language that predates Studio. Back in the LMS prototype days,
"section" was inconsistently used to be interchangeable with "sequence"
and "sequential", and what Studio today calls a "section" was called a
"chapter". Bits of this legacy terminology are still around in the
courseware rendering code.

The upshot is that if you make an OLX tag "section" before this commit,
it would not map to what we call a "Section" in all our documentation,
but to a "Subsection"; furthermore, if that <section> only had one child
element, the node would be replaced with its singular child, removing
the <section> node from the course tree entirely.

The fact that you can make a "section" OLX tag
at all is nowhere in our documentation because courses haven't been
written that way since late 2011 or early 2012.

SemanticSectionDescriptor came up as part of the XModule ->
XBlock conversion efforts as a legacy XModule that isn't worth
converting. With the removal of this class, all XBlocks
in edx-platform are "pure" XBlocks, ending our reliance
on the XModule-to-XBlock shimming infrastructure.

This commit also removes the process_includes decorator, which was only
used for "section" tags. This does NOT delete the ProblemBlock-specific
<include> tag, which is still supported (if obscure).

There is a chance that through tribal knowledge or copy-paste, some
section tags survive in the wild of old edX courses. It's difficult for
us to assess because by its nature, this tag doesn't just say
"section", but instead actually does the mutation on import so it's
stored as "sequential" in the modulestore–therefore things like
CourseGraph can't detect it.
The fix for any such XML-authored courses is:
* For instances of <section> that wrap a single child node,
  replace the <section> node in favor of its child node.
* For instances of <section> that wrap a sequence of children,
  substitute <section> with <sequential>
Note that "<section>" is a valid HTML tag
type and so may show up in any component that can contain HTML and is
unrelated to the course structure OLX tag alias "<section>" that this
commit removes.

DEPR-124
2021-03-15 09:04:23 -04:00
Adam Palay
bfb319db9a add discussion_id to course structure dump command (AN-6696)
add test case for discussion_id already set in XML
2016-05-09 11:24:37 -04:00
Ned Batchelder
b6bd293266 Clean up some pre-existing formatting. 2014-01-14 13:09:35 -05:00
Chris Dodge
ab4012cc59 fix up some of the test courses which had hardcoded that quot; escaping 2013-07-12 11:33:46 -04:00
Peter Fogg
8159e86141 Many changes to finish up PR. To wit:
-- Changed docstrings to use double quote.
-- More consistent naming for youtube IDs (normal_speed_id -> youtube_id_1_0).
-- Formatting changes for readability.
-- Updated test XML to expect JSON-encoded strings; prevents tests from spuriously failing.
2013-06-17 13:46:20 -04:00
Peter Fogg
5cee351896 Update XML in old video tests. This change tags like <video youtube="1.0:abcdefg"> to <video youtube_id_1_0="abcdefg". 2013-06-13 11:51:04 -04:00
Chris Dodge
5137119f2b add a simple Studio walkthough to check page loads 2013-04-08 13:55:38 -04:00
Chris Dodge
288620592a get metadata inheritance to work with draft stores. Fix bug on .publish() method whereby inherited metadata got written to the DB as 'own-metadata'. Change filter in mako_module.py to return list of own-metadata and inherited-metadata as 'editable-metadata'. Also, add unit test for draft metadata-inheritance and publish 2013-04-07 19:33:04 -04:00
Chris Dodge
103508b45d remove empty attempts and weights from simple test course 2013-02-21 15:41:59 -05:00
Chris Dodge
a7f6545cbc add unit test 2013-02-21 11:22:20 -05:00
Victor Shnayder
ecf432ad78 Make the simple course pass roundtrip test:
- add 'type' and 'points' to capa_module metadata
- replace old 'title' tag with display_name
2012-08-07 11:06:47 -04:00
Victor Shnayder
e6e290f525 Make initial import-export tests pass.
TODO:
* need unique slugs for errors so they don't overwrite each other on export.
  - try to preserve origin slug.  If not possible, generate random one.

* figure out what metadata to strip.  e.g.
 ({'data': '<problem><p><h1>Finger Exercise 1...'},
    {'data': '<problem points="1" type="lecture"><p><h1>Finger Exercise 1...'},
    False)
  - where did points and type come from?  Do we want them there?


* separate broken and non-broken test courses
2012-08-07 11:06:47 -04:00
Victor Shnayder
168f76ce5a Add jump_to functionality to lms on mongo
* More tests for mongo modulestore, including tweaks to test files
* add location_to_id method to CourseDescriptors
* Implement path_to_location method in mongo.py
  - TODO: does not handle position in sequences yet.
* fix bug in jump_to view.
2012-07-27 16:08:24 -04:00
Victor Shnayder
eb5989aa99 Ready to implement path_to_location
* Clean up test data for simple, toy courses
* clean up test_mongo.py
* write initial test for path_to_location
* hook up view to use path_to_location

Next: actually implement it :)
2012-07-27 16:08:24 -04:00