-
Notifications
You must be signed in to change notification settings - Fork 863
Add Inheritance for Problems/Questions #2
Comments
… overwrite the existing problem, question, or solution - no way to currently pick-and-choose which items you wish to substitute. I've filed a bug under issue #2.
While looking at some exercises, I started fiddling with an idea for inheritance via templating and hacked together a quick proof of concept. It's two new attributes (whose names I'm not completely sold on):
And you wanted to pull it into another problem. You would then go:
This would yield:
The content element is optional. If not provided, it will just append to the end. It would be nice to be able to name/bind several different elements, but I didn't want to spend too much time on just a proof of concept.
And within a particular problem, you wanted to define a different X but didn't want to redefine Y. You could instead go:
Now, for the vars example to work - I had to modify the sequence of events a bit. Instead of:
I had it
The kind of hacky proof of concept is available at my splices branch with the absolute value equations exercise using data-replace. Please let me know what you think |
More sophisticated template inheritance, fixes issue #2.
Looks like this has been landed and it's working well! |
Power glove
Right now you can only bulk overwrite an entire problem description or question, it would be nice if it was possible to just override individual elements. Perhaps a class to mark those elements as being able to be substituted? Maybe something like class="sub".
The text was updated successfully, but these errors were encountered: