The most straightforward way to get the exam name is by using the modulestore interface in Python code. If you create a Django management command, you can do something like this:
from xmodule.modulestore.django import modulestore
from opaque_keys.edx.keys import UsageKey
key = UsageKey.from_string("block-v1:edX+DemoX+Demo_Course+type@problem+block@d2e35c1d294b4ba0b3b1048615605d2a")
ms = modulestore()
seq = ms.get_item(key)
seq.display_name
Please note that this has to run in the context of Django and the virtualenv you run edx-platform with, or it will fail because it's missing libraries and configuration.
If you need to get all the sequences in a course, you can do:
from xmodule.modulestore.django import modulestore
from opaque_keys.edx.keys import CourseKey, UsageKey
course_key = CourseKey.from_string("course-v1:edX+DemoX+Demo_Course")
ms = modulestore()
sequences = ms.get_items(course_key, qualifiers={'category': 'sequential'})
for seq in sequences:
print seq.location, seq.display_name
That will print both the location (the module_id used in the courseware_studentmodule table) and the display name for all sequences. There are a lot of attributes on SequenceDescriptor objects, so you can inspect them to see what else might be useful to you.
There were also recent additions that put this data in a more easily digestible form in MySQL (introduced in Ficus, but more stable in Ginkgo). Documenting the migration process is on the todo-list for Hawthorn, but the data model is documented here:
This is part of the larger re-working of how grades are calculated and stored:
Hope that helps a little. Take care.
Dave