If you have a specific technical inquiry, construct your post with the following:
Summary
I need to find a way to restrict some content to teachers only on our server. I have a significant amount of content on our server for general learners, but some of it is meant to be for teachers only (quizzes/answers, processes/procedures, etc.). I need to find a way to make sure that content of that is not accessible to students. I’m willing to have the teachers log in with a specific ID so that content directed to them won’t show up for students, or I can place a password on that content and make sure that all teachers have the password. I’m open to any ideas. I have not been able to find a way to do that by reading the Kolibri documentation.
If you have curated these resources yourself on Studio, then it is possible to flag them as ‘coach only’ in the Studio interface - however, there is no way to toggle that flag on the offline Kolibri platform itself at the moment.
We will be working in the coming year to try to bring more of the editing capabilities such as this to the offline platform, so we will keep the community posted as more of these things become possible!
Thanks. I definitely meant for the offline version (in remote areas of Kenya). My concern is that any student that clicks on the ‘Channels’ button will see the teacher content there and jump on it.
If you are comfortable using the command line and doing a little bit of scripting in Python, this is possible to do.
It sounds like you would like to hide entire channels from students? If so, for each channel with a specific channel id (visible in the Learn URL when first clicking on the channel), you could do something like this:
First go into the kolibri shell by typing kolibri shell in the command line.
Then enter the following Python code:
from kolibri.core.content.models import ContentNode
from kolibri.core.content.utils.annotation import recurse_annotation_up_tree
channel_id = "<channel_id>"
ContentNode.objects.filter(channel_id=channel_id).update(coach_content=True)
recurse_annotation_up_tree(channel_id)
For each channel you want to modify, you should replace <channel_id> with the 32 digit hexadecimal channel id (not the channel token that you might have used for import).
If you need to be more selective about which items you set as coach content, then further refinement to this would be needed.
Please, could you revise the code to support multiple channel_id’s?
Better still, is there now an easier way to make this happen?
Thanks
PS: Will this work?
from kolibri.core.content.models import ContentNode
from kolibri.core.content.utils.annotation import recurse_annotation_up_tree
channel_ids = ["<channel_id1>", "<channel_id2>", "<channel_id3>"] # List of channel IDs
for channel_id in channel_ids:
ContentNode.objects.filter(channel_id=channel_id).update(coach_content=True)
recurse_annotation_up_tree(channel_id)