Skip to content

Commit 7a1a01e

Browse files
committed
Merge branch 'main' into 149-minor-update-adjust-styling-for-levels-4-and-5
2 parents 75e350b + d3205a7 commit 7a1a01e

File tree

16 files changed

+107
-103
lines changed

16 files changed

+107
-103
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
node-version: ${{ matrix.node-version }}
2121

2222
- name: Cache node_modules
23-
uses: actions/cache@v2
23+
uses: actions/cache@v4
2424
with:
2525
path: '**/node_modules'
2626
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
uses: actions/checkout@v2
1212

1313
- name: Cache node_modules
14-
uses: actions/cache@v2
14+
uses: actions/cache@v4
1515
with:
1616
path: '**/node_modules'
1717
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,6 @@ declare module '*.<YOUR_ASSET_TYPE>' {
187187

188188
Take a look at `<YOUR_PROJECT_PATH>/asset-manifest.json`. [Like this!](https://teach-la-ts-react-starter.netlify.app/asset-manifest.json)
189189

190-
## Things You Should Do (and then delete this section)
191-
192-
Thanks for using our template! We hope this makes your life developing significantly easier.
193-
194-
Things you should do **after using this as a template**:
195-
196-
- [ ] this is a reminder to periodically run accessibility checks & Search Engine Optimization on your project by running `inspect element / developer tools > Lighthouse`
197-
- [ ] update and delete this documentation!
198-
- [ ] contact Regina Wang (`@reginawang99`), Matthew Nieva (`@matthewcn56`), or Jiin Kim (`@doubleiis02`) with any questions about our quickstarter template set-up.
199-
200190
## Some More Helpful Tools
201191

202192
- Preloading Images - if rendering images gets annoying because it's slow: [Link Example here](https://github.com/uclaacm/Playnet/blob/c2414e7d1179eb11af6b4a49047ab3d8fb9aed66/src/components/shared/Preload.tsx)

src/components/shared/Congratulations.tsx

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,51 @@ import penPalsLogo from '../../assets/turtleLogo.svg';
66
function CongratsPage(): JSX.Element {
77
return (
88
<section id="congrats-page-container">
9-
<div>
10-
<div id="turtle-logo">
11-
<img
12-
src={penPalsLogo}
13-
alt="Small turtle, part of the TeachLA logo"
14-
id="turtle-image"
15-
/>
16-
<div id="turtle-logo-text">Pen Pals</div>
17-
</div>
18-
9+
<div id="congrats-turtle-logo">
10+
<img
11+
src={penPalsLogo}
12+
alt="Small turtle, part of the TeachLA logo"
13+
id="turtle-image"
14+
/>
15+
<div id="turtle-logo-text">Pen Pals</div>
16+
</div>
17+
<div className="congrats-speech-and-turtle-container"></div>
18+
<div className="congrats-speech-turtle-container">
1919
<div className="speech-bubble">
2020
<img
2121
src={speechBubble}
2222
alt="Small turtle, part of the TeachLA logo"
2323
id="speech-bubble-image"
2424
/>
25-
<div id="congratsTxt">CONGRATULATIONS!</div>
25+
<div className="congrats-text">
26+
<h1 id="congratsHeader">CONGRATULATIONS!</h1>
27+
<p>
28+
You learned about Python’s turtle library, where you can use
29+
commands such as goto, forward, left, and right to draw lines.
30+
Now, you can use these skills to create your own drawings and
31+
graphics using code!
32+
</p>
33+
<div className="congrats-links">
34+
<h2 id="congrats-links-header">
35+
Check out our other websites to learn more!
36+
</h2>
37+
<a href="https://parcel-pointers.netlify.app/">
38+
<u>Parcel Pointers</u>
39+
</a>
40+
<br />
41+
<a href="https://boolbots.uclaacm.com/">
42+
<u>Bool Bots</u>
43+
</a>
44+
<br />
45+
<a href="https://tuxs-great-adventure.netlify.app/">
46+
<u>Tux&apos;s Great Adventures</u>
47+
</a>
48+
</div>
49+
</div>
50+
</div>
51+
<div id="encouraging-turtle-congratulations">
52+
<img src={encouragingTurtle} alt="turtle image" id="turtle-picture" />
2653
</div>
27-
</div>
28-
29-
<div id="encouraging-turtle-congratulations">
30-
<img src={encouragingTurtle} alt="turtle image" id="turtle-picture" />
3154
</div>
3255
</section>
3356
);

src/components/shared/ExerciseSide.tsx

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -108,25 +108,6 @@ ExerciseSideProps): JSX.Element {
108108
</div>
109109
</div>
110110
);
111-
112-
/*<div className="exercise-box">
113-
<AxisParent
114-
axisMarkers={[
115-
[-2, -1, 0, 1, 2],
116-
[-1, 0, 1, 2],
117-
]}
118-
axisLabels={[
119-
['A', '', '', 'B', 'C'],
120-
['A', '', '', 'B'],
121-
]}
122-
toNextExercise={() => {
123-
setCompleteExercises(completeExercises + 1);
124-
incrementExercise();
125-
return;
126-
}}
127-
/>
128-
</div>
129-
);*/
130111
} else if (exercises[displayExercise] == 'graph1') {
131112
curExercise = (
132113
<div className="graph-exercise-input-container">
@@ -165,7 +146,7 @@ ExerciseSideProps): JSX.Element {
165146
{
166147
textArray: [
167148
{ type: 'text', text: 'turtle.' },
168-
{ type: 'input', width: 8, id: 1, answer: 'forward' },
149+
{ type: 'input', width: 8, id: 1, answer: 'backward' },
169150
{ type: 'text', text: '(' },
170151
{ type: 'input', width: 2, id: 2, answer: '3' },
171152
{ type: 'text', text: ')' },
@@ -313,7 +294,7 @@ ExerciseSideProps): JSX.Element {
313294
],
314295
]}
315296
unitCircleLabels={[
316-
['A', 'C', '', 'B', ''],
297+
['A', 'B', '', 'C', ''],
317298
['', 'A', 'B', '', 'C'],
318299
['', '', 'A', 'B', '', 'C', ''],
319300
['', 'A', '', '', 'B', '', 'C'],

src/components/shared/Exercises/AxisExercise.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ function AxisExercise({
2222
<div
2323
className="axis-container"
2424
style={{
25-
//transform: `rotate(${orientation === 'horizontal' ? '0deg' : '90deg'})`, // axis orientation
2625
transform: `rotate(${isHorizontal ? '0deg' : '90deg'})`, // axis orientation
2726
width: size,
2827
marginLeft: !isHorizontal ? '25%' : '2%',

src/components/shared/Exercises/AxisInputs.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface AxisInputProps {
1010
interface AxisQuestion {
1111
label: string;
1212
answer: number; // Should change to being strings
13-
id: number; //This sucks lol
13+
id: number; // This sucks lol!
1414
}
1515

1616
function AxisInput({
@@ -46,7 +46,6 @@ function AxisInput({
4646
}
4747
if (counter == questionLabels.length - 1) {
4848
setIsDone(true);
49-
//setIsComplete(true);
5049
nextExercise();
5150
return;
5251
}
@@ -91,7 +90,6 @@ function AxisInput({
9190
return <h2>Done!</h2>;
9291
}
9392

94-
//console.log(questionLabels[counter]);
9593
const questionOutput = questions.map(MakeQuestion);
9694
return (
9795
<div className="axinput-container">

src/components/shared/Exercises/AxisParent.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import AxisInput from './AxisInputs';
55
('./Exercises/AxisExercise');
66

77
interface AxisParentProps {
8-
axisMarkers: number[][]; //2-D array for different sets of problems
8+
axisMarkers: number[][]; // 2-D array for different sets of problems
99
axisLabels: string[][];
1010
orientations: string[];
1111
toNextExercise: () => void;
@@ -17,7 +17,7 @@ function AxisParent({
1717
orientations,
1818
toNextExercise,
1919
}: AxisParentProps): JSX.Element {
20-
//make 2d array for answers using the non-empty elements of axisLabels
20+
// make 2d array for answers using the non-empty elements of axisLabels
2121
const axisAnswers: number[][] = [];
2222
const questionLabels: string[][] = [];
2323
for (let i = 0; i < axisMarkers.length; i++) {
@@ -48,7 +48,6 @@ function AxisParent({
4848
return (
4949
<div>
5050
<AxisExercise
51-
//orientation="horizontal"
5251
orientation={
5352
orientations[Math.min(exerciseNum, axisMarkers.length - 1)]
5453
}

src/components/shared/Exercises/GraphExercise.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ interface GraphProps {
1515
}
1616

1717
function GraphExercise({
18-
/* eslint-disable @typescript-eslint/no-unused-vars */
1918
origin,
2019
points,
2120
pointerPosition,
2221
pointerOrientation,
23-
}: /* eslint-enable @typescript-eslint/no-unused-vars */
24-
GraphProps): JSX.Element {
22+
}: GraphProps): JSX.Element {
2523
const verticalLineCount = 7;
2624
const horizontalLineCount = 5;
2725
const verticalLineSpacing = 100 / (verticalLineCount + 1);

src/components/shared/Exercises/GraphInput.tsx

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//import { useState } from 'react';
21
import { useState, useEffect } from 'react';
32
import '../../../styles/Exercises/GraphInput.scss';
43

@@ -43,10 +42,7 @@ function GraphStringElement({
4342
if (questionData.type == 'text') {
4443
return <p id="graphinput-check-question">{questionData?.text ?? ''}</p>;
4544
} else {
46-
//const [inputText, setInputText] = useState("");
4745
const handleChange = (event: { target: { value: string } }) => {
48-
//console.log(`input text: ${event.target.value}`);
49-
//console.log(questionData?.answer ?? '');
5046
if (event.target.value == (questionData?.answer ?? '')) {
5147
setCorrect(questionData?.id ?? -1, true);
5248
} else {
@@ -69,7 +65,7 @@ function GraphStringElement({
6965
}
7066

7167
function GraphLine({ data, setCorrect }: GraphLineGrouping) {
72-
//Map all elements of TextArray
68+
// Map all elements of TextArray
7369
const makeElement = (elementData: GraphQuestionData): JSX.Element => {
7470
return (
7571
<GraphStringElement questionData={elementData} setCorrect={setCorrect} />
@@ -80,47 +76,26 @@ function GraphLine({ data, setCorrect }: GraphLineGrouping) {
8076
{data.textArray.map(makeElement)}
8177
</div>
8278
);
83-
/*return (
84-
<div id="graphinput-question-container">
85-
<GraphStringElement type={"text"} text={"Hi?"}/>
86-
<GraphStringElement type={"beans"} width={4} text={""}/>
87-
<p id={'graphinput-check-question'}> Bye</p>
88-
</div>
89-
);*/
9079
}
9180

9281
function GraphInput({
9382
questionArray,
9483
nextExercise,
9584
}: GraphInputProps): JSX.Element {
9685
const [valueMap, setValueMap] = useState(new Map<number, boolean>());
97-
// const valueMap = new Map<number, boolean>();
98-
// for (const question of questionArray) {
99-
// for (const item of question.textArray) {
100-
// if (item.type == 'input') {
101-
// setValueMap(valueMap.set(item.id ?? -1, false));
102-
// }
103-
// }
104-
// }
10586

10687
const setValueCorrect = (id: number, value: boolean): void => {
107-
// console.log(`Setting ${id} to ${value}`);
10888
setValueMap(valueMap.set(id, value));
10989
};
11090

11191
const checkCorrect = (): void => {
112-
// console.log('Checking correct');
11392
const valuesArray = Array.from(valueMap.values());
114-
// console.log(valuesArray);
11593
for (const i of valuesArray) {
116-
//console.log(i);
11794
if (!i) {
118-
//console.log(`${i} is incorrect`);
11995
setWrong(true);
12096
return;
12197
}
12298
}
123-
//console.log('all right!');
12499
setWrong(false);
125100
nextExercise();
126101
};

0 commit comments

Comments
 (0)