-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from adrianariton/chattutor
Adding Chattutor
- Loading branch information
Showing
522 changed files
with
51,408 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Building | ||
|
||
From the root folder of the app run: | ||
```sh | ||
jupyter-book build --all book | ||
python3 ./book/chattutor_setup/install.py # adding the chattutor script to all the html files | ||
``` | ||
|
||
CORS needs to allow the url to make requests!! | ||
For now this can only be tested locally. | ||
|
||
# Testing locally | ||
|
||
Checkout chattutor.config.js | ||
|
||
- Start an instance of the main branch of the chattutor repo at port `5000` at `localhost` | ||
- Go to config and set **TEST_MODE** to true and **SERVER_PORT** to `5000` | ||
- Run the following commands to build the notebook and to add chattutor | ||
one in venv (checkout main README for info on that) | ||
```sh | ||
jupyter-book build --all book | ||
python3 ./book/chattutor_setup/install.py # adding the chattutor script to all the html files | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/** | ||
* --------------- ChatTutor.org ---------------- | ||
* Configuration file for chattutor.min.js which | ||
* should not be modified. This file consists of | ||
* the necesary configurations for running chat- | ||
* tutor in a course. | ||
* Currently the ChatTutor needs be added by hand | ||
* or using the install.py script in each page of | ||
* the application, weather build with jupyter or | ||
* other frameworks. | ||
* The style necesary for ChatTutor is provided in | ||
* chattutor.style.css, and can be adjusted for | ||
* every course's needs. | ||
* | ||
* The following configuration variables have the | ||
* following meaning: | ||
* | ||
* EMBEDDING_COLLECTION_NAME: the name of the | ||
* database that is [[either provided on | ||
* ChatTutor.org when an account is created and | ||
* a new course added - this will be added soon]] | ||
* or provided by the contributors to ChatTutor. | ||
* | ||
* TEST_MODE: should be false for prodction and | ||
* either true or false for testing. When true, | ||
* requests to the chattutor server are actually | ||
* done to https://localhost:<SERVER_PORT>. | ||
* This option is added because currently ChatTutor | ||
* has a CORS wall that only allows certain domains | ||
* to make requests to its APIs, and the CORS needs | ||
* to be manually updated when a course is ready | ||
* to use Chattutor. For testing purposes on should | ||
* run the ChatTutor server on the port SERVER_PORT | ||
* and request to it. This will be deprecated in | ||
* the latter phases of the project, when the CORS | ||
* will be updated automatically, and it is currently | ||
* used by our team for manually adding and testing | ||
* ChatTutor to new courses. | ||
* | ||
* COURSE_URL: the base url for the course | ||
* | ||
* | ||
* RUN_LOCALLY: true if and only if course is tested | ||
* locally. For production it should be false, | ||
* for testing it should be true. | ||
* | ||
* IS_STATIC: true if ran statically on a index.html | ||
* file, false if ran on a server, either local or online | ||
* Usually true for jupyter books | ||
*/ | ||
const RUN_LOCALLY = true; | ||
const TEST_MODE = false; | ||
const IS_STATIC = true; | ||
|
||
const EMBEDDING_COLLECTION_NAME = "photonicsbootcamp2811"; | ||
const COURSE_URL = "https://byucamacholab.github.io/Photonics-Bootcamp" | ||
/** | ||
* --------------- TESTING CONFIGS ---------------- | ||
* ChatTutor can be embedded on default applications | ||
* that run on servers, or in static pages such as | ||
* Jupyter Notebooks. | ||
* | ||
* For the purpose of testing, the build method needs | ||
* to be specified so the server knows how to parse | ||
* the current url name. | ||
* | ||
* BUILT_WITH: "JUPYTER-NOTEBOOK"|"SERVER" | ||
* | ||
* This configuration is ONLY used for testing and | ||
* will have no weight in production mode | ||
* (RUN_LOCALLY = false) | ||
* | ||
* SERVER_PORT: the port listen to Chattutor | ||
* server if ran locally. Used ONLY for testing | ||
* purposes (TEST_MODE = false) | ||
*/ | ||
const BUILT_WITH = "JUPYTER-NOTEBOOK" | ||
const SERVER_PORT = 5000 | ||
|
||
/** | ||
* JUPYTER-NOTEBOOK Specific configurations. | ||
*/ | ||
const BUILD_HTML_JUPYTER_NOTEBOOK_FOLDER = "_build/html" |
Oops, something went wrong.