Skip to content

Commit

Permalink
Added IMLS-Tools
Browse files Browse the repository at this point in the history
  • Loading branch information
lawtlee committed Sep 8, 2023
1 parent c002323 commit 76c2929
Show file tree
Hide file tree
Showing 20 changed files with 383 additions and 0 deletions.
Binary file added assets/img/imls-tools/config-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/config-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/ep-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/ep-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/mult-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/mult-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/mult-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/python-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/python-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/python-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/python-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/python-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/python-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/python-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/remote-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/remote-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/imls-tools/remote-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 159 additions & 0 deletions docs/imls-tools/content_python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
---
title: Content Check Python
layout: default
parent: IMLS Tools
nav_order: 2
---

This tool is built ontop of the [content_check.sh]({{ site.baseurl }}/docs/imls-tools/content_shell). It has in interactive UI
and more options available.

You can find the python script at this [link](https://github.com/ucla-imls-open-sci/imls-tools/blob/main/content_check.py).

# Setting up the environment for the script

1. **Download the script or clone the repository**

2. **Check your python version to make sure its python 3.11**

Run this command to check your python3 version `python3 --version`

If it is not **Python 3.11** and you have a **Mac** run the following commands:
```
# INSTALL HOMEBREW IF YOU DON'T HAVE IT
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# INSTALL PYTHON 3
$ brew install python3
```

3. **Download package dependencies**

You need to download PySimpleGUI. Run the following commands:

```
brew install python-tk
pip3 install pysimplegui
```

# Running the script

Go to the following section depending on your needs:
1. [Lesson Downloaded]()
2. [No Lessons Downloaded]()
3. [Multiple Lessons Downloaded]()
4. [Check Episodes Folder]()
5. [Check config.yaml]()
6. [Check a single episode]()


1. **Run the Python Script**

Run the script with the command `python3 content_check.py`.\
It should display the following:

![Home]({{ site.baseurl }}/assets/img/imls-tools/python-1.png)



## **If you have a LESSON downloaded**

1. **Click on the browse button**

It should display a file system for you to navigate.

![Browse]({{ site.baseurl }}/assets/img/imls-tools/python-2.png)

2. **Navigate to your LESSON folder**

Navigate to the folder that you have your lesson in and click choose.

![Choose]({{ site.baseurl }}/assets/img/imls-tools/python-3.png)

3. **Click Run and read the output**

![Run]({{ site.baseurl }}/assets/img/imls-tools/python-4.png)

4. **Clear output and pick another folder and repeat**

Pressing clear will clear the Results Window

![Clear]({{ site.baseurl }}/assets/img/imls-tools/python-5.png)



## **If you don't have a LESSON downloaded**

1. **Click the Remote Repo Button**

It will open a pop-up where you can put the link to the remote repository.

![Remote Repo]({{ site.baseurl }}/assets/img/imls-tools/remote-1.png)

2. **Enter the URL to the remote Repository**

Find the url to the remote repository on github. Then enter it into the text field and
click search.

![Search]({{ site.baseurl }}/assets/img/imls-tools/remote-2.png)

3. **Click Run and read the output**

![Run Remote]({{ site.baseurl }}/assets/img/imls-tools/remote-3.png)



### *VERY IMPORTANT YOU HAVE TO CLOSE THE APPLICATION USING THE CLOSE BUTTON OTHERWISE THE TEMPORARY DIRECTORY IS NO LONGER TEMPORARY*


## **If you have multiple LESSON's downloaded**

1. **Open the directory that has the multiple lessons.**

Click browse and find the directory that has all of the lessons.

![Directory]({{ site.baseurl }}/assets/img/imls-tools/mult-1.png)

2. **Click on the Lesson you want to run**

Click on the lesson you want to run

![Click on Lesson]({{ site.baseurl }}/assets/img/imls-tools/mult-2.png)

3. **Click run**

Click run

![Click run]({{ site.baseurl }}/assets/img/imls-tools/mult-3.png)


## **If you only want to check over the Episodes Folder**

1. **Click on the episodes folder**

![Click on Episodes]({{ site.baseurl }}/assets/img/imls-tools/python-6.png)

2. **Click Run**

![Episodes Only Run]({{ site.baseurl }}/assets/img/imls-tools/python-7.png)

## **If you only want to check over config.yaml**

1. **Click on the config.yaml file**

![config]({{ site.baseurl }}/assets/img/imls-tools/config-1.png)

2. **Click Run**

![config run]({{ site.baseurl }}/assets/img/imls-tools/config-2.png)


## **If you only want to check over a single episode**

1. **Click on the episode you want to run**

![episode]({{ site.baseurl }}/assets/img/imls-tools/ep-1.png)

2. **Click Run**

![episode run]({{ site.baseurl }}/assets/img/imls-tools/ep-2.png)
214 changes: 214 additions & 0 deletions docs/imls-tools/content_shell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
---
title: Content Check Shell
layout: default
parent: IMLS Tools
nav_order: 1
---

This is a shell script that was developed to check and validate Lesson contents. There is a python script that is more intuitive but
if you are on a virtual environment you can run this script easier.

You can find the shell script at this [link](https://github.com/ucla-imls-open-sci/imls-tools/blob/main/content_check.sh)

*NOTE this script may also be incomplete*

*NOTE if you don't want to go through this documentation, you can run `./content_check.sh --help` it will print out a manual for you*

1. **Download the script or clone the repository**

2. **If you haven't already, give the script execute access**

You can do so by running the code: `chmod +x content_check.sh` in the directory that
has the script.

3. **Run the script**

1. **Base Script**
The script has many options that help it run. To run the base script you will need to use the option `-P`.
Run the following code in order to get its base functionality to work.

```
./content_check.sh -P <path_to_lesson_directory>
# Example
$ ./content_check.sh -P ./c-_guide
Lesson Title: Programming in C++
Config.yaml Validation:
Title: Programming in C++
Contact: Invalid
Created: 2023-07-19
Source: https://github.com/lawtlee/c-_guide
Episode Validation:
Episode: hello-world.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Valid
Episode: introduction.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Valid
Episode: test.md
Questions: Valid
Objectives: Valid
Keypoints: Valid
Episode: variables.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Invalid
```
*NOTE be aware of spaces in your file paths, it may lead to problems*

The script will run a check over the **config.yaml** file and the **episodes** folder and check if they have the required points.

2. **Aditional Options**
1. **-C, --challenges**

This flag will display the number of **Challenges** in each episode.
```
$ ./content_check.sh -P ./c-_guide -C
Lesson Title: Programming in C++
Config.yaml Validation:
Title: Programming in C++
Contact: Invalid
Created: 2023-07-19
Source: https://github.com/lawtlee/c-_guide
Episode Validation:
Episode: hello-world.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Valid
Number of Challenges: 2
Episode: introduction.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Valid
Number of Challenges: 0
Episode: test.md
Questions: Valid
Objectives: Valid
Keypoints: Valid
Number of Challenges: 1
Episode: variables.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Invalid
Number of Challenges: 0
```

2. **-S, --solutions**

This flag will display the number of **Solutions** in each episode.
```
$ ./content_check.sh -P ./c-_guide -C
Lesson Title: Programming in C++
Config.yaml Validation:
Title: Programming in C++
Contact: Invalid
Created: 2023-07-19
Source: https://github.com/lawtlee/c-_guide
Episode Validation:
Episode: hello-world.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Valid
Number of Discussions: 2
Episode: introduction.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Valid
Number of Discussions: 0
Episode: test.md
Questions: Valid
Objectives: Valid
Keypoints: Valid
Number of Discussions: 2
Episode: variables.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Invalid
Number of Discussions: 0
```
3. **-D, --discussions**

This flag will display the number of **Discussions** in each episode.
```
$ ./content_check.sh -P ./c-_guide -C
Lesson Title: Programming in C++
Config.yaml Validation:
Title: Programming in C++
Contact: Invalid
Created: 2023-07-19
Source: https://github.com/lawtlee/c-_guide
Episode Validation:
Episode: hello-world.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Valid
Number of Solutions: 0
Episode: introduction.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Valid
Number of Solutions: 0
Episode: test.md
Questions: Valid
Objectives: Valid
Keypoints: Valid
Number of Solutions: 0
Episode: variables.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Invalid
Number of Solutions: 0
```

4. **-o \<file\>**

This flag specifies an output file. it will ouput into a file instead of the terminal

```
# Terminal
$ ./content_check.sh -P ./c-_guide -o test.txt
# test.txt
Lesson Title: Programming in C++
Config.yaml Validation:
Title: Programming in C++
Contact: Invalid
Created: 2023-07-19
Source: https://github.com/lawtlee/c-_guide
Episode Validation:
Episode: hello-world.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Valid
Episode: introduction.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Valid
Episode: test.md
Questions: Valid
Objectives: Valid
Keypoints: Valid
Episode: variables.Rmd
Questions: Valid
Objectives: Valid
Keypoints: Invalid
```

*NOTE the -e flag has depreciated and is now moved into the python script*

4. **Debugging/problems**

If you run into any issues create a new Issue in the repository and flag **@lawtlee**.
Provide a picture of what went wrong as well.
10 changes: 10 additions & 0 deletions docs/imls-tools/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: IMLS Tools
layout: default
permalink: /docs/imls-tools
has_children: true
nav_order: 6
---

These are tools developed by UCLA IMLS. Documentation goes over how to use them. You can find all the tools in
this [repository](https://github.com/ucla-imls-open-sci/imls-tools.git).

0 comments on commit 76c2929

Please sign in to comment.