Use runtime-provided XQueueService instead of constructing it in ProblemBlock#37998
Use runtime-provided XQueueService instead of constructing it in ProblemBlock#37998irtazaakram wants to merge 3 commits intomasterfrom
Conversation
kdmccormick
left a comment
There was a problem hiding this comment.
the code looks good to me 👍🏻 please have another team member look at it too.
could you manually test this? To be honest, I'm not sure exactly how to set up testing for external grading, but I'll ask around.
|
Dave O tells me that @UsamaSadiq would probably be the most knowledgable person for how to manually test this. Usama, do you mind giving Irtaza pointers on how he could manually changes to the XQueueService class? I know that we're in the middle of migrating from the XQueue microservice to the in-process edx-submissions backend, and that both are currently supported. My understanding is that the XQueueService class delegates to either one, based on the waffle flag. So we should only need to test one of the backends (xqueue or edx-submissions) in order to validate this PR--whichever backend is easier to set up. |
|
I added some instructions to the PR description on how to test the XQueue Service locally using tutor dev and tutor local. I’ll follow up with @UsamaSadiq to discuss the testing details further. |
farhan
left a comment
There was a problem hiding this comment.
All seems good,
As per discussion please create a .rst document, how to test it and add its link in the class docs of XQueueService
fc639b2 to
d20b87b
Compare
740ade8 to
38a12b9
Compare
|
@kdmccormick Tested locally with help from @UsamaSadiq and @rehmansheikh222. |
This PR updates
ProblemBlockto requestXQueueServicevia the XBlock runtime (self.runtime.service(self, "xqueue")) instead of directly constructing it inside the block and movesXQueueServicefromxmodule/capa/xqueue_interface.pytoxmodule/services.pyThis aligns with the standard service pattern and allows the Problem XBlock to live in xblocks-contrib/problem without copying the XQueueService implementation into that repo.
TESTING
OLX for sample question:
Mock Grader Script:
mock_grader.py
How to run this:
STEP 1: GET CREDENTIALS
Run this in your terminal:
tutor config printvalue XQUEUE_AUTH_PASSWORDSTEP 2: PREPARE SCRIPT
IN
mock_grader.py. Update theXQUEUE_PASSvariable with the password from Step 1.FOR TUTOR DEV SETUP:
STEP 3: COPY SCRIPT TO CONTAINER & EXECUTE SCRIPT
Run this command (replace
tutor_main_dev-lms-1with your actual LMS container name if different):docker cp mock_grader.py tutor_main_dev-lms-1:/tmp/mock_grader.pyRun this command to start the interactive grader:
tutor dev exec lms python /tmp/mock_grader.pyFOR TUTOR LOCAL SETUP:
STEP 3: EXECUTE SCRIPT
Run this command:
python mock_grader.pySTEP 5: TEST
Screen.Recording.2026-02-11.at.3.41.12.PM.mov
Related to #36538
Reference openedx/xblocks-contrib#151 (comment)
Testing Instructions for both xqueue and edx-submission: https://gist.github.com/irtazaakram/37299e341876d4798c93f8e5ab8ab1f2