> For the complete documentation index, see [llms.txt](https://resources.unizin.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://resources.unizin.org/products/data-and-analytics/unizin-data-platform/data-stores/data-marts/student-activity-score/student-activity-score.md).

# Student Course Metrics

The *mart\_student\_activity\_score.student\_course\_metrics* mart aggregates data about a student’s performance and activities in a course on a weekly basis. The *mart\_student\_activity\_score\_rolling.student\_course\_metrics* mart aggregates this data for a rolling 7-day window.

* [BQ Prod Dataset Locations](#bq-prod-dataset-locations)
* [Student Activity Score vs. Student Activity Score Rolling](#student-activity-score-vs.-student-activity-score-rolling)
* [Interactive Mart Dependency Diagram](#user-content-schema)
* [Schema](#user-content-schema-1)
* [Assignments Due](#user-content-assignments-due)
* [Submissions](#user-content-submissions)
* [Navigation time and Number of Sessions](#user-content-navigation-time-and-number-of-sessions)

### **BQ Prod Dataset Locations**

* mart\_student\_activity\_score
* mart\_student\_activity\_score\_rolling

### **Student Activity Score vs. Student Activity Score Rolling**

Both the *student\_activity\_score* and *student\_activity\_score\_rolling* marts aggregate a student's performance and activities in a course in a 7-day time window. The primary difference is whether the 7-day time window is static or moving.

The *student\_activity\_score* mart defines static weeks in a term, every week starting on Sunday and ending on Saturday. The weeks are calculated based on the start date of the academic session, term, or course. We rely on BigQuery's `DATE_DIFF` function to determine a week number, and this BigQuery function has the start of the weeks on Sundays. We perform the date diff anchored against the start date of the academic session, the academic term, or the course in scope. Our logic prefers the academic session or academic term start dates when possible; this creates a more even baseline for week numbers across courses at scale. Each week in the term will have a fixed start and end date based on the session/term/course start date.

The *student\_activity\_score\_rolling* mart, on the other hand, defines rolling weeks by defining a 7-day time window for each day in a term. The day in a term is calculated using the same logic described above for calculating the week in a term. The time window includes the current day and the previous 6 days. There are some instances where the time window is shorter: if the day in the term is still within 6 days of the first day in the term, since the earliest possible start date is the first day in the term. The rolling 7-day window can be defined on and after the 7th day in the term, until the final day in the term.

In this documentation, any reference to week in the *student\_activity\_score* mart is a static week, while week in the *student\_activity\_score\_rolling* mart is a rolling 7-day window.

### Interactive Mart Dependency Diagram <a href="#user-content-schema" id="user-content-schema"></a>

The following visualization shows the construction of this data mart defined in the [UDP marts](https://gitlab.com/unizin-community/unizin-data-platform/marts) repository. More information on the repository and diagram can be found on [this marts page](/products/data-and-analytics/unizin-data-platform/data-stores/data-marts.md).

{% hint style="info" %}
[Click here to open the interactive chart.](https://assets.public.unizin.org/udp-marts/mart/mart__student_activity_score__student_course_metrics.svg)
{% endhint %}

<figure><img src="https://3709019308-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKYwtHNGgdPXS3PWAlZUr%2Fuploads%2Fgit-blob-b75317d3c0b3cfe2fceaced15f9871375f9ea4b5%2Fmart__student_activity_score__student_course_metrics.svg?alt=media&amp;token=8ed3f10c-a6d9-41a0-be4c-c35039e0408f" alt="The construction of the mart_student_activity_score.student_course_metrics data mart defined in the UDP marts repository"><figcaption><p>mart_student_activity_score.student_course_metrics</p></figcaption></figure>

### Schema <a href="#user-content-schema" id="user-content-schema"></a>

#### **mart/student\_activity\_score/student\_course\_metrics**

<table><thead><tr><th width="255">Field name</th><th width="211">Type</th><th>Description</th></tr></thead><tbody><tr><td>university_id</td><td>STRING</td><td>The SIS ID of the student.</td></tr><tr><td>global_user_id</td><td>INTEGER</td><td>The UDP ID of the student.</td></tr><tr><td>canvas_user_id</td><td>STRING</td><td>The Canvas ID of the student.</td></tr><tr><td>term_name</td><td>STRING</td><td>The academic term the student is enrolled in, i.e. <em>Fall 2020</em>.</td></tr><tr><td>session_name</td><td>STRING</td><td>The academic session the student is enrolled in.</td></tr><tr><td>week_number</td><td>INTEGER</td><td>The week of the academic session, term, or course.</td></tr><tr><td>week_start_date</td><td>DATE</td><td>The start date of the week of the academic session, term, or course.</td></tr><tr><td>week_end_date</td><td>DATE</td><td>The end date of the week of the academic session, term, or course.</td></tr><tr><td>campus_name</td><td>STRING</td><td>The campus of the student for the given academic term.</td></tr><tr><td>academic_program</td><td>STRING</td><td>The academic program the student is enrolled in for the given academic term.</td></tr><tr><td>course_code</td><td>STRING</td><td>The SIS ID of the course offering.</td></tr><tr><td>course_global_id</td><td>INTEGER</td><td>The UDP ID of the course offering.</td></tr><tr><td>course_canvas_id</td><td>STRING</td><td>The Canvas ID of the course offering.</td></tr><tr><td>navigation_time</td><td>FLOAT</td><td>The amount of time the student spent in Canvas for the given week in the course and the week prior.</td></tr><tr><td>num_sessions</td><td>INTEGER</td><td>The number of Canvas sessions of the student for the given week in the course and the week prior.</td></tr><tr><td>assignments_due</td><td>INTEGER</td><td>The number of assignments due in the course for the given week.</td></tr><tr><td>submissions</td><td>INTEGER</td><td>The number of assignments submitted by the student for the given week in the course.</td></tr><tr><td>assignments_due_cumulative</td><td>INTEGER</td><td>The number of assignments due in the course from the first day of the term to the current week, inclusive.</td></tr><tr><td>submissions_cumulative</td><td>INTEGER</td><td>The number of assignments submitted by the student from the first day of the term to the current week, inclusive.</td></tr></tbody></table>

### mart/student\_activity\_score\_rolling/student\_course\_metrics <a href="#user-content-assignments-due" id="user-content-assignments-due"></a>

The *student\_activity\_score\_rolling.student\_course\_metrics* schema is the same as the *student\_activity\_score.student\_course\_metrics*, except that the static week definitions are replaced with rolling week definitions. Additionally, time spent in the course is no longer defined for a two week period, but the 7-day window defined by the week start and end dates.

| Field             | Data Type | Description                                                                      |
| ----------------- | --------- | -------------------------------------------------------------------------------- |
| week\_number      | INTEGER   | The week of the academic term.                                                   |
| week\_start\_date | DATE      | The start date of the rolling 7-day window, inclusive.                           |
| week\_end\_date   | DATE      | The end date of the rolling 7-day window, inclusive.                             |
| navigation\_time  | FLOAT     | The amount of time the student spent in Canvas for the given week in the course. |
| num\_sessions     | INTEGER   | The number of Canvas sessions of the student for the given week in the course.   |

### Assignments Due <a href="#user-content-assignments-due" id="user-content-assignments-due"></a>

The number of assignments due in a course offering for a given week is defined in the *mart\_helper.context\_\_student\_activity\_score(\_rolling)\_\_assignments* table. The *week\_number* of an assignment is determined by the due date of the assignment and the start and end dates of the defined week (either static or rolling). The student activity score only includes published assignments with due dates and non-zero points possible.

### Submissions <a href="#user-content-submissions" id="user-content-submissions"></a>

The number of assignments submitted by a student in a course offering for a given week is defined in the *mart\_helper.context\_\_student\_activity\_score(\_rolling)\_\_submissions* table. The *week\_number* of an assignment and its corresponding submission is determined by the due date of the assignment and the start and end dates of the defined week (either static or rolling). We only count submissions for published assignments with due dates, non-zero points possible, and allowed submission types of 'on\_paper', 'Assignments', 'not\_graded', 'none', ' ', or 'external\_tool'.

### Navigation time and Number of Sessions <a href="#user-content-navigation-time-and-number-of-sessions" id="user-content-navigation-time-and-number-of-sessions"></a>

The amount of time spent and number of sessions in the learning environment for a student in a course is defined in the *mart\_helper.event\_\_student\_activity\_score\_\_navigation\_time* table. The *week\_number* of an event is defined as the difference in weeks between the event time and the start date of the academic session, academic term, or course. The *navigation\_time* for a given week in a course for a student is the amount of time spent in the learning environment for the prior two weeks. The *num\_sessions* is the number of sessions for the prior two weeks. We define the two week range for a week based on the latest event time for the given week in the course. Periods of inactivity, 25 minutes or more between two consecutive events, are removed from our aggregations.

In *student\_activity\_score\_rolling.student\_course\_metrics*, the amount of time spent and number of sessions in the learning environment for a student in a course is defined in the *mart\_helper.event\_\_student\_activity\_score\_rolling\_\_navigation\_time* table. The *week\_number* of an event is determined by the date of the event and the start and end dates of the defined week. The *navigation\_time* for a given week in a course for a student is the amount of time spent in the learning environment for the defined week only. The *num\_sessions* is the number of sessions for the defined week only. This differs from the non-rolling version of this mart, which uses a two-week range. Periods of inactivity, 25 minutes or more between two consecutive events, are removed from our aggregations.
