my-learning-analytics

Back to README

Getting Started

These instructions will get a copy of MyLA up and running on your local machine with anonymized/fake student data.

Prerequisites

To follow the instructions below, you will at minimum need the following:

  1. Docker Desktop.
  2. Git.

Installation and Setup

  1. Clone this repo.
     git clone https://github.com/tl-its-umich-edu/my-learning-analytics.git
    
  2. Then navigate into the repo.
     cd my-learning-analytics
    
  3. Create a directory in your home directory called mylasecrets. This directory is mapped by docker-compose.yml into the container as /secrets/.
     mkdir ~/mylasecrets
    
  4. Copy the config/env_sample.hjson file into mylasecrets as env.hjson.
     cp config/env_sample.hjson ~/mylasecrets/env.hjson
    
  5. Copy the config/cron_udp.hjson file into mylasecrets. This step is Optional, since the MyLA cron query file path defaults to config/cron_udp.hjson.
     cp config/cron_udp.hjson ~/mylasecrets/cron_udp.hjson
    
  6. Examine the env.hjson file. You may need to change some of the configuration values for different environments, e.g. localhost vs. a production deployment. There are comments to help determine the proper settings. See Configuration for some additional info.

    Note: You may also optionally place the JSON settings directly into the ENV_JSON environment variable if your deployment environment doesn’t easily support mounting the env.hjson file into container. When using ENV_JSON, put the entire contents of env.hjson into it as a single-line string.

  7. Copy the .env.sample file as .env.
     cp .env.sample .env
    
  8. Examine the .env file. It will have the suggested default environment variable settings, mostly just MySQL information as well as locations of other configuration files.

  9. Start the Docker build process (this will take some time).
     docker compose build
    
  10. Start up the web server and database containers.
     docker compose up
    

    Note: Use docker compose down and ^C at any time to stop the running containers.

  11. Download the latest SQL file from this Google Drive link, and move it into the repository.

  12. Load the database with data.
     docker exec -i student_dashboard_mysql mysql \
         -u student_dashboard_user \
         --password=student_dashboard_pw student_dashboard \
         < {name of sql file}
    

Logging in as admininstrator

  1. Navigate to http://localhost:5001/ and log in as root with password root.

As you are now logged in as root, there are no courses listed. To view a course and the visualizations as an admin, do the following:

  1. Go to the Django admin panel by clicking the avatar in the top right, then clicking “Admin”, or navigate to http://localhost:5001/admin.

  2. Click on “Courses” under “Dashboard” in the right-hand panel.

  3. Click on one of the “Link” links in the “Course Link” column for one of the three courses.

Logging in as a student

  1. If you are logged in as root, click on the top-right circle, then click “Logout”.

  2. Connect to the MySQL database.
     Host: 127.0.0.1
     Username: student_dashboard_user
     Password: student_dashboard_pw
     Database: student_dashboard
     Port: 5306
    
  3. Pick a student sis_name from the user table to be used in the next step.
     SELECT sis_name FROM `user` WHERE enrollment_type = 'StudentEnrollment';
    
  4. Create an authorized user.
     docker exec -it student_dashboard python manage.py createuser \
         --username={insert sis_name} \
         --password={create password} \
         --email=test@test.com
    

    Note: To make a user a superuser, edit the record in auth_user to set is_staff=1 and is_superuser=1.

  5. Login using the username and password created.

  6. The course(s) the student with the selected sis_name are enrolled in will be displayed. Click on a course to view as the student selected in step 3.

Next: Configuration