-
Notifications
You must be signed in to change notification settings - Fork 6
vocabulary doesn't display in learningresources pane #521
Comments
Which vocabulary do you expect to see there?
|
I expect to see the "Difficulty" vocabulary. The list is filtered to show only learningresources that have the "Hard" term from "Difficulty" vocabulary selected. I expect that the LR pane display that vocabulary with "Hard" selected. |
I believe this is not a bug, but "bad" data. Click on any of the terms under the Background: When you add a new vocabulary, you must select which learning resource types to which that vocabulary applies (see #438 which mentions this). These types are referred to in the logic which displays the screen you are seeing. The reason is that the Difficulty, Prerequisite, and Learning Objective facets were populated manually (by a script), and did not associate any learning resource types to the Difficulty, Prerequisite, and Learning Objective facets at that time. This is evidently not a required reference in the schema. |
If this is an artifact of the data loading script, is any action needed? Can this be closed with a "Not an issue" label? |
It can be fixed by populating the from learningresources.models import LearningResourceType
from taxonomy.models import Vocabulary
vocabs = Vocabulary.objects.filter(
name__in=('prerequisite', 'difficulty', 'objective'))
# Show original counts.
for vocab in vocabs:
print vocab.learning_resource_types.count()
for vocab in vocabs.iterator():
for resource_type in LearningResourceType.objects.all().iterator():
if resource_type in vocab.learning_resource_types.all():
print "already there"
continue
vocab.learning_resource_types.add(resource_type)
# Show there are higher counts.
for vocab in vocabs:
print vocab.learning_resource_types.count() |
When a learningresource has a term assigned in a vocabulary, I expect to see the vocabulary in the learningresource pane. Here is a screen shot where this doesn't happen. This is the DemoX course on lore-ci. http://lore-ci.herokuapp.com/repositories/animating-stuffed-animals/?sortby=nr_views&selected_facets=77_exact:210
The text was updated successfully, but these errors were encountered: