Skip navigation
 

Query Child Learning Contexts
Added by George Kroner, last edited by George Kroner on 18 Dec 2007 11:24 AM
(None)

The rpt_learning_context table includes a handy little column called path. This column contains the hierarchical path to the learning context. This is really useful if you want to find information about descendants of a particular learning context.

For example, if you want to find all section-level tracking events within the institution named "Institution Name", you could probably come up with some complicated recursive query or you could simply search for tracking events in all section learning contexts that have "Institution Name" in their paths. The following SQL query does just that.

# Select all section-level and login (institution-level)
# events for the given user ID within an institution.
SELECT trk.action_name,
trk.tool_name,
trk.page_name,
lcx.learning_context_id,
lcx.name,
trk.event_time,
prs.user_id,
lcx.path
FROM rpt_tracking trk, rpt_learning_context lcx, rpt_person prs
WHERE
prs.person_id = trk.person_id AND
lcx.learning_context_id = trk.learning_context_id AND
lcx.title = "Section" AND
INSTR(lcx.path, "Institution Name", 1, 1) > 0
ORDER BY trk.event_time;
This article originally authored by Paul Monk on the WebCT DevNet

Adaptavist Theme Builder Powered by Atlassian Confluence

By accessing the Knowledge Base, you agree to the following: Blackboard makes no representations or warranties as to the accuracy of any information in the Knowledge Base. Blackboard is not responsible in any way for information provided to the Knowledge Base by third parties. Information in the Knowledge Base is not documentation for any Blackboard product. Nothing in the Knowledge Base shall be deemed to modify your license in any way to any Blackboard product. Blackboard reserves the right to use your name and the name of your institution in reference to any information submitted by you to the Knowledge Base. Blackboard may modify, distribute, republish in any format, delete, incorporate or use in any way the information that you contribute to the Knowledge Base.