These VQL examples include charts and metrics about the attempts, completions, success, and scores that students achieved, usually in test questions. Each of the widgets represents either out-of-the-box (OOTB) metrics built-in to the LRS, or practical metrics that our customers asked for. You can find the OOTB metrics in the LRS Overview and Activity Overview dashboards of your LRS. For some of these examples, you can often use the regular Chart Builder to assemble an approximately similar widget.
We've collapsed some of the whitespace in the JSON in this article, to make it easier to read.
Top Ten Highest Scoring Objects
What are the top ten child objects of this activity by score? In the LRS Overview dashboard, this widget shows the top ten scoring lessons in the course. If you drill-down one level, then this widget shows the top ten child objects in a parent lesson using the Activity Overview dashboard. The LRS hides this OOTB widget if it cannot find any child objects with scaled scores.
This widget compares objects at the same level within a parent. However, not all child objects are comparable. Some objects may be test questions, others may be a different type.
{ "title": "High Scoring Objects",
"subtitle": "What are the top 10 child objects of this activity <b>by score</b>?",
"filter": {},
"process": [{
"$frequentValues": {
"path": "object.id",
"limit": 10,
"metrics": {"score": {"$avg": "result.score.scaled"}},
"sort": {"score": "desc"}}}, {
"$toCanonicalDisplay": {}}, {
"$barChart": {
"valuePath": "score",
"categoryPath": "canonical.display"}}]}
Bottom Ten Lowest Scoring Objects
What are the bottom 10 child objects of this activity by score? In the LRS Overview dashboard, this widget shows the ten lowest-scoring lessons in the course. If you drill-down one level, then this widget shows the ten lowest-scoring child objects in a parent lesson using the Activity Overview dashboard. The LRS hides this OOTB widget if it cannot find any child objects with scaled scores.
This widget compares objects at the same level within a parent. However, not all child objects are comparable. Some objects may be test questions, others may be a different type.
{ "title": "Low Scoring Objects",
"subtitle": "What are the bottom 10 child objects of this activity <b>by score</b>?",
"filter": {},
"process": [{
"$frequentValues": {
"path": "object.id",
"limit": 10,
"metrics": {"score": {"$avg": "result.score.scaled"}},
"sort": {"score": "asc"}}}, {
"$toCanonicalDisplay": {}}, {
"$barChart": {
"valuePath": "score",
"categoryPath": "canonical.display"}}]}
Score Deviation, for Top Ten Objects in a Single Lesson
For the top ten child activities, what is the average and standard deviation of their score? This widget only appears in the Activity Overview dashboard after you select a lesson. The LRS hides this widget if it has no data for the selected period. This OOTB widget has good instructional value, but it’s hard to interpret. The upper bound of each bar is the average scaled score for that activity (higher is better), while the lower bound is the standard deviation (variation from the mean, lower is better) for the same object.

{ "title": "Score Deviation",
"subtitle": "For the top 10 child activities, what is the <b>average and standard deviation</b>
of their score?",
"filter": {"meta.relatedActivities": "https://www.coursera.org/specializations/jhu-data-science"},
"process": [{
"$frequentValues": {
"path": "object.id",
"metrics": {
"avg": {"$avg": "result.score.scaled"},
"avgDev": {"$stdDev": "result.score.scaled"}}}}, {
"$toCanonicalDisplay": {}}, {
"$errorBarChart": {
"categoryPath": "canonical.display",
"itemType": "activity"}}]}
Complete versus Incomplete, for a Single Lesson
What is the ratio of complete to incomplete events on this activity? This OOTB widget is unique to the Activity Overview dashboard and is the most instructionally important built-in widget. You can use the Activity Explorer widget in the dashboard to drill-down to an individual interaction to see this widget change. It shows percentage counts for the statements that have result.completion values set for that chosen activity. Although the LRS has no record of the total number of students enrolled nor the length of a lesson, this widget can still show “the relative achievement of all actors in all activities in the selected object”.

{ "title": "Complete vs. Incomplete",
"subtitle": "What is the <b>ratio</b> of complete to incomplete events on this activity?",
"filter": {"meta.relatedActivities": "https://www.coursera.org/specializations/deep-learning"},
"process": [{
"$frequentValues": {
"path": "result.completion"}}, {
"$addFields": {
"_id": {
"$switch": {"branches": [{
"case": {"$or": [{
"$eq": ["$_id", 0]}, {
"$eq": ["$_id", false]}, {
"$eq": ["$_id", "false"]}]},
"then": "Incomplete"}, {
"case": {"$or": [{
"$eq": ["$_id", 1]}, {
"$eq": ["$_id", true]},
"$eq": ["$_id", "true"]}]},
"then": "Complete"}],
"default": "Unknown"}}}}, {
"$pieChart": {}}]}
Success Rate, for a Single Lesson
What is the ratio of successful to unsuccessful events on this activity? This OOTB widget only appears in the Activity Overview dashboard and the LRS hides the widget if it can’t find any result.success data. Correctly-configured courseware should send statements describing success (true or false) only if completion is true. Success is most useful as a measure of instructional effectiveness in the context of the number of attempts — imagine side-by-side widgets in a custom dashboard. Also, consider comparing the success rate of each lesson within a course — imagine a row of widgets, or a stacked bar chart, in a custom dashboard.

{ "title": "Success Rate",
"subtitle": "What is the <b>ratio</b> of successful to unsuccessful events on this activity?",
"filter": {"meta.relatedActivities": "https://www.coursera.org/specializations/deep-learning"},
"process": [{
"$frequentValues": {
"path": "result.success"}}, {
"$addFields": {
"_id": {
"$switch": {"branches": [{
"case": {"$or": [{
"$eq": ["$_id", 0]}, {
"$eq": ["$_id", false]}, {
"$eq": ["$_id", "false"]}]},
"then": "Unsuccessful"}, {
"case": {"$or": [{
"$eq": ["$_id", 1]}, {
"$eq": ["$_id", true]}, {
"$eq": ["$_id","true"]}]},
"then": "Successful"}],
"default": "$_id"}}}}, {
"$pieChart": {}}]}
Responses, for a Single Test Question
What different responses did learners make on this activity? This OOTB widget appears in the
Activity Overview dashboard, and the LRS hides this widget if no
result.response data supports it. If the activity follows
the CMI interaction type, then you should also find an
Interaction widget with the same data, plus much more! In this widget, the height of the bar shows the number of statements in which the LRS found responses. As a default, this widget sorts the responses by count, descending.
Good practice is to add to the subtitle the stem question — the question to which the students responded — used in this activity.
{ "title": "Responses",
"subtitle": "What different responses did learners make on this activity?
<b>“Neural networks have been used in…”</b>",
"filter": {"meta.relatedActivities": "https://www.coursera.org/specializations/deep-learning/1/
interactions/2"},
"process": [{
"$frequentValues": {
"path": "result.response"}}, {
"$toCanonicalDisplay": {}}, {
"$barChart": {
"categoryPath": "canonical.display",
"valuePath": "count"}}]}
We're constantly receiving requests for new charts and metrics: check back often. Or, click the Follow button in the right menu to get email alerts when we update this article.