Skip to content

Commit

Permalink
Instructor dir added in. (UofT-DSI#17)
Browse files Browse the repository at this point in the history
* Instructor dir added in.

* Made some modifications

* Updating slides to include no names

* organizing instructor folder

* generate_slides.sh update

changed generate_slides.sh so that it can also apply a uniform theme across the board instead of every md file having their own unique theme. Also made the shell script easier to use.

* Removed pdf and markdown mid folders.

* Adding instructor playbook

* Updated the instructor playbook

---------

Co-authored-by: rchung95 <[email protected]>
Co-authored-by: Raymond Chung <[email protected]>
  • Loading branch information
3 people authored Mar 4, 2024
1 parent c6bee49 commit cf48ee2
Show file tree
Hide file tree
Showing 96 changed files with 3,086 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
04-instructors/lessons/*
/04-instructors/lessons/pdf/*
/04-instructors/lessons/html/*
Binary file added 02-homework/unix-homework.pdf
Binary file not shown.
48 changes: 48 additions & 0 deletions 04-instructors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Instructor Playbook

## How do you interact with the repo?
The instructor will teach using the content provided in the `/01-slides` directory. You are allowed to live code with them during your lecture. Just make sure you upload the live-coding files to a new directory called `/live-coding` under `/01-slides` to this repository using a new branch and open up a pull request for it to be merge.

## How does the module flow?
The module is organized into 3 main directories:
1. Slides
2. Assignments
3. Homework

The `/01-slides` directory would be the first directory anyone would see, and contains the lecture slides, learning outcomes, and anything related to the learning outcomes such as live-coding files.

The `/02-assignments` directory is the second directory containing the assignments that would be marked as a `pass` or `fail`. Compared to `/03-homework`, the assignments are slightly more difficult, and helps encapsulates the learnings for the week. All assignments are mandatory to complete and deliver.

The `/03-homework` directory contains all the homework, a learner can do to demonstrate mastery of the learning contents. Unlike the `/02-assignments` directory, all homework is optional, but is highly encouraged to attempt.

### Week 1

#### Lecture
The focus of the sole lecture is to introduce them to basic bash commands such as `cd`, `pwd`, and creating files using `touch` and directories using `mkdir`. As well as intermediate commands like `rm` and how to recursively remove files from a nested directory, and how to make copies or move files using `mv`.

#### Assignment
The assignment for this week is to have learners find the secret password by navigating directories and files!

## How do you assign assignments?
Assignments are given and assigned at the start of each week at the end of the first lecture. The instructor will announce to the learners what the assignment is about, and how everything they will learn within the week will equip them to work on the assignment.

## How an assignment is expected to be completed and delivered?
Learners are expected to complete the assignment before the first lecture of the following week. They will deliver the assignment by opening up a pull request on their copied repo. The learner will also add a TA as a reviewer indicating they delivered a completed assignment, and it is ready to be graded as a `pass` or `fail`.

## What is the criteria for `pass` or `fail`?
The criteria for a `pass` or `fail` is if all parts of the program are working, and nothing in the code is broken. For some assignments, a rubric will be given outlining the criteria needed to pass.

## How to mark?
If the learner's solution works, then they `pass`! You or the TA would only need to focus on providing them constructive feedback on how they can improve their code. If the solution does not work, then they `fail`, and you would provide any constructive feedback on their existing code, and encourage them to get their solution working.

## How will feedback be given?
Feedback will be given through the pull request a learner had made, and allowing them to make revisions if needed. In order to maximize learning, feedback must be constructive, and specific.

<hr>

## Definitions
**Lecture**: A Lecture is a synchronous period of time, lasting up to 3 hours, where the instructor will facilitate and deliver the contents and learning outcomes online through Zoom. Learners are encouraged to participate and ask questions as they learn. Breaks are given if lecture goes pass an hour, with a 10 minutes break given for every hour still in a lecture.

**Work Period**: A Work Period is an asynchronous period of time, lasting up to 3 hours. The learners will work on their assignments and/or homework during this block of time. A TA will be present online through Zoom to assist the learners and answer any questions they may have. As work periods are asynchronous and flexible, learners can choose to work on their own time. However, it is encouraged to work during the block of time when a TA is present.

**Assignments**: An Assignment is work assigned as part of the program. They are slightly more difficult, providing an opportunity for learners to integrate and synthesize what they have learned throughout the week to meet the set learning outcomes.
51 changes: 51 additions & 0 deletions 04-instructors/dsi-certificates-theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* dsi-certificates-theme.css */
/* @theme dsi-certificates-theme */

@import 'uncover';

img[alt~="center"] {
display: block;
margin: 0 auto;
}


p {
text-align: left;
font-size: 35px
}
ul {
margin: 0;
font-size: 35px;
}
table {
font-size: 35px;
}
ol {
margin: 0;
font-size: 35px;
}

blockquote {
border-left: 10px solid #ccc;
margin: 1.5em 10px;
padding: 0.5em 30px;
quotes: "\201C""\201D""\2018""\2019";
}

blockquote:before {
color: #ccc;
content: none;
font-size: 4em;
line-height: 0.1em;
margin-right: 0.25em;
vertical-align: -0.4em;
}

blockquote:after{
content: none;
}

footer {
margin-bottom: 0px;
text-align: left;
}
177 changes: 177 additions & 0 deletions 04-instructors/generate_slides.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
#!/bin/bash

# CONFIGURATION
folder_md="homework/"
folder_output="homework/pdfs" # This will be used for both PDF and HTML

# Clear the screen for the splash screen
clear

# Display the splash screen
echo "============================================"
echo " Generating Slides"
echo "============================================"
echo ""
echo "Configuration:"
echo " - Markdown Folder: $folder_md"
echo " - Output Folder: $folder_output"
echo ""
echo "To change the configuration, please manually change them in the file."
echo "============================================"
echo " Processing..."
echo -e "============================================\n\n"

# ---------- #
# Generate HTML or PDF versions of slides, based on input flag.
# Usage:
# To generate HTML: ./generate_slides.sh --html [theme]
# To generate PDF: ./generate_slides.sh --pdf [theme]
# For help: ./generate_slides.sh --help
# ---------- #

function show_help() {
echo -e "\n\nUsage: $0 --html|--pdf [--theme theme_path] [--help]"
echo ""
echo "This script converts Markdown files to slide presentations using Marp CLI."
echo "It supports generating slides in HTML or PDF format and allows applying"
echo "a custom CSS theme."
echo ""
echo "Options:"
echo " --html Generate slides in HTML format. This option"
echo " processes all Markdown files in the 'lessons'"
echo " directory, outputting HTML files."
echo ""
echo " --pdf Generate slides in PDF format. Similar to --html,"
echo " but outputs PDF files instead."
echo ""
echo " --theme theme_path Apply a custom CSS theme to the slides. The"
echo " 'theme_path' should be the path to the CSS file."
echo " This is optional and can be used with either"
echo " --html or --pdf options."
echo ""
echo " --help Display this detailed help message and exit."
echo ""
echo "Examples:"
echo " Generate HTML slides with a custom theme:"
echo " $0 --html --theme /path/to/theme.css"
echo ""
echo " Generate PDF slides without a theme:"
echo " $0 --pdf"
echo ""
echo "Note:"
echo " Ensure Marp CLI is installed and accessible in your system's PATH."
echo " The script processes Markdown (.md) files located in the 'lessons'"
echo -e " directory, preserving filenames but changing extensions to .html or .pdf.\n\n"
}

if [ "$#" -lt 1 ]; then
echo "Error: the correct number of parameters isn't passed in."
show_help
exit 1
fi

# Check for Marp CLI installation
if ! command -v marp &> /dev/null; then
echo "- Error: Marp CLI is not installed. Please install Marp CLI to proceed."
exit 1
fi

# Defaults
output_type=""
theme_path=""

# Process command-line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
--html|--pdf)
output_type="$1"
shift # Remove argument name from processing
;;
--theme)
if [ -n "$2" ] && [ "${2:0:1}" != "-" ]; then
theme_path="$2"
shift 2 # Remove both argument name and value from processing
else
echo "Error: '--theme' requires a non-empty option argument."
exit 1
fi
;;
--help)
show_help
exit 0
;;
*)
# Unknown option
echo "Error: Unknown option: $1"
show_help
exit 1
;;
esac
done

# Validate output type
if [ -z "$output_type" ]; then
echo "Error: You must specify either --html or --pdf."
show_help
exit 1
fi

# Create the output folder if it does not exist
if [ ! -d "$folder_output" ]; then
echo "- Creating output folder: '$folder_output'"
mkdir -p "$folder_output"
else
echo "- Output folder '$folder_output' already exists."
fi

echo "- Starting slides generation..."

# Get list of Markdown files
markdown_files=$(find "$folder_md" -name "*.md")
if [ -z "$markdown_files" ]; then
echo "- No Markdown files found in '$folder_md'. Exiting."
exit 1
fi

# Process each Markdown file
for markdown_file in $markdown_files; do
file_name=$(basename -- "$markdown_file")
base_name="${file_name%.md}"
echo "- Processing '$file_name'..."
output_file="$folder_output/$base_name"

if [ "$output_type" = "--html" ]; then
# Generate HTML
output_file+=".html"
echo " - Generating HTML: $output_file"
marp "$markdown_file" --output "$output_file" --html --allow-local-files ${theme_path:+--theme-set $theme_path} # &> /dev/null
elif [ "$output_type" = "--pdf" ]; then
# Generate PDF
output_file+=".pdf"
echo " - Generating PDF: $output_file"
marp "$markdown_file" --output "$output_file" --pdf --allow-local-files --pdf-notes ${theme_path:+--theme-set $theme_path} # &> /dev/null
else
# nahhh
show_help
exit 1
fi


if [ $? -eq 0 ]; then
echo " - Success: Generated '$output_file'"
else
echo " - Error: Failed to generate '$output_file'"
fi
done

# Display the completion message with visual styling
echo -e "\n\n=================================================="
echo " Completion Status"
echo "=================================================="
echo ""
echo " - All files processed. Slides generation complete."
echo " - Generated files are located in: $folder_output"
echo ""
echo "=================================================="
echo " Done."
echo -e "==================================================\n\n"
60 changes: 60 additions & 0 deletions 04-instructors/homework/unix-homework.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
marp: true
theme: uncover
_class: invert
paginate: true
---

# Unix Shell Homework
```
$ echo "Data Sciences Institute"
```

---
##### Expectations
The goal of this homework is to give students an opportunity to practice what was learned during each class. This will help students remember the content and prepare for the next class.

Because each class builds upon the last, it's important to review the content and become comfortable with it, as time is too limited for a full in-class review.

---
##### Prompt:
Create one directory in any parent directory of your choice. This new directory should contain three additional directories. Within one of these additional subdirectories, please create two text files (.txt)

To submit:
1. A screenshot of your terminal commands.

---
##### Potential Commands

- current directory `pwd`
- set working directory `cd`
- list contents of working directory `ls`
- create directory `mkdir`
- create file `touch`

---
##### Prompt:
Download a csv of your choice. This could be from Toronto Open Data or another source but use a different csv than the one used in class. Place the new csv in a directory of your choice and rename it. Extract one column and the unique values from that column. Redirect the standard output to be a txt file.

To submit:
1. A screenshot of your terminal commands.
2. The txt file

---
##### Potential Commands

- commands from previous class
- `mv`
- `cp`
- `cat`
- `cut`
- `sort`
- `uniq`

---
##### Prompt:
Create a shell script that extracts some data using pipes (ie. a column, particular rows using `grep`, or anything else you want to play around with) from the same csv file from Day 2 homework. The filter should be contained within a function and include at least one variable.

To submit:
1. A screenshot of your terminal commands.
2. The shell script file
Loading

0 comments on commit cf48ee2

Please sign in to comment.