Sharing data between multiple xblocks occurrences of same xblock within a course

Hi!
I want to share data between multiple occurrences of the same xblock, can’t find a scope that fulfills this feature, as per Docs CONTEXT scope seems relevant but can’t find it in juniper.
user_info shares data across the platform so can’t use that.
Is this possible?

Hi Zubair,

The Problem-Builder XBlock might have implemented what you’re looking for. I’m not sure of the details but you might be able to find some pointers there.

@Zubair I proposed the “CONTEXT scope” a long time ago (2016), but it never went beyond a proposal, so there isn’t any implementation of it.

I think the only option is what Problem Builder and ora2 do, which is to declare some Django models that store data in the way that you want. That’s probably better anyways for these sort of fields, because then you can get locking/transactions and atomic incrementing and so on, which XBlock fields do not support.

2 Likes

@braden Thanks for the suggestion, I followed the same approach to design the solution, create a Django app, and used models from that app.

1 Like

Yes, I checked out their implementation and it helped me. Thank you for your reply Sofiane.