def heatmap_dashboard(mongodb): collection = mongodb[SEGMENTS_COL] num_entries = collection.find().count() from edinsights.core.render import render return render("heatmap-dashboard.html", { 'num_entries': num_entries })
def data_dashboard(mongodb): collection = mongodb[EVENTS_COL] num_entries = collection.find().count() from edinsights.core.render import render return render("data-dashboard.html", { 'num_entries': num_entries })
def selector_dash(view, analytic): ''' Wrapper around a single analytic to make it global, and ask the user for the relevant parameters. ''' from edinsights.core.render import render f = view.__getattr__(analytic) params = inspect.getargspec(f).args return render("single_dash.html", {'parameters' : params, 'analytic' : analytic})
def video_list_view(mongodb): """ Visualize students' interaction with video content for all videos in the events database """ data = video_list_query(mongodb) videos = video_info_query(mongodb) from edinsights.core.render import render return render("list-view.html", { 'data': data, 'videos': videos })
def video_single_view(mongodb, vid): """ Visualize students' interaction with video content for a single video segment. Example: http://localhost:9999/view/video_single?vid=2deIoNhqDsg """ data = video_single_query(mongodb, vid) videos = video_info_query(mongodb) from edinsights.core.render import render return render("single-view.html", { 'video_id': vid, 'data': data, 'videos': videos })
def plot_event_type_histogram(query): from edinsights.core.render import render return render("event_types.html", {'data': json.dumps(query.event_type_query())})
def plot_histogram(query): from edinsights.core.render import render return render("courseviews.html", {'data': json.dumps(query.plot_histogram())})
def djt_hello_template(): ''' Example of how to use mako templates in a view ''' from edinsights.core.render import render return render("hello.html", {})
def dash(view): ''' Show a list of analytics, wrapped in selector_dash ''' from edinsights.core.render import render analytics = view.__dir__() return render("full_dash.html", {'analytics' : analytics})
def plot_event_type_histogram(query): from edinsights.core.render import render return render("event_types.html", {'data':json.dumps(query.event_type_query())})
def plot_histogram(query): from edinsights.core.render import render return render("courseviews.html", {'data':json.dumps(query.plot_histogram())})