Skip to content

Commit

Permalink
Merge pull request #42755 from code-dot-org/levelbuilder
Browse files Browse the repository at this point in the history
DTS (Levelbuilder > Staging) [robo-dts]
  • Loading branch information
deploy-code-org committed Sep 29, 2021
2 parents 7614640 + f1735c6 commit cc4c53e
Show file tree
Hide file tree
Showing 50 changed files with 1,939 additions and 825 deletions.
64 changes: 64 additions & 0 deletions dashboard/config/libraries/zHelloWorldValidation.interpreted.js
@@ -0,0 +1,64 @@
function level4(){
//This level requires zValidationHelperFunctions

if (!validationProps.successCriteria) {
validationProps.successCriteria = {
clickedSprite: false
};
}
if(!validationProps.clickedSprites){
validationProps.clickedSprites=[];
}

// Helper variables
var spriteIds = getSpriteIdsInUse();
var eventLog = getEventLog();

//check for unclicked sprites, and show hand with rings
if(World.seconds >1){
for(var i=0;i<spriteIds.length;i++){
var foundClick=false;
for(var j=0;j<eventLog.length;j++){
if(eventLog[j].includes(i)){
foundClick=true;
if(validationProps.clickedSprites.indexOf(i)==-1){
validationProps.clickedSprites.push(i);
}
}
}
if(!foundClick){
drawRings(getProp({id: i}, "x"),400-getProp({id: i}, "y"));
drawHand(getProp({id: i}, "x"),400-getProp({id: i}, "y"));
}
}
}

// Set success time if success
if(validationProps.clickedSprites.length>=2 && !validationProps.successTime)
{
validationProps.successTime = World.frameCount;
}

// Delay fail time (so student can observe the wrong animation)
var failTime = 300;

// Check criteria and give failure feedback
if (World.frameCount > failTime) {
levelFailure(3, "clickAnySprite");
}

// Pass 5 seconds after success
var waitTime = 150;
if (World.frameCount - validationProps.successTime >= waitTime) {
levelFailure(0, "genericSuccess");
}

push();
stroke("white");
if (!validationProps.successTime) {
drawProgress("fail",World.frameCount,failTime);
} else {
drawProgress("pass",World.frameCount - validationProps.successTime,waitTime);
}
pop();
}
@@ -0,0 +1,76 @@
//Helper Functions
function drawProgress(state,currentTime,endTime){
if(state=="fail"){
fill(rgb(118,102,160));
} else if (state=="pass"){
fill(rgb(0,173,188));
} else if (state=="challenge"){
fill(rgb(0,World.frameCount*10%255,0));
}
rect(0,390,currentTime*400/endTime);
}
function drawRings(x,y){
push();
stroke("rgba(0,0,0,0.5)");
noFill();
strokeWeight(3);
ellipse(x,y,Math.cos(World.frameCount/10)*30,Math.cos(World.frameCount/10)*30);
stroke("rgba(255,255,255,0.5)");
noFill();
strokeWeight(3);
ellipse(x,y,Math.sin(World.frameCount/10)*30,Math.sin(World.frameCount/10)*30);
pop();
}
function drawHand(x, y) {
y+=5;
push();
var gray1=Math.cos(World.frameCount/10)*30;
var gray2=Math.sin(World.frameCount/10)*30+225;
//background(color);
noStroke();
fill(rgb(224, 224, 224));
//palm
shape(x-5.5,y+12,x+35.5,y+20,x+35.5,y+37,x-5.5,y+37);
//index finger
rect(x-5.5,y-5,10,30);
ellipse(x,y-5,10);
//middle
ellipse(x+10,y+15,10);
//ring
ellipse(x+20,y+17.5,10);
//pinky
ellipse(x+30,y+20,10);
//wrist
ellipse(x,y+37,10);
ellipse(x+30,y+37,10);
rect(x,y+32,30,15);
//thumb
shape(x-5.5,y+37,x-20.5,y+22,x-13.5,y+15,x-5.5,y+25);
ellipse(x-17,y+18.5,10);
stroke(rgb(96, 96, 96));
strokeWeight(3);
noFill();
//palm
line(x-5.5,y-5,x-5.5,y+25);
line(x+35,y+20,x+35,y+37);
//index finger
line(x+4.5,y-5,x+4.5,y+15);
arc(x,y-5,10,10,180,0);
//middle
arc(x+10,y+15,10,10,180,0);
//ring
arc(x+20,y+17.5,10,10,180,0);
//pinky
arc(x+30,y+20,10,10,180,0);
//wrist
arc(x,y+37,10,10,90,180);
arc(x+30,y+37,10,10,0,90);
line(x,y+42,x,y+47);
line(x+30,y+42,x+30,y+47);
line(x,y+47,x+30,y+47);
//thumb
line(x-5.5,y+37,x-20.5,y+22);
line(x-13.5,y+15,x-5.5,y+25);
arc(x-17,y+18.5,10,10,135,315);
pop();
}
22 changes: 11 additions & 11 deletions dashboard/config/locales/scripts.en.yml
Expand Up @@ -194,7 +194,7 @@ en:
Artist:
name: Artist
description_student: Create beautiful images by programming the Artist.
description_teacher: In this lesson, students will take control of the Artist to complete drawings on the screen. This Artist stage will allow students to create images of increasing complexity using new blocks like `move forward by 100 pixels` and `turn right by 90 degrees`.
description_teacher: In this lesson, students will take control of the Artist to complete drawings on the screen. This Artist stage will allow students to create images of increasing complexity using programming blocks like `move forward by 100 pixels` and `turn right by 90 degrees`.
student_description: Draw cool pictures and designs with the Artist!
hourofcode:
title: Classic Maze
Expand Down Expand Up @@ -2110,7 +2110,7 @@ en:
description_teacher: |-
In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson has two versions. This version uses drag-drop blocks and works best for students on mobile devices without keyboards, younger students, and international students. It is recommended for ages 6+.

A [JavaScript](s/starwars) version is also available. For older students on computers, learning JavaScript can be fun and provide an additional challenge. Note that JavaScript syntax is not translated and for the first Hour of Code, the translated blocks found here provide a better introduction.
A [JavaScript](s/starwars) version is also available. For older students on computers, learning JavaScript can be fun and provide an additional challenge. Note that JavaScript syntax is not translated and for the first Hour of Code, the translated blocks found here provide a better introduction. This version of the tutorial is also great if you have some students in your class who have already learned some coding. It is recommended for ages 11+.
student_description: Learn to program droids, and create your own Star Wars game in a galaxy far, far away.
mc:
title: Minecraft Hour of Code
Expand All @@ -2120,7 +2120,7 @@ en:
lesson_groups: {}
lessons:
Hour of Code 2015:
name: Hour of Code 2015
name: 'Minecraft: Adventurer'
description_student: In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson works well for any students old enough to read (ages 6+). Younger learners will probably not finish the tutorial, but will have lots of fun working through the puzzles for an hour. High school students will mostly finish the tutorial and have some time to play on the free play level at the end.
description_teacher: In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson works well for any students old enough to read (ages 6+). Younger learners will probably not finish the tutorial, but will have lots of fun working through the puzzles for an hour. High school students will mostly finish the tutorial and have some time to play on the free play level at the end.
student_description: Use blocks of code to take Steve or Alex on an adventure through this Minecraft world.
Expand Down Expand Up @@ -4188,7 +4188,7 @@ en:
lesson_groups: {}
lessons:
Bounce:
name: Bounce
name: Code Your Own Basketball Game
description_student: Ever wish you could play video games in school? In this lesson, you will get to make your own!
description_teacher: In this online activity, students will learn what events are, and how computers use them in programs like video games. Students will work through puzzles making the program react to events (like arrow buttons being pressed.) At the end of the puzzle, students will have the opportunity to customize their game with different speeds and sounds.
student_description: Choose your team and make a basketball game
Expand Down Expand Up @@ -4474,7 +4474,7 @@ en:
lesson_groups: {}
lessons:
Minecraft Hour of Code Designer:
name: Minecraft Hour of Code Designer
name: 'Minecraft: Designer'
description_student: In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson works well for any students old enough to read (ages 6+). Younger learners will probably not finish the tutorial, but will have lots of fun working through the puzzles for an hour. High school students will mostly finish the tutorial and have some time to play on the free play level at the end.
description_teacher: In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson works well for any students old enough to read (ages 6+). Younger learners will probably not finish the tutorial, but will have lots of fun working through the puzzles for an hour. High school students will mostly finish the tutorial and have some time to play on the free play level at the end.
student_description: Program animals and other Minecraft creatures in your own version of Minecraft.
Expand Down Expand Up @@ -4812,7 +4812,7 @@ en:
lesson_groups: {}
lessons:
Sports:
name: Sports
name: Code Your Own Sports Game
description_student: Ever wish you could play video games in school? In this lesson, you will get to make your own!
description_teacher: In this online activity, students will learn what events are, and how computers use them in programs like video games. Students will work through puzzles making the program react to events (like arrow buttons being pressed.) At the end of the puzzle, students will have the opportunity to customize their game with different speeds and sounds.
student_description: Mix and match across sports
Expand Down Expand Up @@ -7862,8 +7862,8 @@ en:
'Minecraft\: Hero''s Journey Hour of Code':
name: 'Minecraft\: Hero''s Journey Hour of Code'
Minecraft Hour of Code:
name: Minecraft Hour of Code
description_student: In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson works well for any students old enough to read (ages 6+). Younger learners will probably not finish the tutorial, but will have lots of fun working through the puzzles for an hour. High school students will mostly finish the tutorial and have some time to play on the free play level at the end.
name: 'Minecraft: Hero''s Journey'
description_student: 'In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. '
description_teacher: In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson works well for any students old enough to read (ages 6+). Younger learners will probably not finish the tutorial, but will have lots of fun working through the puzzles for an hour. High school students will mostly finish the tutorial and have some time to play on the free play level at the end.
student_description: Minecraft is back for the Hour of Code with a brand new activity! Journey through Minecraft with code.
applab-intro-staging:
Expand Down Expand Up @@ -10896,8 +10896,8 @@ en:
lesson_groups: {}
lessons:
Aquatic:
name: Aquatic
description_student: In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson works well for any students old enough to read (ages 6+). Younger learners will probably not finish the tutorial, but will have lots of fun working through the puzzles for an hour. High school students will mostly finish the tutorial and have some time to play on the free play level at the end.
name: 'Minecraft: Voyage Aquatic'
description_student: 'In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. '
description_teacher: In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson works well for any students old enough to read (ages 6+). Younger learners will probably not finish the tutorial, but will have lots of fun working through the puzzles for an hour. High school students will mostly finish the tutorial and have some time to play on the free play level at the end.
student_description: Minecraft is back with a brand new activity! Use your creativity and problem solving skills to explore and build underwater worlds with code.
sconyers:
Expand Down Expand Up @@ -11012,7 +11012,7 @@ en:
lesson_groups: {}
lessons:
Dance Party - Go Further:
name: Dance Party - Go Further
name: Keep on Dancing (2018)
description_student: In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson has been designed for learners of all ages but does require reading. This activity requires sound as the tool was built to respond to music.
description_teacher: In this lesson, learners of all ages get an introductory experience with coding and computer science in a safe, supportive environment. This lesson has been designed for learners of all ages but does require reading. This activity requires sound as the tool was built to respond to music.
student_description: Go beyond the first hour with extended project ideas.
Expand Down
12 changes: 12 additions & 0 deletions dashboard/config/scripts/csa_u5l8_l3.match
@@ -0,0 +1,12 @@
name 'CSA U5L8-L3'
title 'Check for Understanding'
description 'Match each term to its correct definition.'
height 'auto'
question 'immutable'
answer 'the content cannot be changed once it is created'
question 'ArrayOutOfBoundsException'
answer 'an index value that is either negative or greater than or equal to the length of the array'
question 'for loop'
answer 'a loop that has a predetermined beginning, end, and increment or decrement'
question 'loop control variable'
answer 'a variable declared and used within a loop to count iterations through the loop.'
29 changes: 29 additions & 0 deletions dashboard/config/scripts/csa_u5l8_l6.multi
@@ -0,0 +1,29 @@
name 'CSA U5L8-L6'
title 'Check for Understanding'

markdown <<MARKDOWN
Consider the following method, `shift`, which is intended to shift the elements of `arr` one to the left. For example, if `arr` contains `{{1, 2, 3}, {4, 5, 6}}`, then `shift(arr)` should return `{{2, 3, 1}, {5, 6, 4}}`.

```
public static int[][] shift(int[][] arr) {
int[][] ret = new int[arr.length][arr[0].length];

for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[0].length - 1; j++) {
/* missing statement */
}
ret[i][arr[0].length - 1] = arr[i][0];
}

return ret;
}
```

What choice could replace `/* missing statement */` so that `shift` works as intended?
MARKDOWN

wrong 'ret[i][j] = arr[i][j - 1];'
right 'ret[i][j] = arr[i][j + 1];'
wrong 'arr[i][j] = ret[i][j - 1];'
wrong 'arr[i][j] = ret[i][j + 1];'
wrong 'arr[i][j] = ret[i][j];'
12 changes: 12 additions & 0 deletions dashboard/config/scripts/csa_u5l9_l3.match
@@ -0,0 +1,12 @@
name 'CSA U5L9-L3'
title 'Check for Understanding'
description 'Match each term with its correct definition.'
height 'auto'
question 'De Morgan\'s Laws'
answer 'a set of rules that describe how to simplify complex Boolean expressions'
question 'polymorphism'
answer 'the ability to perform an action in different ways'
question 'enhanced for loop variable'
answer 'a variable declared and used within an enhanced for loop to store a copy of the element being visited. '
question 'logical operator'
answer 'an operator that returns a Boolean value'
20 changes: 20 additions & 0 deletions dashboard/config/scripts/levels/CSA U5L8 Template.level
@@ -0,0 +1,20 @@
<Javalab>
<config><![CDATA[{
"properties": {
"encrypted": "false",
"encrypted_examples": [

],
"mini_rubric": "false",
"submittable": "false",
"hide_share_and_remix": "false",
"csa_view_mode": "theater"
},
"game_id": 68,
"published": true,
"created_at": "2021-09-28T19:43:57.000Z",
"level_num": "custom",
"user_id": 9271,
"audit_log": "[{\"changed_at\":\"2021-09-28 19:44:09 +0000\",\"changed\":[\"encrypted_examples\"],\"changed_by_id\":9271,\"changed_by_email\":\"jamila@code.org\"}]"
}]]></config>
</Javalab>
22 changes: 22 additions & 0 deletions dashboard/config/scripts/levels/CSA U5L8-L1.level
@@ -0,0 +1,22 @@
<Javalab>
<config><![CDATA[{
"properties": {
"encrypted": "false",
"encrypted_examples": [

],
"project_template_level_name": "CSA U5L8 Template",
"long_instructions": "create shiftedimage class",
"mini_rubric": "false",
"submittable": "false",
"hide_share_and_remix": "false",
"csa_view_mode": "theater"
},
"game_id": 68,
"published": true,
"created_at": "2021-09-28T19:44:41.000Z",
"level_num": "custom",
"user_id": 9271,
"audit_log": "[{\"changed_at\":\"2021-09-28 19:44:44 +0000\",\"changed\":[\"encrypted_examples\"],\"changed_by_id\":9271,\"changed_by_email\":\"jamila@code.org\"}]"
}]]></config>
</Javalab>
22 changes: 22 additions & 0 deletions dashboard/config/scripts/levels/CSA U5L8-L2.level
@@ -0,0 +1,22 @@
<Javalab>
<config><![CDATA[{
"properties": {
"encrypted": "false",
"encrypted_examples": [

],
"project_template_level_name": "CSA U5L8 Template",
"long_instructions": "test shiftedimage class",
"mini_rubric": "false",
"submittable": "false",
"hide_share_and_remix": "false",
"csa_view_mode": "theater"
},
"game_id": 68,
"published": true,
"created_at": "2021-09-28T19:45:03.000Z",
"level_num": "custom",
"user_id": 9271,
"audit_log": "[{\"changed_at\":\"2021-09-28 19:45:06 +0000\",\"changed\":[\"encrypted_examples\"],\"changed_by_id\":9271,\"changed_by_email\":\"jamila@code.org\"}]"
}]]></config>
</Javalab>
22 changes: 22 additions & 0 deletions dashboard/config/scripts/levels/CSA U5L8-L4.level
@@ -0,0 +1,22 @@
<Javalab>
<config><![CDATA[{
"properties": {
"encrypted": "false",
"encrypted_examples": [

],
"project_template_level_name": "CSA U5L8 Template",
"long_instructions": "animate shift",
"mini_rubric": "false",
"submittable": "false",
"hide_share_and_remix": "false",
"csa_view_mode": "theater"
},
"game_id": 68,
"published": true,
"created_at": "2021-09-28T19:46:55.000Z",
"level_num": "custom",
"user_id": 9271,
"audit_log": "[{\"changed_at\":\"2021-09-28 19:46:58 +0000\",\"changed\":[\"encrypted_examples\"],\"changed_by_id\":9271,\"changed_by_email\":\"jamila@code.org\"}]"
}]]></config>
</Javalab>

0 comments on commit cc4c53e

Please sign in to comment.