Fix so real children work in studio and LMS (OC-513) - #5
Conversation
There was a problem hiding this comment.
Could we make these NotSupportedErrors?
There was a problem hiding this comment.
@Kelketek I don't think there is such a thing as NotSupportedError? I can't make them NotImplementedError because the whole reason I added these four methods is to override the versions that raise NotImplementedError - otherwise this class is considered abstract and I get TypeError: Can't instantiate abstract class TransientRuntime.
There was a problem hiding this comment.
@bradenmacdonald Ah, yes, NotImplementedError is what I was going for. You should still replace these exceptions with that. @abstractmethod requires the method to be overwritten with something but I believe that something can raise a NotImplementedError and still meet the requirement.
There was a problem hiding this comment.
Oh cool, you're right. I'll change them to NotImplementedError.
|
@bradenmacdonald This solution makes sense to me. I'm not certain there's a 'more right' method, given the circumstances. I've left a comment on a line in your code there for a semantic issue I found, but other than that, this looks good to me. Are you looking for a thumbs up right now, or is this PR intended to receive more work first, and exist primarily as a conceptual demo? |
|
Thanks @Kelketek ! Mostly just wanting feedback on this approach at the moment. Once I've finalized the approach and the code and tested against the existing course data I'll look for a thumbs up. |
867d73d to
23eb2f1
Compare
|
Closing in favor of #6. |
This branch fixes two things:
studio_xml_utils.py). Since Studio provides no mechanism for instantiating XBlocks from XML, the workaround is to create our own in-memory XBlock runtime and instantiate temporary XBlocks from XML using that temporary runtime. We can then see all the XBlocks as they are created from the XML and tell Studio to create similar ones and make them children of the mentoring block.studio_xml_utils.pyneeds to access the modulestore directly. This is not ideal but isn't horrible since we already know we're being used in edX Studio. (This only ever occurs from thestudio_submitview handler).htmlXBlock which conflicts with the html block we include in this repository. I fixed this by renaming all of the XBlocks to e.g.mentoring-htmlinstead ofhtml. I added some magic so that inside a<mentoring>element, the newmentoring-prefix can be left out.