24 Commits

Author SHA1 Message Date
0x29a
a027f36724 refactor: rename module -> block within xmodule 2023-01-30 18:15:22 +01:00
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
Toby Lawrence
0009d53c53 Adding optimized images in batches [15/19] 2016-01-13 20:38:42 -05:00
Toby Lawrence
451b0a9c66 Revert "Crush down images."
This reverts commit 8402be3b20.
2016-01-13 19:12:13 -05:00
Toby Lawrence
8402be3b20 Crush down images.
Ran these suckers through ImageOptim, which crunched 'em down real nice.
2016-01-13 18:29:00 -05:00
Calen Pennington
8cba4702ce Shrink images using trimage
.../js/vendor/ova/images/previous_pressed.png      | Bin 755 -> 665 bytes
 .../static/js/vendor/ova/images/previous_rest.png  | Bin 661 -> 572 bytes
 .../js/vendor/ova/images/zoomin_grouphover.png     | Bin 612 -> 496 bytes
 .../static/js/vendor/ova/images/zoomin_hover.png   | Bin 608 -> 506 bytes
 .../static/js/vendor/ova/images/zoomin_pressed.png | Bin 615 -> 515 bytes
 common/static/js/vendor/ova/images/zoomin_rest.png | Bin 612 -> 496 bytes
 .../js/vendor/ova/images/zoomout_grouphover.png    | Bin 504 -> 397 bytes
 .../static/js/vendor/ova/images/zoomout_hover.png  | Bin 559 -> 461 bytes
 .../js/vendor/ova/images/zoomout_pressed.png       | Bin 561 -> 458 bytes
 .../static/js/vendor/ova/images/zoomout_rest.png   | Bin 504 -> 397 bytes
 common/test/data/aside/static/just_a_test.jpg      | Bin 547 -> 517 bytes
 common/test/data/badges/good.png                   | Bin 298 -> 91 bytes
 common/test/data/badges/large.png                  | Bin 431556 -> 429842 bytes
 common/test/data/badges/unbalanced.png             | Bin 232 -> 86 bytes
 .../static/images/course_image.jpg                 | Bin 12626 -> 12617 bytes
 .../static/images/professor-sandel.jpg             | Bin 453715 -> 447109 bytes
 .../Screen Shot 2013-04-16 at 1.43.36 PM.png       | Bin 8733 -> 1525 bytes
 .../data/simple/static/images_course_image.jpg     | Bin 547 -> 517 bytes
 common/test/data/static/picture1.jpg               | Bin 10905 -> 6857 bytes
 common/test/data/static/picture2.jpg               | Bin 13598 -> 9739 bytes
 common/test/data/static/picture3.jpg               | Bin 14977 -> 9946 bytes
 common/test/data/toy/static/just_a_test.jpg        | Bin 547 -> 517 bytes
 common/test/data/uploads/Signature-0.png           | Bin 31182 -> 14473 bytes
 common/test/data/uploads/Signature-1.png           | Bin 31182 -> 14473 bytes
 common/test/data/uploads/larger_image.jpg          | Bin 1070335 -> 1053927 bytes
 25 files changed, 0 insertions(+), 0 deletions(-)
2016-01-07 10:48:40 -05:00
Carson Gee
c4ea338035 Additional logic to handle more course_image URL edge cases
This changes logic to allow more missed use cases of course_image to
work properly.  The cases are:

. XML courses with the course_image attribute set
. Mongo courses that are imported without a contentstore
. Mongo courses that have course_image set but don't have a content store

It also exports default images_static_course.jpg to
images/static_course.jpg to handle a use case where a course author
uploaded an image to the default location in studio without using the
studio interface for adding course images, they then export the course, and then
import it without a contentstore
2014-04-24 16:54:40 -04:00
Ned Batchelder
b6bd293266 Clean up some pre-existing formatting. 2014-01-14 13:09:35 -05:00
cahrens
4c126c7b28 Add & to contents to verify that import/export still works.
Part of STUD-91
2013-12-30 15:08:53 -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
Victor Shnayder
f87433e346 folders and a bit of initial test data for xml validation 2012-06-21 15:27:19 -04:00