Skip to content

Commit

Permalink
Merge pull request openedx#30621 from openedx/revert-30394-umar/move-…
Browse files Browse the repository at this point in the history
…xmdule-folder-to-root

Revert "refactor: move xmodule folder to root"

Today, it's a holiday in the US. We normally don't deploy huge PRs on holiday. So just reverting it.
  • Loading branch information
mumarkhan999 authored Jun 20, 2022
2 parents 182eb39 + d890f06 commit 46d848b
Show file tree
Hide file tree
Showing 487 changed files with 339 additions and 216 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ source =
cms
common/djangoapps
common/lib/capa
common/lib/xmodule
lms
openedx
pavelib
scripts
xmodule

omit =
cms/envs/*
Expand Down
1 change: 0 additions & 1 deletion .coveragerc-local
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ source =
openedx
pavelib
scripts
xmodule

omit =
cms/envs/*
Expand Down
14 changes: 7 additions & 7 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test_root/staticfiles
common/static/xmodule


# Symlinks into xmodule/js
# Symlinks into common/lib/xmodule/xmodule/js
cms/static/xmodule_js
lms/static/xmodule_js

Expand Down Expand Up @@ -50,19 +50,19 @@ common/lib/capa/capa/tests/test_files/js/test_problem_display.js
common/lib/capa/capa/tests/test_files/js/test_problem_generator.js
common/lib/capa/capa/tests/test_files/js/test_problem_grader.js
common/lib/capa/capa/tests/test_files/js/xproblem.js
common/lib/xmodule/xmodule/js/spec/annotatable/display_spec.js
common/lib/xmodule/xmodule/js/spec/capa/display_spec.js
common/lib/xmodule/xmodule/js/spec/html/edit_spec.js
common/lib/xmodule/xmodule/js/spec/problem/edit_spec_hint.js
common/lib/xmodule/xmodule/js/spec/problem/edit_spec.js
common/lib/xmodule/xmodule/js/spec/tabs/edit.js
lms/static/js/spec/calculator_spec.js
lms/static/js/spec/courseware_spec.js
lms/static/js/spec/feedback_form_spec.js
lms/static/js/spec/helper.js
lms/static/js/spec/histogram_spec.js
lms/static/js/spec/modules/tab_spec.js
lms/static/js/spec/requirejs_spec.js
xmodule/js/spec/annotatable/display_spec.js
xmodule/js/spec/capa/display_spec.js
xmodule/js/spec/html/edit_spec.js
xmodule/js/spec/problem/edit_spec_hint.js
xmodule/js/spec/problem/edit_spec.js
xmodule/js/spec/tabs/edit.js


!**/.eslintrc.js
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Core
common/djangoapps/student/
common/djangoapps/third_party_auth/
common/lib/xmodule/xmodule/
lms/djangoapps/course_api/blocks
lms/djangoapps/courseware/
lms/djangoapps/grades/
Expand All @@ -14,7 +15,6 @@ openedx/core/djangoapps/oauth_dispatch
openedx/core/djangoapps/user_api/
openedx/core/djangoapps/user_authn/
openedx/features/course_experience/
xmodule/

# Core Extensions
common/lib/xmodule/xmodule/capa_module.py
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/verify-tests-count/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
shell: bash
run: |
echo "root_cms_unit_tests_count=$(pytest --collect-only --ds=cms.envs.test cms/ -q | head -n -2 | wc -l)" >> $GITHUB_ENV
echo "root_lms_unit_tests_count=$(pytest --collect-only --ds=lms.envs.test lms/ openedx/ common/djangoapps/ common/lib/ xmodule/ -q | head -n -2 | wc -l)" >> $GITHUB_ENV
echo "root_lms_unit_tests_count=$(pytest --collect-only --ds=lms.envs.test lms/ openedx/ common/djangoapps/ common/lib/ -q | head -n -2 | wc -l)" >> $GITHUB_ENV
- name: get GHA unit test paths
shell: bash
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pylint-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jobs:
path: "common"
- module-name: cms
path: "cms"
- module-name: xmodule
path: "xmodule"


name: pylint ${{ matrix.module-name }}
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/unit-test-shards.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,5 @@
"paths": [
"common/djangoapps/"
]
},
"xmodule-1": {
"settings": "lms.envs.test",
"paths": [
"xmodule/"
]
}
}
1 change: 0 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
"common-1",
"common-2",
"common-3",
"xmodule-1"
]


Expand Down
2 changes: 1 addition & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
xmodule/css
common/lib/xmodule/xmodule/css
common/static/sass/bourbon
common/static/xmodule/modules/css
common/test/test-theme
Expand Down
2 changes: 1 addition & 1 deletion cms/static/cms/js/require-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
'backbone.paginator': 'common/js/vendor/backbone.paginator',
'tinymce': 'js/vendor/tinymce/js/tinymce/tinymce.full.min',
'jquery.tinymce': 'js/vendor/tinymce/js/tinymce/jquery.tinymce.min',
'xmodule': '/xmodule',
'xmodule': '/xmodule/xmodule',
'xblock/cms.runtime.v1': 'cms/js/xblock/cms.runtime.v1',
'xblock': 'common/js/xblock',
'utility': 'js/src/utility',
Expand Down
2 changes: 1 addition & 1 deletion cms/static/xmodule_js
69 changes: 69 additions & 0 deletions common/lib/xmodule/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# lint-amnesty, pylint: disable=missing-module-docstring

from setuptools import find_packages, setup

XBLOCKS = [
"about = xmodule.html_module:AboutBlock",
"book = xmodule.template_module:TranslateCustomTagBlock",
"annotatable = xmodule.annotatable_module:AnnotatableBlock",
"chapter = xmodule.seq_module:SectionBlock",
"conditional = xmodule.conditional_module:ConditionalBlock",
"course = xmodule.course_module:CourseBlock",
"course_info = xmodule.html_module:CourseInfoBlock",
"customtag = xmodule.template_module:CustomTagBlock",
"custom_tag_template = xmodule.template_module:CustomTagTemplateBlock",
"discuss = xmodule.template_module:TranslateCustomTagBlock",
"error = xmodule.error_module:ErrorBlock",
"hidden = xmodule.hidden_module:HiddenDescriptor",
"html = xmodule.html_module:HtmlBlock",
"image = xmodule.template_module:TranslateCustomTagBlock",
"library = xmodule.library_root_xblock:LibraryRoot",
"library_content = xmodule.library_content_module:LibraryContentBlock",
"library_sourced = xmodule.library_sourced_block:LibrarySourcedBlock",
"lti = xmodule.lti_module:LTIBlock",
"nonstaff_error = xmodule.error_module:NonStaffErrorBlock",
"poll_question = xmodule.poll_module:PollBlock",
"problem = xmodule.capa_module:ProblemBlock",
"randomize = xmodule.randomize_module:RandomizeBlock",
"sequential = xmodule.seq_module:SequenceBlock",
"slides = xmodule.template_module:TranslateCustomTagBlock",
"split_test = xmodule.split_test_module:SplitTestBlock",
"static_tab = xmodule.html_module:StaticTabBlock",
"unit = xmodule.unit_block:UnitBlock",
"vertical = xmodule.vertical_block:VerticalBlock",
"video = xmodule.video_module:VideoBlock",
"videoalpha = xmodule.video_module:VideoBlock",
"videodev = xmodule.template_module:TranslateCustomTagBlock",
"word_cloud = xmodule.word_cloud_module:WordCloudBlock",
"wrapper = xmodule.wrapper_module:WrapperBlock",
]
XBLOCKS_ASIDES = [
'tagging_aside = cms.lib.xblock.tagging:StructuredTagsAside',
]

setup(
name="XModule",
version="0.1.2",
packages=find_packages(exclude=["tests"]),
install_requires=[
'setuptools',
'docopt',
'capa',
'path.py',
'webob',
'edx-opaque-keys>=0.4.0',
],
package_data={
'xmodule': ['js/module/*'],
},

# See https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins
# for a description of entry_points
entry_points={
'xblock.v1': XBLOCKS,
'xblock_asides.v1': XBLOCKS_ASIDES,
'console_scripts': [
'xmodule_assets = xmodule.static_content:main',
],
},
)
45 changes: 45 additions & 0 deletions common/lib/xmodule/test_files/formularesponse_with_hint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<problem>
<script type="loncapa/python">
# from loncapa import *
x1 = 4 # lc_random(2,4,1)
y1 = 5 # lc_random(3,7,1)

x2 = 10 # lc_random(x1+1,9,1)
y2 = 20 # lc_random(y1+1,15,1)

m = (y2-y1)/(x2-x1)
b = y1 - m*x1
answer = "%s*x+%s" % (m,b)
answer = answer.replace('+-','-')

inverted_m = (x2-x1)/(y2-y1)
inverted_b = b
wrongans = "%s*x+%s" % (inverted_m,inverted_b)
wrongans = wrongans.replace('+-','-')
</script>

<text>
<p>Hints can be provided to students, based on the last response given, as well as the history of responses given. Here is an example of a hint produced by a Formula Response problem.</p>

<p>
What is the equation of the line which passess through ($x1,$y1) and
($x2,$y2)?</p>

<p>The correct answer is <tt>$answer</tt>. A common error is to invert the equation for the slope. Enter <tt>
$wrongans</tt> to see a hint.</p>

</text>

<formularesponse samples="x@-5:5#11" id="11" answer="$answer">
<responseparam description="Numerical Tolerance" type="tolerance" default="0.001" name="tol" />
<text>y = <formulaequationinput size="25" /></text>
<hintgroup>
<formulahint samples="x@-5:5#11" answer="$wrongans" name="inversegrad">
</formulahint>
<hintpart on="inversegrad">
<text>You have inverted the slope in the question.</text>
</hintpart>
</hintgroup>
</formularesponse>
</problem>

25 changes: 25 additions & 0 deletions common/lib/xmodule/test_files/stringresponse_with_hint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<problem >
<text><h2>Example: String Response Problem</h2>
<br/>
</text>

<text>Which US state has Lansing as its capital?</text>
<stringresponse answer="Michigan" type="ci">
<textline size="20" />
<hintgroup>
<stringhint answer="wisconsin" type="cs" name="wisc">
</stringhint>
<stringhint answer="minnesota" type="cs" name="minn">
</stringhint>
<hintpart on="wisc">
<text>The state capital of Wisconsin is Madison.</text>
</hintpart>
<hintpart on="minn">
<text>The state capital of Minnesota is St. Paul.</text>
</hintpart>
<hintpart on="default">
<text>The state you are looking for is also known as the 'Great Lakes State'</text>
</hintpart>
</hintgroup>
</stringresponse>
</problem>
26 changes: 26 additions & 0 deletions common/lib/xmodule/test_files/symbolicresponse.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<problem>
<text>
<h2>Example: Symbolic Math Response Problem</h2>

<p>
A symbolic math response problem presents one or more symbolic math
input fields for input. Correctness of input is evaluated based on
the symbolic properties of the expression entered. The student enters
text, but sees a proper symbolic rendition of the entered formula, in
real time, next to the input box.
</p>

<p>This is a correct answer which may be entered below: </p>
<p><tt>cos(theta)*[[1,0],[0,1]] + i*sin(theta)*[[0,1],[1,0]]</tt></p>

<text>Compute [mathjax] U = \exp\left( i \theta \left[ \begin{matrix} 0 &amp; 1 \\ 1 &amp; 0 \end{matrix} \right] \right) [/mathjax]
and give the resulting \(2 \times 2\) matrix. <br/>
Your input should be typed in as a list of lists, eg <tt>[[1,2],[3,4]]</tt>. <br/>
[mathjax]U=[/mathjax] <symbolicresponse cfn="symmath_check" answer="[[cos(theta),i*sin(theta)],[i*sin(theta),cos(theta)]]" options="matrix,imaginary" id="filenamedogi0VpEBOWedxsymmathresponse_1" state="unsubmitted">
<textline size="80" math="1" response_id="2" answer_id="1" id="filenamedogi0VpEBOWedxsymmathresponse_2_1"/>
</symbolicresponse>
<br/>
</text>

</text>
</problem>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// to the server.

import BookmarkButton from 'course_bookmarks/js/views/bookmark_button';
import {markBlocksCompletedOnViewIfNeeded} from '../../../../../lms/static/completion/js/CompletionOnViewService.js';
import {markBlocksCompletedOnViewIfNeeded} from '../../../../../../../../lms/static/completion/js/CompletionOnViewService.js';

var SEEN_COMPLETABLES = new Set();

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ def __init__(self, *args, **kwargs):
self._grading_policy = {}
self.set_grading_policy(self.grading_policy)

if not self.discussion_topics:
if self.discussion_topics == {}:
self.discussion_topics = {_('General'): {'id': self.location.html_id()}}

try:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions common/lib/xmodule/xmodule/js/common_static
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@

import '../../common/static/js/src/ajax_prefix.js';
import '../../common/static/common/js/vendor/underscore.js';
import '../../common/static/common/js/vendor/backbone.js';
import '../../common/static/js/vendor/CodeMirror/codemirror.js';
import '../../common/static/js/vendor/draggabilly.js';
import '../../common/static/common/js/vendor/jquery.js';
import '../../common/static/common/js/vendor/jquery-migrate.js';
import '../../common/static/js/vendor/jquery.cookie.js';
import '../../common/static/js/vendor/jquery.leanModal.js';
import '../../common/static/js/vendor/jquery.timeago.js';
import '../../common/static/js/vendor/jquery-ui.min.js';
import '../../common/static/js/vendor/jquery.ui.draggable.js';
import '../../common/static/js/vendor/json2.js';
// import '../../common/static/common/js/vendor/moment-with-locales.js';
import '../../common/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js';
import '../../common/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js';
import '../../common/static/js/src/accessibility_tools.js';
import '../../common/static/js/src/logger.js';
import '../../common/static/js/src/utility.js';
import '../../common/static/js/test/add_ajax_prefix.js';
import '../../common/static/js/test/i18n.js';
import '../../common/static/common/js/vendor/hls.js';
import '../../../../static/js/src/ajax_prefix.js';
import '../../../../static/common/js/vendor/underscore.js';
import '../../../../static/common/js/vendor/backbone.js';
import '../../../../static/js/vendor/CodeMirror/codemirror.js';
import '../../../../static/js/vendor/draggabilly.js';
import '../../../../static/common/js/vendor/jquery.js';
import '../../../../static/common/js/vendor/jquery-migrate.js';
import '../../../../static/js/vendor/jquery.cookie.js';
import '../../../../static/js/vendor/jquery.leanModal.js';
import '../../../../static/js/vendor/jquery.timeago.js';
import '../../../../static/js/vendor/jquery-ui.min.js';
import '../../../../static/js/vendor/jquery.ui.draggable.js';
import '../../../../static/js/vendor/json2.js';
// import '../../../../static/common/js/vendor/moment-with-locales.js';
import '../../../../static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js';
import '../../../../static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js';
import '../../../../static/js/src/accessibility_tools.js';
import '../../../../static/js/src/logger.js';
import '../../../../static/js/src/utility.js';
import '../../../../static/js/test/add_ajax_prefix.js';
import '../../../../static/js/test/i18n.js';
import '../../../../static/common/js/vendor/hls.js';
import '../assets/vertical/public/js/vertical_student_view.js';


import '../../common/static/js/vendor/jasmine-imagediff.js';
import '../../common/static/common/js/spec_helpers/jasmine-waituntil.js';
import '../../common/static/common/js/spec_helpers/jasmine-extensions.js';
import '../../common/static/common/js/vendor/sinon.js';
import '../../../../static/js/vendor/jasmine-imagediff.js';
import '../../../../static/common/js/spec_helpers/jasmine-waituntil.js';
import '../../../../static/common/js/spec_helpers/jasmine-extensions.js';
import '../../../../static/common/js/vendor/sinon.js';

// These libraries are used by the tests (and the code under test)
// but not explicitly imported
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
ASSET_XML_PATH = COURSE_DATA_DIR / AssetMetadata.EXPORTED_ASSET_DIR / AssetMetadata.EXPORTED_ASSET_FILENAME

# Path where asset XML schema definition file is located.
ASSET_XSD_PATH = PLATFORM_ROOT / "xmodule" / "assetstore" / "tests" / ASSET_XSD_FILE
ASSET_XSD_PATH = PLATFORM_ROOT / "common" / "lib" / "xmodule" / "xmodule" / "assetstore" / "tests" / ASSET_XSD_FILE


@ddt.ddt
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 46d848b

Please sign in to comment.