Open ormsbee opened 12 months ago
Hi @ormsbee
I'm currently working in this issue and wanted to double check with you if the idea is to create a service as the ones described in openedx/core/djangoapps/xblock/runtime/runtime.py
on line 231.
If not, can you please explain to me how should I create the new runtime service?
Thanks a lot!
@steff456: Yes, those are what I meant. Another place to find a list of example services is in the LMS rendering code:
Just a word of warning that this service would need to be instantiated in multiple places, like:
(It might be useful to look for instantiations of DjangoXBlockUserService
to see different places where the runtime can get initialized.)
The ProblemBlock has some sophisticated logic for determining whether the user should be allowed to see the answer (and also whether they were correct or not):
https://github.com/openedx/edx-platform/blob/f9148f032fc93bd339fb0ab50afb5cb3b1cdca21/xmodule/capa_block.py#L1400-L1457
This has been partially re-implemented in other XBlocks over time. We should refactor this into a runtime service that will return a simple True/False for this question, so that we can get consistent behavior without other XBlock authors having to think about it.