# File Interaction

The *mart\_course\_offering.file\_interaction* mart keeps track of file interactions within a course offering. The *mart\_course\_section.file\_interaction* mart serves the same purpose, except at the course section level.

## BQ Prod Dataset Locations <a href="#fileinteraction-bqproddatasetlocations" id="fileinteraction-bqproddatasetlocations"></a>

mart\_course\_offering

mart\_course\_section

## Interactive Mart Dependency Diagram <a href="#fileinteraction-interactivemartdependencydiagram" id="fileinteraction-interactivemartdependencydiagram"></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 interactive the chart.](https://assets.public.unizin.org/udp-marts/mart/mart__course_offering__file_interaction.svg)
{% endhint %}

<div data-full-width="true"><figure><img src="/files/TnktBXPocVSIhHNC7Meo" alt=""><figcaption><p>mart_course_offering.file_interaction</p></figcaption></figure></div>

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

### **Mart/Course\_offering/file\_interaction**

<table data-full-width="true"><thead><tr><th width="365.33333333333337">Field Name</th><th width="177">Type</th><th>Description</th></tr></thead><tbody><tr><td>udp_course_offering_id</td><td>INTEGER</td><td>The UDP ID of the Course offering associated with the file.</td></tr><tr><td>udp_file_id</td><td>INTEGER</td><td>The UDP ID of the file.</td></tr><tr><td>lms_int_file_id</td><td>STRING</td><td>The LMS internal ID of the file.</td></tr><tr><td>num_views</td><td>INTEGER</td><td>Number of times the file was viewed.</td></tr><tr><td>num_distinct_students</td><td>INTEGER</td><td>Number of unique students who viewed the file.</td></tr><tr><td>num_enrolled_students</td><td>INTEGER</td><td>Number of students enrolled in the Course offering associated with the file.</td></tr><tr><td>student_udp_id_array</td><td>ARRAY&#x3C;INTEGER></td><td>An array of the UDP IDs of the enrolled students in the Course offering associated with the file.</td></tr><tr><td>instructor_name_array</td><td>ARRAY&#x3C;STRING></td><td>An array of the instructor’s names for the Course offering associated with the file.</td></tr><tr><td>instructor_display</td><td>STRING</td><td>The array of the instructor’s names for the Course offering written as a string.</td></tr><tr><td>instructor_email_address_array</td><td>ARRAY&#x3C;STRING></td><td>An array of the instructor emails for the Course offering.</td></tr><tr><td>instructor_email_address_display</td><td>STRING</td><td>An array of the instructor emails for the Course offering written as a comma-separated string.</td></tr><tr><td>course_offering_subject</td><td>STRING</td><td>The subject of the Course offering associated with the file, i.e. <em>MATH.</em></td></tr><tr><td>course_offering_number</td><td>STRING</td><td>The number of the Course offering, i.e. <em>310</em></td></tr><tr><td>lms_course_offering_id</td><td>STRING</td><td>The LMS ID of the Course offering.</td></tr><tr><td>course_offering_code</td><td>STRING</td><td>The code of the Course offering associated with the file, i.e. <em>MATH 310.</em></td></tr><tr><td>academic_term_name</td><td>STRING</td><td>The name of the academic term, i.e. <em>Fall 2020.</em></td></tr><tr><td>term_start_date</td><td>DATE</td><td>The start date for the academic term.</td></tr><tr><td>term_end_date</td><td>DATE</td><td>The end date for the academic term.</td></tr><tr><td>learner_activity_id</td><td>INTEGER</td><td>The UDP ID for the learner activity if the file is associated with a learner activity.</td></tr><tr><td>learner_activity_title</td><td>STRING</td><td>The title of the learner activity if the file is associated with a learner activity.</td></tr><tr><td>learner_activity_due_date</td><td>DATETIME</td><td>The due date of the learner activity if the file is associated with a learner activity.</td></tr><tr><td>uploader_id</td><td>INTEGER</td><td>The UDP ID for the person who uploaded the file.</td></tr><tr><td>quiz_id</td><td>INTEGER</td><td>The UDP ID for the quiz if the file is associated with a quiz.</td></tr><tr><td>quiz_title</td><td>STRING</td><td>The title of the quiz if the file is associated with a quiz.</td></tr><tr><td>quiz_due_date</td><td>DATETIME</td><td>The due date of the quiz if the file is associated with a quiz.</td></tr><tr><td>content_type</td><td>STRING</td><td>The type of content that defines the file.</td></tr><tr><td>content_sub_type</td><td>STRING</td><td>The subtype of content that defines the file.</td></tr><tr><td>display_name</td><td>STRING</td><td>The name displayed for the file.</td></tr><tr><td>owner_entity_type</td><td>STRING</td><td>The type of entity that owns the file.</td></tr><tr><td>size</td><td>NUMERIC</td><td>The size of the file in bytes.</td></tr><tr><td>created_date</td><td>DATETIME</td><td>The date the file was created.</td></tr><tr><td>unlocked_date</td><td>DATETIME</td><td>The date the file was unlocked.</td></tr><tr><td>updated_date</td><td>DATETIME</td><td>The date the file was last updated.</td></tr><tr><td>accessible_date</td><td>DATETIME</td><td>The date the file became accessible.</td></tr><tr><td>most_recent_version_date</td><td>DATETIME</td><td>The date of the most recent version of the file.</td></tr><tr><td>students_who_viewed_udp_id_array</td><td>INTEGER</td><td>An array of the UDP IDs of the students who viewed the file.</td></tr><tr><td>students_who_did_not_view_udp_id_array</td><td>INTEGER</td><td>An array of the UDP IDs of the students who did not view the file.</td></tr><tr><td>pct_class_viewed</td><td>FLOAT</td><td>The percentage of students enrolled in the Course offering who viewed the file.</td></tr></tbody></table>

### **Mart/Course\_section/file\_interaction**

The course section mart includes all the fields found in the course offering mart, along with three extra fields.

<table data-full-width="true"><thead><tr><th width="283.33333333333337">Field Name</th><th width="193">Type</th><th>Description</th></tr></thead><tbody><tr><td>udp_course_section_id</td><td>INTEGER</td><td>The UDP ID of the Course section associated with the file.</td></tr><tr><td>lms_course_section_id</td><td>STRING</td><td>The LMS ID of the Course section associated with the file.</td></tr><tr><td>sis_course_section_id</td><td>STRING</td><td>The SIS ID of the Course section associated with the file.</td></tr></tbody></table>

### Fields <a href="#fileinteraction-fields" id="fileinteraction-fields"></a>

#### **num\_views**

The field *num\_views* is the number of times the file has been viewed. We identify that a file has been viewed using events from the learning environment and the *file* table in the context store. First, we identify the subset of events in which an interaction with an object occurred. A student is considered to have interacted with an object when the object ID for an event is not null. We extract the object ID from the [*object.id*](http://object.id) field in the expanded events table in UDP’s event store. The number of times an object has been viewed is the number of events corresponding to the object. For this mart, however, we only want to include student interactions with files, not everything that is considered an object. Therefore, we only include objects that have an ID corresponding to a file ID found in the *file* table in the context store.

#### **num\_distinct\_students**

The field *num\_distinct\_students* is the number of distinct students who viewed the file. The way this is computed is similar to how the *num\_views* field is computed. Again, we identify the subset of events in which an interaction with an object occurred, and only include objects that have an ID corresponding to a file ID found in the context store’s *file* table. However, for this field, we do not count all the events that correspond to the file, but instead count the number of distinct person IDs found in the events.

#### **num\_enrolled\_students**

The field *num\_enrolled\_students* is the number of enrolled students in the Course offering associated with the file. This number is computed using the *course\_section\_enrollment* table in UDP’s context store, which keeps track of enrollments in Course sections. We count the number of enrollments with a role of ‘Student’ or ‘Observer’ and a role status that is not ‘Dropped’**, ‘Withdrawn’,** or ‘Not-enrolled’.

#### **content\_type**

The field *content\_type* describes the type of content that defines the file. This field is extracted from the *content\_type* field in the *file* table in the context store. We extract the part of the string before the ‘/’ from the *file* table’s field to define this field. For instance, if the value in the *file* table is ‘application/pptx,’ then the value for this mart’s field will be ‘application’. Examples of common content type values are ‘Application’, ‘PDF’, ‘Text’, ‘Video’, ‘Audio’, ‘Image’, ‘MS Word’, and ‘MS Powerpoint’.

#### **content\_sub\_type**

The field *content\_sub\_type* describes the subtype of content that defines the file. This field is also extracted from the *content\_type* field in the *file* table in the context store. For this field, however, we extract the part of the string after the ‘/’ from the *file* table’s field to define it. So, if the value in the *file* table is ‘application/pptx’, the value for this mart will be ‘pptx’.

#### **owner\_entity\_type**

The field *owner\_entity\_type* defines the type of entity that owns the file. This field is found in the *file* table from the context store. Some possible values for this field are ‘learner activity’, ‘conversation message’, ‘course offering’, ‘learner group’, ‘quiz’, ‘quiz result’, ‘learner activity result’, and ‘person’.

#### **accessible\_date**

This field defines the date that the file is made accessible to students. We determine this date based on the *unlocked\_date* field, the date the file was unlocked. If the *unlocked\_date* field is null, we then define the date based on the *created\_date* field, the date the file was created.

#### **most\_recent\_version\_date**

This field defines the date the file was most recently updated. This date is determined based on the *updated\_date* field, the date the file was last updated. If the *updated\_date* field is null, then the date is defined by the *created\_date* field, the date the file was created.

#### **students\_who\_viewed\_udp\_id\_array**

The field *students\_who\_viewed\_udp\_id\_array* is an array of the UDP IDs of the students who viewed the file. This array is created using the same process as described for the *num\_views* and *num\_distinct\_students* fields. First, we identify the subset of events in which an interaction with an object occurred, and only include objects that have an ID corresponding to a file ID found in the context store’s *file* table. Then, we extract the distinct UDP person IDs from these events into an array that identifies all the students that viewed the file. Since we only want to include students that are enrolled in the course associated with the file, we only keep IDs that are also in the *student\_udp\_id\_array* field, the array of UDP IDs of students enrolled in the course.

#### **students\_who\_did\_not\_view\_udp\_id\_array**

The field *students\_who\_did\_not\_view\_udp\_id\_array* is an array of the UDP IDs of the students who are enrolled in the course and did not view the file. This array includes all the UDP IDs that are represented in the *student\_udp\_id\_array* field, the array of UDP IDs of students enrolled in the course, but not in the *students\_who\_viewed\_udp\_id\_array*, the array of UDP IDs of students who viewed the file.

#### **pct\_class\_viewed**

The field *pct\_class\_viewed* identifies the percentage of students in the course that viewed the file. This is the proportion of the number of students who viewed the file to the number of students enrolled in the course. This is calculated by dividing the array length of *students\_who\_viewed\_udp\_id\_array* by the array length of *student\_udp\_id\_array.*

## Tableau Template Workbook

As a starting point for visualization for this data mart, Unizin has created a Tableau template workbook available for download here:

{% file src="/files/OxCz3TJf66znnGczJiaz" %}
Content Usage Dashboard Tableau Template Workbook
{% endfile %}

### Connecting to Data

The default data connection in the workbook is to Unizin's synthetic data. After downloading the workbook, the first step will be to transfer the connection to your own production UDP data. Here is a [guide document](https://docs.google.com/document/d/1v_4JjgCz46nky5WZbZZGmO_6F6E2zoyBYifOSoZJNk4/edit?usp=sharing) to help with this process; Tableau also provides a [document](https://help.tableau.com/current/pro/desktop/en-us/connect_basic_replace.htm) that goes over how to replace data sources. For any issues connecting to source data, please contact <support@unizin.org>.&#x20;

### Tableau Dashboard Filters <a href="#lmstooluse-fields-1" id="lmstooluse-fields-1"></a>

The following fields are used as filters in the Tableau Workbook:

* Instructor Display - The list of names of the course's instructors.
* Course Offering Code - The course code of the course offering.
* UDP Course Offering ID - The UDP ID of the course offering.
* Content Type - The list of files/content type names
* Num Views - The number of views associated with each file
* Academic Term - The academic term of the course; the default selection is the current term.

These filters are in scope for all visuals in the dashboard.

### Tableau Visualizations

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfd5B-3OcOXfQN5Y9kzS1oKDr4Loqrso8hHSbRaXYsu_tvgXVldX1-KpUyl9LRRL1IFtO8lz3hHw8DTIQRO3EO0s5e_txkMZFJkpet0tpkX1JSueJWy1Eip8hKUUw2xbv1qJjB1Nw?key=F7J8rDaInncCzhhRhbLIH-jh" alt=""><figcaption><p>Metric Cards</p></figcaption></figure>

The content usage metric cards highlights key content engagement metrics, including the total number of content views, the number of unique content pieces, and the percentage of content that was clicked at least once.&#x20;

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcyziK5wwShn4fnPTurdwiHMyMWR726NFsSCP21rnQRPL4nUtQReF3nO25iJdSXD4HFUKNowY0hBkBvtENXjob7Z2zn60gHPTEWZpKX_HR7gR7vRsHJMKTWdMN_tRkERWMOZnQKWw?key=F7J8rDaInncCzhhRhbLIH-jh" alt="" width="563"><figcaption><p>Percentage of Views by Content Type</p></figcaption></figure>

The percentage of views chart displays the percentage of total views for each type of content, identifying which content types are most and least accessed by students. It offers insights into student preferences and engagement with different types of learning materials.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdwsDqVX-Qcz6WRxZiGqDXkUKf2bd64fwdnpObzDOjepHPpKnENOdPqXSvc-KLEoHsUKiWFOsZL6zFFr6ccwQSa0kfHXRASQ7gzfECcysYcpLE0B_mHpBca7uQ-dXxwTkn55ZePnA?key=F7J8rDaInncCzhhRhbLIH-jh" alt="" width="563"><figcaption><p>Distribution of Views Per Content</p></figcaption></figure>

This chart groups content based on how many times they have been viewed (0, 1, 2, 3, 4, 5, or > 5 views). It helps analyze the level of student engagement with content and identify materials that may need more visibility.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeqllVbJRSAz-wlglbNfujy53dFqX-n6KSvM-JPXipiv-ujJ1STcmv7EPE_vrF1Hc-9v54MP35Y7Jfkj1xkTFRNPLQuQ2RdlyzH7PdDIiZ_DGmmDBaEU7_C5TFwoTJvSw71WInk?key=F7J8rDaInncCzhhRhbLIH-jh" alt="" width="563"><figcaption><p>Weekly Engagement Trends</p></figcaption></figure>

The weekly engagement trends shows student engagement across each day of the week, helping to identify which days see the highest levels of content interaction.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc5CvW-VSFqJV8H2W-W4phvU6YIMl2AbsNFtO48odiiv9qlO8oVH3h6IQLm_TQCAr4D9EfiYnXxzdloc5NHS4lpIe3CQ4Xu_HARKM7zlpmrxzfIZAfnhDwM8YL4ig2GVYqXZRbWaA?key=F7J8rDaInncCzhhRhbLIH-jh" alt=""><figcaption><p>Content Reach by Class Engagement</p></figcaption></figure>

The Content Reach by Class Engagement chart shows the percentage of students who have viewed each content type, helping to assess how widely different materials are being accessed. It offers a clear picture of overall engagement with course content.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeHV-ai2IbVa9JvQrvWiixYbM8w1QugmyhtaHL-zUzCEQ8HYY8hhDvFaUtsKhn2hQKVqXkn_ZHiogJ7RtdjAN_inwaO_viRQKD97dA7CLBdqX9ehLvCTmrPxbTknQTTTsG8-wqe?key=F7J8rDaInncCzhhRhbLIH-jh" alt=""><figcaption><p>Student Engagement with Course Files: Clicked vs. Unclicked Rates</p></figcaption></figure>

The student engagement with course files clicked vs unclicked rates compares the percentage of students who accessed course files (clicked) versus those who didn’t (unclicked) for each course. The plot compares the files with the highest click rates and the files with the lowest click rates.  A higher click rate suggests stronger engagement with course materials, while a lower click rate may indicate content that needs better visibility or relevance to the students.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfW1hDw501TZNbRksmPJ_pUGb_WFuRZuNBKIEaCBYe5fbNpdFWhaZfLi8-WbPoQ2GRcVt02rLk-7JfljE4Qknh7yJlQ9EcfgQ38cCX6rCP6dqBmUHZsxncN0PpeiHVF4MAkcYmj?key=F7J8rDaInncCzhhRhbLIH-jh" alt=""><figcaption><p>Learner Activity Engagement by Course</p></figcaption></figure>

This chart displays the percentage of students who interacted with course items that have a learner activity due date, which indicates that the content is associated with an assignment. This chart compares the files with the highest click rates against the files with the lowest, which helps to assess student engagement with time-sensitive activities.&#x20;

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdGI7RZz7XI-H20e_qUQ7nJgmlBi1ceg2Z9XEmWp-MQf08boRMDAEBUbhI_S5_n6h2L318ETdQHKGXCj8c3aO5y0wgk8O9XLPemPa-wrW851cV3dmHWxg-7aBL_-GQ1cuvnSbJuyA?key=F7J8rDaInncCzhhRhbLIH-jh" alt=""><figcaption><p>Course Content Statistics Table</p></figcaption></figure>

This table lists content engagement metrics, as well as additional context about the content and course.  Included in the table are course code, instructor details, file name, content type, created date, number of views, and the average percentage of the class that viewed the content. It provides a clear view of how students are interacting with specific materials in each course.&#x20;

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://resources.unizin.org/products/data-and-analytics/unizin-data-platform/data-stores/data-marts/file-interaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
