-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This has been largerly just copy/paste from Kiosk with a few substitutions from multiplayer and skillmap.
- Loading branch information
Showing
38 changed files
with
32,247 additions
and
7 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
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
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
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,10 @@ | ||
/** | ||
* This file is the same as react-common-teachertool.less except it doesn't import any | ||
* variables from the target. This is used for pxt-core's css build | ||
*/ | ||
|
||
// Import variables from pxt-core | ||
@import "themes/default/globals/site.variables"; | ||
@import "themes/pxt/globals/site.variables"; | ||
|
||
@import "react-common.less"; |
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,12 @@ | ||
/** | ||
* Used for building react-common-teachertool.css | ||
*/ | ||
|
||
// Import variables from pxt-core | ||
@import "themes/default/globals/site.variables"; | ||
@import "themes/pxt/globals/site.variables"; | ||
|
||
// Import the variables from the target | ||
@import "site/globals/site.variables"; | ||
|
||
@import "react-common.less"; |
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,3 @@ | ||
DISABLE_ESLINT_PLUGIN=true | ||
GENERATE_SOURCEMAP=false | ||
BROWSER=none |
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,6 @@ | ||
module.exports = { | ||
"parserOptions": { | ||
"project": "teachertool/tsconfig.json", | ||
}, | ||
"ignorePatterns": ["tests/**/*.spec.ts", "public/**/*", "build/**/*"] | ||
} |
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,4 @@ | ||
.vscode | ||
build | ||
!package-lock.json | ||
src/Fonts.css |
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,5 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"semi": true, | ||
"tabWidth": 4 | ||
} |
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,35 @@ | ||
# Teacher Tool | ||
|
||
## config.json settings | ||
|
||
|Key|Purpose| | ||
|---------------------------------|-| | ||
|Volume | Volume for sounds within the page| | ||
|
||
## Localhost testing | ||
|
||
To test the Teacher Tool locally: | ||
|
||
1. Ensure your pxt repo is up to date and has been built recently. | ||
2. In a command shell, in the `pxt` repo, cd into the `teachertool` folder and start the Teacher Tool dev server: `npm run start`. This will *not* open a browser window. | ||
3. In another command shell, in the `pxt-arcade` repo, start the Arcade dev server: `pxt serve --rebundle`. This will open the Arcade webapp in a browser. | ||
|
||
Requests to the `/teachertool` endpoint will be routed to the Teacher Tool dev server. | ||
|
||
Debug and step through Teacher Tool code using the browser dev tools (F12 to open). | ||
|
||
|
||
## Test in staging environment | ||
|
||
1. In the pxt repo, run `gulp` to ensure production teacher tool is built. | ||
2. In a browser, go to `https://staging.pxt.io/oauth/gettoken`. This should return a url with an auth token embedded. Copy the entire url value to your clipboard. | ||
- It should look something like `https://staging.pxt.io/?access_token=X.XXXXXXXX` | ||
- If you get access denied, contact your manager to help you. | ||
3. In a command shell, set environment variable `PXT_ACCESS_TOKEN` with the copied value. | ||
4. In the same shell, in the pxt-arcade repo, run `pxt uploadtrg --rebundle`. This should return a url to your private build. | ||
- It should look something like `https://arcade.staging.pxt.io/app/XXXXXX-XXXXX` | ||
- Paste in a browser and append "/teachertool". This should take you to your teacher tool build in staging. | ||
|
||
## Test in production environment | ||
|
||
Follow the "Test in staging environment" instructions, but get your auth token from `https://makecode.com/oauth/gettoken`. |
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,41 @@ | ||
const { aliasWebpack } = require("react-app-alias-ex"); | ||
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin"); | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
|
||
module.exports = function (config, env) { | ||
const isEnvProduction = env === "production"; | ||
const aliasFn = aliasWebpack({}); | ||
config = { | ||
...aliasFn(config), | ||
plugins: [ | ||
...config.plugins.filter((p) => !(p instanceof HtmlWebpackPlugin)), | ||
new NodePolyfillPlugin(), | ||
new HtmlWebpackPlugin( | ||
Object.assign( | ||
{}, | ||
{ | ||
inject: true, | ||
template: "./public/index.html", | ||
}, | ||
isEnvProduction | ||
? { | ||
minify: { | ||
removeComments: false, | ||
collapseWhitespace: false, | ||
removeRedundantAttributes: true, | ||
useShortDoctype: true, | ||
removeEmptyAttributes: true, | ||
removeStyleLinkTypeAttributes: true, | ||
keepClosingSlash: true, | ||
minifyJS: true, | ||
minifyCSS: true, | ||
minifyURLs: true, | ||
}, | ||
} | ||
: undefined | ||
) | ||
), | ||
], | ||
}; | ||
return config; | ||
}; |
Oops, something went wrong.