Skip to content

Commit

Permalink
Merge pull request #42253 from code-dot-org/staging
Browse files Browse the repository at this point in the history
DTT (Staging > Test) [robo-dtt]
  • Loading branch information
deploy-code-org committed Aug 30, 2021
2 parents 879326d + 7445fa9 commit 6bf5737
Show file tree
Hide file tree
Showing 65 changed files with 3,093 additions and 602 deletions.
6 changes: 4 additions & 2 deletions apps/src/p5lab/spritelab/libraries/PoemBotLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,10 @@ export default class PoemBotLibrary extends CoreLibrary {
}
this.p5.textSize(renderInfo.lineSize);
renderInfo.lines.forEach(item => {
let color = this.getP5Color(renderInfo.font.fill, item.alpha);
this.p5.fill(color);
let fillColor = this.getP5Color(renderInfo.font.fill, item.alpha);
this.p5.fill(fillColor);
let strokeColor = this.getP5Color(renderInfo.font.stroke, item.alpha);
this.p5.stroke(strokeColor);
this.p5.text(item.text, item.x, item.y);
});
}
Expand Down
56 changes: 56 additions & 0 deletions apps/src/p5lab/spritelab/poembot/commands/backgroundEffects.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,62 @@ export const commands = {

break;
}
case 'ripples': {
palette = PALETTES[palette];
let ripples = [];
let startRipple = false;
let colorIndex = 0;
const rippleSpacing = 30;
const rippleSpeed = 4;
const frameDelay = 4;
const rippleNumber = palette.length - 1;

for (let i = 0; i < rippleNumber; i++) {
ripples.push({
size: (i + 1) * rippleSpacing,
color: palette[colorIndex]
});
colorIndex = (colorIndex + 1) % palette.length;
}

this.backgroundEffect = () => {
this.p5.push();
this.p5.noFill();
this.p5.strokeWeight(3);
if (startRipple && this.p5.frameCount % frameDelay === 0) {
ripples.push({
size:
rippleSpacing +
ripples.length * (rippleSpacing + rippleSpeed * frameDelay),
color: palette[colorIndex]
});
colorIndex = (colorIndex + 1) % palette.length;
if (ripples.length === rippleNumber) {
startRipple = false;
}
}

if (ripples.length > 0) {
// the actual background color is not fully opaque so we need to
// "clear out" the previous frame first so we don't see a remnant of it.
this.p5.background('white');
this.p5.background(this.getP5Color(ripples[0].color, 100));
}

ripples.forEach(ripple => {
const alpha = this.p5.map(ripple.size, 400, 0, 0, 255);
this.p5.stroke(this.getP5Color(ripple.color, alpha));
this.p5.ellipse(200, 200, ripple.size, ripple.size);
ripple.size += rippleSpeed;
});
ripples = ripples.filter(ripple => ripple.size < 500);
if (ripples.length === 0) {
startRipple = true;
}
this.p5.pop();
};
break;
}
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@
"Dark Circles",
"\"darkCircles\""
],
[
"Cloudy",
"\"cloudy\""
],
[
"Fade Colors",
"\"fadeColors\""
],
[
"Blooming",
"\"blooming\""
],
[
"Ripples",
"\"ripples\""
]
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@
"Shattering Glass",
"\"glass\""
],
[
"Smoke",
"\"smoke\""
],
[
"Birds Flocking",
"\"birds\""
],
[
"Twinkling",
"\"twinkling\""
Expand Down
4 changes: 2 additions & 2 deletions dashboard/config/blocks/PoemBot/PoemBot_setPoem.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"category": "",
"config": {
"func": "setPoem",
"blockText": "set poem {BG_EFFECT}",
"blockText": "set poem {POEM}",
"args": [
{
"name": "BG_EFFECT",
"name": "POEM",
"options": [
[
"---",
Expand Down
2 changes: 1 addition & 1 deletion dashboard/config/blocks/PoemBot/PoemBot_startBehavior.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"category": "Experimental",
"config": {
"func": "startBehavior",
"blockText": "sprite {ANIMATION_NAME} starts {BEHAVIOR} ",
"blockText": "sprite {ANIMATION_NAME} begins {BEHAVIOR} ",
"args": [
{
"name": "ANIMATION_NAME",
Expand Down
28 changes: 23 additions & 5 deletions dashboard/config/scripts/csa_u1_assessment_q4.multi
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,33 @@ Covered in Unit 1 Lesson 5.
MARKDOWN

markdown <<MARKDOWN
Which of the following signatures are correct examples of a constructor for a class called Painter?
Consider the code segment below.

I. Painter ross = new Painter (3, 4, “North”, 2);
```
public class Painter {
...

II. Painter ross = new Paint (“South”, 1,2,5);
public Painter() {
. . .
}

III. Painter ross = new Painter ();
public Painter(int x, int y, String direction, int paint) {
. . .
}

. . .
}
```

IV. Painter ross = new Painter (0, 0, “East”, 6);’
Which of the following are correct examples of initializing a `Painter` object?

I. `Painter ross = new Painter (3, 4, “North”, 2);`

II. `Painter ross = new Paint (“South”, 1,2,5);`

III. `Painter ross = new Painter ();`

IV. `Painter ross = new Painter (0, 0, “East”, 6);’`


MARKDOWN
27 changes: 14 additions & 13 deletions dashboard/config/scripts/csa_u1_assessment_q6.multi
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ Covered in Unit 1 Lesson 3.
MARKDOWN

markdown <<MARKDOWN
Which of the following will cause an error?
Which of the following will cause a syntax error?

I. Painter jes = new Painter(2, 5, “South”, 5);
if (jes.canMove()) {
jes.move();
}
```
I. Painter jes = new Painter(2, 5, “South”, 5);
if (jes.canMove()) {
jes.move();
}

II. Painter art = new Painter()
while( !jes.canMove()){
jes.move();
}
II. Painter art = new Painter()
while( !jes.canMove()){
jes.move();
}

III. Painter picasso = new Painter(3, 6, “North”, 3);
if (karel.isOnPaint(){
karel.move()
}

if (karel.isOnPaint(){
karel.move()
}
```
MARKDOWN
12 changes: 6 additions & 6 deletions dashboard/config/scripts/csa_u1_assessment_q8.multi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name 'CSA U1 Assessment q8'
height 'auto'

wrong ‘public jes(x, y, direction, units of paint)’
wrong ‘public Artist(y, x, units of paint, direction)’
wrong ‘public Artist(x, y, direction, units of paint)’
right ‘public Painter(x, y, direction, units of paint)’
wrong ‘Public painter(direction, x, y, units of paint)’
wrong ‘public jes(int x, int y, String direction, int unitsOfPaint)’
wrong ‘public Artist(int y, int x, int unitsOfPaint, String direction)’
wrong ‘public Artist(int x, int y, String direction, int unitsOfPaint)’
right ‘public Painter(int x, int y, String direction, int unitsOfPaint)’
wrong ‘Public painter(String direction, int x, int y, int unitsOfPaint)’



Expand All @@ -16,6 +16,6 @@ Covered in Unit 1 Lesson 5.
MARKDOWN

markdown <<MARKDOWN
The constructor method, public Painter jes = new Painter (4, 2, “North”, 3) has four actual parameters. The values are assigned when the actual values are passed to the constructor method. Which constructor signature correctly uses the actual parameters provided above?
The constructor call `Painter jes = new Painter (4, 2, “North”, 3)` has four actual parameters. The values are assigned when the actual values are passed to the constructor method. Which constructor signature correctly uses the actual parameters provided above?

MARKDOWN
12 changes: 6 additions & 6 deletions dashboard/config/scripts/jess-test-script.script
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ lesson 'Module 3', display_name: 'Module 3', has_lesson_plan: false
level 'VPL - CSD Module 3 Overview', progression: 'Module 3 Overview'
level 'VPL - CSD M3 Check-in', progression: 'Check In (~5 mins)'
level 'VPL - CSD M3 Theme Introduction', progression: 'Theme Introduction (~5 mins)'
level 'VPL - CSD Module 3 Curriculum Investigation Overview', progression: 'Lesson Investigation (~60 mins)'
level 'VPL - CSD - Module 3 - U4L1 Investigation', progression: 'Lesson Investigation (~60 mins)'
level 'VPL - CSD - Module 3 - Problem Solving Process Guide', progression: 'Lesson Investigation (~60 mins)'
level 'VPL - CSD Module 3 Problem Solving Process', progression: 'Lesson Investigation (~60 mins)'
level 'VPL - CSD - Module 3 - U4L2 Investigation', progression: 'Lesson Investigation (~60 mins)'
level 'VPL - CSD Module 3 U4L2 Reflection', progression: 'Reflection (~5 mins)'
level 'VPL - CSD Module 3 Curriculum Investigation Overview', progression: 'Curriculum Investigation (~60 mins)'
level 'VPL - CSD - Module 3 - U4L1 Investigation', progression: 'Curriculum Investigation (~60 mins)'
level 'VPL - CSD - Module 3 - Problem Solving Process Guide', progression: 'Curriculum Investigation (~60 mins)'
level 'VPL - CSD Module 3 Problem Solving Process', progression: 'Curriculum Investigation (~60 mins)'
level 'VPL - CSD - Module 3 - U4L2 Investigation', progression: 'Curriculum Investigation (~60 mins)'
level 'VPL - CSD Module 3 U4L2 Reflection', progression: 'Curriculum Investigation (~60 mins)'
level 'VPL - CSD Module 3 U4L2 Intro Group Dynamics', progression: 'Supporting Effective Group Work (~5 mins)'
level 'VPL - CSD Module 3 Equity - 2021', progression: 'Equity and Data (~5 mins)'
level 'VPL - CSD - Module 3 Wrap Up', progression: 'Module 3 Asynchronous Wrap Up (~10 mins)'
Expand Down

0 comments on commit 6bf5737

Please sign in to comment.