Commit Graph

1391 Commits

Author SHA1 Message Date
Muhammad Soban Javed
4463ee751d Revert "refactor: move common/lib/capa/capa to xmodule/capa" (#30762) 2022-07-21 18:22:15 +05:00
Soban Javed
9eba9f983a refactor!: move common/lib/capa/capa to xmodule/capa
As part of dissolving our sub-projects in edx-platform, we are moving this package under the xmodule directory.
We have fixed all the occurences of import of this package and also fixed all documents related references.
This might break your platform if you have any reference of `import capa` or `from capa import` in your codebase or in any Xblock.

Ref: https://openedx.atlassian.net/browse/BOM-2582
2022-07-19 12:20:04 +05:00
Sagirov Evgeniy
dccb463103 FC-0001: Remove edx-jsme, Molecular Structure Problem type (#30321)
* feat: Remove edx-jsme, Molecular Structure Problem type

* feat: remove common/static/js/capa/jsme and common/static/js/capa/jsmolcalc
2022-07-06 15:51:58 -04:00
Arunmozhi
c54d8a81bf refactor: deprecate node_path attribute of ModuleSystem (#30447)
The node_path attribute & constructor argument of the ModuleSystem is
deprecated without any replacement service or fallback as there doesn't
seem to be any core blocks using it.

It also removes the references to node_path from the LMS settings, the
LoncapaModuleSystem and the XBlock runtime shim.

Co-authored-by: Agrendalath <piotr@surowiec.it>
2022-06-08 18:06:59 +02:00
Awais Qureshi
02e29168b2 feat!: Removing sandbox folder from platform and installing it from p… (#30402)
* feat!: common/lib/sandbox-packages folder moved to a new library.
2022-06-01 16:02:13 +05:00
Usama Sadiq
1df2c691db fix: bump bleach and django-wiki versions (#30263) 2022-04-20 10:39:50 +05:00
Demid
16fa97dde4 feat: deprecate filestore
This:

1. Removes the `filestore` property from the `ModuleSystem` in favor of
   the `runtime.resources_fs` property.
   In the original code, `filestore` is equal to
   `DescriptorSystem.runtime.resources_fs`. It's safe to replace it with
   `ModuleSystem.runtime.resources_fs` because both runtimes are combined
   using the `CachingDescriptorSystem`. It provides the `resources_fs` property
   that uses the same file storage.

2. Renames `filestore` argument to `resources_fs` in the `LoncapaSystem`
   constructor.

3. Adds the deprecated `filestore` property to the `ModuleSystemShim`
   and `RuntimeShim`.
2022-04-14 14:45:05 +02:00
Jillian Vogel
23a0d9ffb1 test: fixes safe_exec test TestSafeOrNot
so that both tests succeed on local devstack and in CI.
2022-01-25 14:49:31 +10:30
Jillian Vogel
ca1a44f15d Merge branch 'master' into chris/LX-2398 2022-01-17 11:11:59 +10:30
Dillon Dumesnil
bbfdb3376e Merge pull request #29713 from edx/ddumesnil/fix-max-width-text-input-aa-1114
fix: AA-1114: Set a max width on Text Input answers
2022-01-05 10:41:08 -08:00
Dillon Dumesnil
027a08ea3d fix: AA-1114: Set a max width on Text Input answers
We saw a bug where on mobile devices or smaller web browser windows
the input text field could stretch beyond the visible screen. By
setting the max width, we will always contain it to the size of its
parent element.
2022-01-05 09:52:18 -08:00
ChrisChV
0ad9959667 feat: Wrap the choice label with a <div> on choicegroup.html 2021-12-21 14:01:01 -05:00
Jillian Vogel
31827bc3b1 refactor: removes deprecated calls to runtime.xqueue from code and tests
* Uses the XQueueService object from the ModuleSystem in the LoncapaSystem
  instead of the dict of xqueue-related values.
* Adds a StubXQueueService for testing.
2021-12-20 15:41:42 +01:00
Jillian Vogel
1974bacadd refactor: deprecates runtime.xqueue in favor of the XQueueService
* Deprecates ModuleSystem.xqueue property
* Adds new XQueueService to provide the deprecated property values to the LMS runtime
  (Studio does not need the XQueueService.)
* Adds tests for new service and updates the ModuleSystemShim tests in LMS and Studio
* Fixes existing tests.
2021-12-20 15:41:42 +01:00
Jawayria
bd5e00b725 fix: fixed RemovedInDjango40 warnings in common 2021-12-14 19:55:01 +05:00
Eric Herrera
fe6882819a fix: Address more PR comments
Address @felipemonotoya recommendations related to add versioning to safe_exec_remote functions.
2021-10-15 08:19:48 -05:00
Eric Herrera
fc7104cde5 fix: Address PR comments
Address fixes recommended by @timmc-edx.
2021-10-14 08:11:40 -05:00
Eric Herrera
d672d309e8 fix: Improve and fix codejail service integration
Address recommendations and fixes discussed in PR.
Use similar structure to notes app.
Fix errors detected in tests.
2021-10-14 08:11:40 -05:00
Eric Herrera
3a736eefa2 feat: Codejail as external service (optional)
Add codejail service settings (endpoint and feature flag).
Add conditional to allow running codejail using a REST API service when flag is enabled.
2021-10-14 08:11:40 -05:00
Usama Sadiq
78799f25ee fix: Fixed new pylint warnings (#28726) 2021-09-23 17:54:27 +05:00
Awais Qureshi
d6202880ae chore: Removed python_2_unicode_compatible decorator. (#28342)
* chore: Removed python_2_unicode_compatible decorator.
2021-08-03 15:42:14 +05:00
David Ormsbee
1238e5d1b4 perf: add monitoring for get_course and safe_exec (#28241)
This is to help diagnose performance issues around the SequenceMetadata
API, as part of TNL-8330.
2021-07-21 11:19:10 -04:00
Hamza Farooq
0e4d2ff823 fix: adds default texts for missing answer texts in capa problems to fix response report generation
If an author has created a capa problem like an mcqs or something similar without providing answer text to an option and some learner selected that option then the response report generation will fail due to that missing answer text. The current commit will add default text to be substituted and prevents report generation crash.
2021-06-17 15:59:24 +05:00
Usama Sadiq
4f4be6538a BOM-2477: pylint warnings lint-amnesty (#27585) 2021-05-11 17:22:40 +05:00
Kyle McCormick
b0d41f6ebb refactor: simplify ProblemBlock inheritance hierarchy (#27363)
Previously, ProblemBlock's implementation was split between
CapaMixin/CapaFields (in capa_base.py) and ProblemBlock
(in capa_module.py), the former being the base classes of the
latter. The split existed for a historical reason:
as a former XModule, ProblemBlock was once split
between CapaDescriptor (author-facing) and CapaModule
(learner-facing). Since ProblemBlock has been converted
to being a pure XBlock, the division between the base
classes and the block class are no longer necessary
nor semantically helpful.

docs: Flesh out ProblemBlock's docstring a bit.
2021-04-22 12:44:15 -04:00
stvn
716b84d9df Merge PR #27202 fix/capa/empty-option-text
* Commits:
  fix: Allow capa_problem optioninput option with empty text
  refactor: Refactor capa_problem optioninput option text handling
2021-04-05 13:27:22 -07:00
stvn
21dce731f9 fix: Allow capa_problem optioninput option with empty text
This fixes TNL-7973 [1].

Background
----------

> An alert was sent out because a malformed capa problem caused block
> transformers to fail to run.

> This specific error/alert was triggered when an optionresponse problem
> lacked text. The authoring-based fix is to edit the offending
> option-response problem to remove the empty option.

> Expected behavior: We should be able to keep the error local to the
> ProblemBlock and not blow up the whole course publish block
> transformer collection process.

> This is a really easy error for authors to make, and the consequences
> to them (one problem doesn’t work) are disproportionate to the
> consequences [...] (alerting triggered).

- [1] https://openedx.atlassian.net/browse/TNL-7973
2021-04-02 14:36:20 -07:00
stvn
9afa58f963 refactor: Refactor capa_problem optioninput option text handling
to make it easier to add/remove parsing/processing logic
(in pending commits).
2021-03-31 09:58:29 -07:00
stvn
a0003016b2 Merge PR #26750 colin-fredericks/jsinput-allow-downloads
* Commits:
  feat(jsinput): Allow JSInput problems to create downloads
2021-03-23 10:20:57 -07:00
Kyle McCormick
5557194af1 revert: BOM-2378 (B) : pyupgrade in common/lib (#26943)
Reverts #26731

The code in common/lib/capa/capa/safe_exec needs
to remain Python 3.5-compatible, since edx-sandbox
(ie codejail) is still running Python 3.5.
2021-03-10 15:01:09 -05:00
M. Zulqarnain
8e8420dd46 BOM-2378 (B) : pyupgrade in common/lib (#26731)
* refactor: pyupgrade on common/lib

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
2021-03-10 17:56:24 +05:00
Kyle McCormick
9aefd6f986 style: django-not-configured is not a sensible lint-amnesty value (#26862)
django-not-configured is an error raised by pylint (with
the pylint-django plugin) when it's not correctly configured.

We should not be applying lint amnesty for such a violation.
2021-03-05 08:11:58 -05:00
Usman Khalid
7441702ade test: The exception on the pytest ExceptionInfo object can be accessed on the value attribute. 2021-03-03 01:03:36 +05:00
Jawayria
9e31096ec5 Merge pull request #26505 from edx/jawayria/bom-2351-5
BOM-2351: Removed unused imports from common/lib/{capa, safe_lxml, sy…
2021-03-02 13:29:10 +05:00
Colin-Fredericks
623cbf8924 feat(jsinput): Allow JSInput problems to create downloads 2021-02-25 16:45:04 -05:00
usamasadiq
96f0915b0f Fixed new pylint warnings.
use generator in any/all()
disable not-callable warnings
disable no-member warnings
Suppressed smaller pylint warnings
Pin edx-proctoring==3.5.0
2021-02-22 16:36:53 +05:00
Aarif
cce5c9ef1a replaced unittest assertions pytest assertions (#26530) 2021-02-19 12:25:51 +05:00
Jawayria
4fc7b2f640 BOM-2351: Removed unused imports from common/lib/{capa, safe_lxml, symmath, conftest.py} 2021-02-15 13:21:19 +05:00
usamasadiq
1175838fa5 fix pep8 warnings 2021-02-08 16:08:01 +05:00
usamasadiq
bbc386752f Applied pylint-amnesty 2021-02-04 18:52:10 +05:00
Ali-D-Akbar
3c41404190 PROD-2116 2021-02-01 15:32:27 +05:00
Ali-D-Akbar
752e0b918d PROD-2145 2021-01-20 00:42:34 +05:00
Kyle McCormick
758c2b02a1 Pass course-run-specific resource limits to codejail
The limits can be defined in settings.CODE_JAIL['limits_overrides'],
which is a dict mapping context ids (generally, course run keys)
to overrides to be applied to settings.CODE_JAIL['limits'].

This will allow us to temporarily alter the codejail limits
for certain contexts in order to enable, for example,
a certain course run's tasks to run longer while a large exam's
grades are recomputed.

TNL-7649
2020-11-05 11:53:16 -05:00
Awais Jibran
a113dd2f90 Adding debug logs for CR-2618 2020-08-31 16:50:22 +05:00
Martin Segado
b2a32bbb69 Fix double-wrapped exception in capa/inputtypes.py
(accidentally introduced in 07df64eb8c last year)
2020-08-13 16:01:11 -04:00
Awais Jibran
e2b60e1c97 bug: fix an edge case in capa problem tolerance
PROD-1586
2020-07-20 15:27:47 +05:00
Luis Moreno
1d557616b1 Fix test for python3.8 2020-06-23 10:16:37 -04:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
SaadYousaf
9160d4aa9b address deprecation warning for cgi.escape for logs cleanup. 2020-04-15 15:14:00 +05:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +05:00