Hi everyone! I have a question regarding the design of my XBlock code and I was wondering if I could get your insights about it. I have multiple XBlocks and all of them use a fixed set of “utility” functions. I don’t want to repeat the same code in all of the XBlocks and I was wondering what the best way to implement this kind of a design would be.
When I was going through the documentation of XBlocks, I saw that one way to do this is by using inheritance but I still wanted to know if there is any way I can loosely couple of the XBlocks to these utility functions.
One thing I have been trying is to pip install
the package of utility functions and then import it into my XBlocks but I have been getting a ModuleNotFoundError
for it. Any advice on that end would be extremely helpful as well! Thanks a lot!