Skip to content

Commit 50a11e9

Browse files
gabrielC1409UsamaSadiq
authored andcommitted
feat: Send xqueue submissions to edx-submission
fix: Restructuring to send course_id and score to edx submission fix: Refactoring of sending information to sent_to_submission fix: Elimination of unnecessary functions fix: Added usage comment to ProblemBlock in XqueueInterface constructor fix: update doc ADR fix: setting for Quality Others test (ubuntu-24.04, 3.11, 20) fix: Deprecation for django-trans-escape-filter-parse-error test: Add @pytest.mark.django_db decorator to test functions test: Fix for pylint being disabled fix: updated changes for pylint disable fix: update error from docs ADR-0005 update: xmodule/docs/decisions/0005-send-data-to-edx-submission.rst Co-authored-by: Sarina Canelake <sarina@axim.org> update: xmodule/docs/decisions/0005-send-data-to-edx-submission.rst Co-authored-by: Sarina Canelake <sarina@axim.org> fix: Adjusted correction fix: update date for docs ADR Revert "fix: update date for docs ADR" This reverts commit 0b4229c. fix: replace call created_submission to create_external_grader_detail fix: update test xqueue_submission fix: add docstring in test_xqueue_submission fix: update date doc ADR fix: update version edx-submission 3.8.6 fix: add @pytest.mark.xfail fix: add 20 chances in test_capa_block: fix: increase retry attempts for seed generation in ProblemBlockTest fix: change version to edx-submission lib fix: new version edx-submission in testings fix: replace parameter file to files fix: update variable grader_file_name and points_possible fix: Adjustment in the is_flag_active function to always take the last record edited in the waffle fix: wrap large line of code fix: update function is_flag_active fix: code style adjustment fix: changes for 60 retry feat: use CourseWaffleFlag to determine xqueue callback path fix: Code style adjustment fix: remove deprecated xqueue callback route and simplify callback type logic fix: Deleting a comment in the ADR document fix: add log in self.block is None fix: Code style adjustment in log
1 parent 9f12d69 commit 50a11e9

19 files changed

Lines changed: 742 additions & 47 deletions

requirements/edx/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ edx-search==4.1.3
512512
# openedx-forum
513513
edx-sga==0.25.3
514514
# via -r requirements/edx/bundled.in
515-
edx-submissions==3.8.6
515+
edx-submissions==3.9.0
516516
# via
517517
# -r requirements/edx/kernel.in
518518
# ora2

requirements/edx/development.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ edx-sga==0.25.3
812812
# via
813813
# -r requirements/edx/doc.txt
814814
# -r requirements/edx/testing.txt
815-
edx-submissions==3.8.6
815+
edx-submissions==3.9.0
816816
# via
817817
# -r requirements/edx/doc.txt
818818
# -r requirements/edx/testing.txt

requirements/edx/doc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ edx-search==4.1.3
598598
# openedx-forum
599599
edx-sga==0.25.3
600600
# via -r requirements/edx/base.txt
601-
edx-submissions==3.8.6
601+
edx-submissions==3.9.0
602602
# via
603603
# -r requirements/edx/base.txt
604604
# ora2

requirements/edx/testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ edx-search==4.1.3
625625
# openedx-forum
626626
edx-sga==0.25.3
627627
# via -r requirements/edx/base.txt
628-
edx-submissions==3.8.6
628+
edx-submissions==3.9.0
629629
# via
630630
# -r requirements/edx/base.txt
631631
# ora2

scripts/xsslint_thresholds.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@
3737
"underscore-not-escaped": 2
3838
},
3939
"total": 64
40-
}
40+
}

xmodule/capa/capa_problem.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class LoncapaSystem(object):
9696
See :class:`DescriptorSystem` for documentation of other attributes.
9797
9898
"""
99+
99100
def __init__(
100101
self,
101102
ajax_url,
@@ -130,6 +131,7 @@ class LoncapaProblem(object):
130131
"""
131132
Main class for capa Problems.
132133
"""
134+
133135
def __init__(self, problem_text, id, capa_system, capa_block, # pylint: disable=redefined-builtin
134136
state=None, seed=None, minimal_init=False, extract_tree=True):
135137
"""

xmodule/capa/errors.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# errors.py
2+
"""
3+
Custom error handling for the XQueue submission interface.
4+
"""
5+
6+
7+
class XQueueSubmissionError(Exception):
8+
"""Base class for all XQueue submission errors."""
9+
10+
11+
class JSONParsingError(XQueueSubmissionError):
12+
"""Raised when JSON parsing fails."""
13+
MESSAGE = "Error parsing {name}: {error}"
14+
15+
def __init__(self, name, error):
16+
super().__init__(self.MESSAGE.format(name=name, error=error))
17+
18+
19+
class MissingKeyError(XQueueSubmissionError):
20+
"""Raised when a required key is missing."""
21+
MESSAGE = "Missing key: {key}"
22+
23+
def __init__(self, key):
24+
super().__init__(self.MESSAGE.format(key=key))
25+
26+
27+
class ValidationError(XQueueSubmissionError):
28+
"""Raised when a validation check fails."""
29+
MESSAGE = "Validation error: {error}"
30+
31+
def __init__(self, error):
32+
super().__init__(self.MESSAGE.format(error=error))
33+
34+
35+
class TypeErrorSubmission(XQueueSubmissionError):
36+
"""Raised when an invalid type is encountered."""
37+
MESSAGE = "Type error: {error}"
38+
39+
def __init__(self, error):
40+
super().__init__(self.MESSAGE.format(error=error))
41+
42+
43+
class RuntimeErrorSubmission(XQueueSubmissionError):
44+
"""Raised for runtime errors."""
45+
MESSAGE = "Runtime error: {error}"
46+
47+
def __init__(self, error):
48+
super().__init__(self.MESSAGE.format(error=error))
49+
50+
51+
class GetSubmissionParamsError(XQueueSubmissionError):
52+
"""Raised when there is an issue getting submission parameters."""
53+
MESSAGE = "Submission parameters error: {error}"
54+
55+
def __init__(self, error="Block instance is not defined!"):
56+
super().__init__(self.MESSAGE.format(error=error))

xmodule/capa/inputtypes.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@
6666

6767
log = logging.getLogger(__name__)
6868

69-
#########################################################################
70-
7169
registry = TagRegistry() # pylint: disable=invalid-name
7270

7371

@@ -408,7 +406,7 @@ class OptionInput(InputTypeBase):
408406
409407
Example:
410408
411-
<optioninput options="('Up','Down')" correct="Up"/><text>The location of the sky</text>
409+
<optioninput options="('Up', 'Down')" correct="Up"/><text>The location of the sky</text>
412410
413411
# TODO: allow ordering to be randomized
414412
"""
@@ -505,7 +503,7 @@ def setup(self):
505503
raise Exception(msg)
506504

507505
self.choices = self.extract_choices(self.xml, i18n)
508-
self._choices_map = dict(self.choices,)
506+
self._choices_map = dict(self.choices, )
509507

510508
@classmethod
511509
def get_attributes(cls):
@@ -602,16 +600,16 @@ def get_attributes(cls):
602600
Register the attributes.
603601
"""
604602
return [
605-
Attribute('params', None), # extra iframe params
603+
Attribute('params', None), # extra iframe params
606604
Attribute('html_file', None),
607605
Attribute('gradefn', "gradefn"),
608606
Attribute('get_statefn', None), # Function to call in iframe
609-
# to get current state.
607+
# to get current state.
610608
Attribute('initial_state', None), # JSON string to be used as initial state
611609
Attribute('set_statefn', None), # Function to call iframe to
612-
# set state
613-
Attribute('width', "400"), # iframe width
614-
Attribute('height', "300"), # iframe height
610+
# set state
611+
Attribute('width', "400"), # iframe width
612+
Attribute('height', "300"), # iframe height
615613
# Title for the iframe, which should be supplied by the author of the problem. Not translated
616614
# because we are in a class method and therefore do not have access to capa_system.i18n.
617615
# Note that the default "display name" for the problem is also not translated.
@@ -1626,7 +1624,7 @@ class ChoiceTextGroup(InputTypeBase):
16261624
CheckboxProblem:
16271625
<problem>
16281626
<startouttext/>
1629-
A person randomly selects 100 times, with replacement, from the list of numbers \(\sqrt{2}\) , 2, 3, 4 ,5 ,6
1627+
A person randomly selects 100 times, with replacement, from the list of numbers \(\sqrt{2}\), 2, 3, 4, 5, 6
16301628
and records the results. The first number they pick is \(\sqrt{2}\) Given this information
16311629
select the correct choices and fill in numbers to make them accurate.
16321630
<endouttext/>

xmodule/capa/registry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class TagRegistry(object):
77
88
(A dictionary with some extra error checking.)
99
"""
10+
1011
def __init__(self):
1112
self._mapping = {}
1213

xmodule/capa/tests/test_answer_pool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
class CapaAnswerPoolTest(unittest.TestCase):
1515
"""Capa Answer Pool Test"""
16+
1617
def setUp(self):
1718
super(CapaAnswerPoolTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
1819
self.system = test_capa_system()

0 commit comments

Comments
 (0)