3838)
3939from xblocks_contrib .problem .capa .tests .test_util import UseUnsafeCodejail
4040from xblocks_contrib .problem .capa .xqueue_interface import XQueueInterface
41- from xmodule .capa_block import ComplexEncoder , ProblemBlock
41+ from xmodule .capa_block import ComplexEncoder , _BuiltInProblemBlock as ProblemBlock
4242from xmodule .tests import DATA_DIR
4343
4444from ..capa_block import RANDOMIZATION , SHOWANSWER
@@ -813,7 +813,7 @@ def test_submit_problem_correct(self):
813813 # what the input is, by patching CorrectMap.is_correct()
814814 # Also simulate rendering the HTML
815815 with patch ("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct" ) as mock_is_correct :
816- with patch ("xmodule.capa_block.ProblemBlock .get_problem_html" ) as mock_html :
816+ with patch ("xmodule.capa_block._BuiltInProblemBlock .get_problem_html" ) as mock_html :
817817 mock_is_correct .return_value = True
818818 mock_html .return_value = "Test HTML"
819819
@@ -833,7 +833,7 @@ def test_submit_problem_correct(self):
833833 assert block .lcp .context ["attempt" ] == 2
834834
835835 @patch ("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct" )
836- @patch ("xmodule.capa_block.ProblemBlock .get_problem_html" )
836+ @patch ("xmodule.capa_block._BuiltInProblemBlock .get_problem_html" )
837837 def test_submit_problem_with_grading_method_disable (self , mock_html : Mock , mock_is_correct : Mock ):
838838 """
839839 Test that without a specific grading method, the score behaves as
@@ -873,7 +873,7 @@ def test_submit_problem_with_grading_method_disable(self, mock_html: Mock, mock_
873873 assert block .score == Score (raw_earned = 1 , raw_possible = 1 )
874874
875875 @patch ("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct" )
876- @patch ("xmodule.capa_block.ProblemBlock .get_problem_html" )
876+ @patch ("xmodule.capa_block._BuiltInProblemBlock .get_problem_html" )
877877 def test_submit_problem_with_grading_method_enable (self , mock_html : Mock , mock_is_correct : Mock ):
878878 """
879879 Test that the grading method is enabled when submit a problem.
@@ -895,7 +895,7 @@ def test_submit_problem_with_grading_method_enable(self, mock_html: Mock, mock_i
895895 mock_get_score .assert_called ()
896896
897897 @patch ("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct" )
898- @patch ("xmodule.capa_block.ProblemBlock .get_problem_html" )
898+ @patch ("xmodule.capa_block._BuiltInProblemBlock .get_problem_html" )
899899 def test_submit_problem_grading_method_always_enabled (self , mock_html : Mock , mock_is_correct : Mock ):
900900 """
901901 Test problem submission when grading method is always enabled by default.
@@ -948,7 +948,7 @@ def test_submit_problem_grading_method_always_enabled(self, mock_html: Mock, moc
948948 assert block .score == Score (raw_earned = 1 , raw_possible = 1 )
949949
950950 @patch ("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct" )
951- @patch ("xmodule.capa_block.ProblemBlock .get_problem_html" )
951+ @patch ("xmodule.capa_block._BuiltInProblemBlock .get_problem_html" )
952952 def test_submit_problem_grading_method_always_enabled_highest_score (self , mock_html : Mock , mock_is_correct : Mock ):
953953 """
954954 Test problem submission when grading method is always enabled by default
@@ -1001,7 +1001,7 @@ def test_submit_problem_grading_method_always_enabled_highest_score(self, mock_h
10011001 assert block .score == Score (raw_earned = 1 , raw_possible = 1 )
10021002
10031003 @patch ("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct" )
1004- @patch ("xmodule.capa_block.ProblemBlock .get_problem_html" )
1004+ @patch ("xmodule.capa_block._BuiltInProblemBlock .get_problem_html" )
10051005 def test_submit_problem_correct_last_score (self , mock_html : Mock , mock_is_correct : Mock ):
10061006 """
10071007 Test the `last_score` grading method.
@@ -1034,7 +1034,7 @@ def test_submit_problem_correct_last_score(self, mock_html: Mock, mock_is_correc
10341034 assert block .score == Score (raw_earned = 0 , raw_possible = 1 )
10351035
10361036 @patch ("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct" )
1037- @patch ("xmodule.capa_block.ProblemBlock .get_problem_html" )
1037+ @patch ("xmodule.capa_block._BuiltInProblemBlock .get_problem_html" )
10381038 def test_submit_problem_correct_highest_score (self , mock_html : Mock , mock_is_correct : Mock ):
10391039 """
10401040 Test the `highest_score` grading method.
@@ -1066,7 +1066,7 @@ def test_submit_problem_correct_highest_score(self, mock_html: Mock, mock_is_cor
10661066 assert block .score == Score (raw_earned = 1 , raw_possible = 1 )
10671067
10681068 @patch ("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct" )
1069- @patch ("xmodule.capa_block.ProblemBlock .get_problem_html" )
1069+ @patch ("xmodule.capa_block._BuiltInProblemBlock .get_problem_html" )
10701070 def test_submit_problem_correct_first_score (self , mock_html : Mock , mock_is_correct : Mock ):
10711071 """
10721072 Test the `first_score` grading method.
@@ -1098,7 +1098,7 @@ def test_submit_problem_correct_first_score(self, mock_html: Mock, mock_is_corre
10981098 assert block .score == Score (raw_earned = 0 , raw_possible = 1 )
10991099
11001100 @patch ("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct" )
1101- @patch ("xmodule.capa_block.ProblemBlock .get_problem_html" )
1101+ @patch ("xmodule.capa_block._BuiltInProblemBlock .get_problem_html" )
11021102 def test_submit_problem_correct_average_score (self , mock_html : Mock , mock_is_correct : Mock ):
11031103 """
11041104 Test the `average_score` grading method.
@@ -1176,7 +1176,7 @@ def test_submit_problem_closed(self):
11761176
11771177 # Problem closed -- cannot submit
11781178 # Simulate that ProblemBlock.closed() always returns True
1179- with patch ("xmodule.capa_block.ProblemBlock .closed" ) as mock_closed :
1179+ with patch ("xmodule.capa_block._BuiltInProblemBlock .closed" ) as mock_closed :
11801180 mock_closed .return_value = True
11811181 with pytest .raises (NotFoundError ):
11821182 get_request_dict = {CapaFactory .input_key (): "3.14" }
@@ -1530,7 +1530,7 @@ def test_reset_problem(self):
15301530 block .choose_new_seed = Mock (wraps = block .choose_new_seed )
15311531
15321532 # Stub out HTML rendering
1533- with patch ("xmodule.capa_block.ProblemBlock .get_problem_html" ) as mock_html :
1533+ with patch ("xmodule.capa_block._BuiltInProblemBlock .get_problem_html" ) as mock_html :
15341534 mock_html .return_value = "<div>Test HTML</div>"
15351535
15361536 # Reset the problem
@@ -1553,7 +1553,7 @@ def test_reset_problem_closed(self):
15531553 block = CapaFactory .create (rerandomize = RANDOMIZATION .ALWAYS )
15541554
15551555 # Simulate that the problem is closed
1556- with patch ("xmodule.capa_block.ProblemBlock .closed" ) as mock_closed :
1556+ with patch ("xmodule.capa_block._BuiltInProblemBlock .closed" ) as mock_closed :
15571557 mock_closed .return_value = True
15581558
15591559 # Try to reset the problem
@@ -1696,7 +1696,7 @@ def test_rescore_problem_with_grading_method_enable(self):
16961696 assert block .lcp .context ["attempt" ] == 1
16971697 mock_get_rescore .assert_called ()
16981698
1699- @patch ("xmodule.capa_block.ProblemBlock .publish_grade" )
1699+ @patch ("xmodule.capa_block._BuiltInProblemBlock .publish_grade" )
17001700 def test_rescore_problem_grading_method_always_enabled (self , mock_publish_grade : Mock ):
17011701 """
17021702 Test the rescore method when grading method is always enabled by default.
@@ -1738,7 +1738,7 @@ def test_rescore_problem_grading_method_always_enabled(self, mock_publish_grade:
17381738
17391739 mock_publish_grade .assert_called_with (score = Score (raw_earned = 0.33 , raw_possible = 1 ), only_if_higher = False )
17401740
1741- @patch ("xmodule.capa_block.ProblemBlock .publish_grade" )
1741+ @patch ("xmodule.capa_block._BuiltInProblemBlock .publish_grade" )
17421742 def test_rescore_problem_grading_method_always_enabled_with_various_methods (self , mock_publish_grade : Mock ):
17431743 """
17441744 Test the rescore method when grading method is always enabled by default
@@ -1780,7 +1780,7 @@ def test_rescore_problem_grading_method_always_enabled_with_various_methods(self
17801780 block .rescore (only_if_higher = False )
17811781 assert block .score == Score (raw_earned = 1 , raw_possible = 1 )
17821782
1783- @patch ("xmodule.capa_block.ProblemBlock .publish_grade" )
1783+ @patch ("xmodule.capa_block._BuiltInProblemBlock .publish_grade" )
17841784 def test_rescore_problem_update_grading_method (self , mock_publish_grade : Mock ):
17851785 """
17861786 Test the rescore method when the grading method is updated.
@@ -1944,7 +1944,7 @@ def test_get_score_with_grading_method(self):
19441944 self .assertEqual (score , expected_score )
19451945 self .assertEqual (block .score , expected_score )
19461946
1947- @patch ("xmodule.capa_block.ProblemBlock .score_from_lcp" )
1947+ @patch ("xmodule.capa_block._BuiltInProblemBlock .score_from_lcp" )
19481948 def test_get_score_with_grading_method_updates_score (self , mock_score_from_lcp : Mock ):
19491949 """
19501950 Test that the `get_score_with_grading_method` method returns the correct score.
@@ -2065,7 +2065,7 @@ def test_save_problem_closed(self):
20652065 block = CapaFactory .create (done = False )
20662066
20672067 # Simulate that the problem is closed
2068- with patch ("xmodule.capa_block.ProblemBlock .closed" ) as mock_closed :
2068+ with patch ("xmodule.capa_block._BuiltInProblemBlock .closed" ) as mock_closed :
20692069 mock_closed .return_value = True
20702070
20712071 # Try to save the problem
0 commit comments