Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a4b669b
Remove cache bust from data url
Jan 22, 2020
a691b0a
Remove data-urls form files to add
Jan 27, 2020
fee07e9
Merge branch 'staging' into data-uris
Jan 29, 2020
eeddf39
Remove unnecessary call
Jan 30, 2020
70a0bd3
Merge pull request #32891 from code-dot-org/data-uris
Jan 30, 2020
0cc6dda
Merge pull request #32929 from code-dot-org/staging
deploy-code-org Jan 30, 2020
c358d86
Fixing unused string interpolation
daynew Jan 30, 2020
c2d95a3
Further reduce output from the sync down
bethanyaconnor Jan 30, 2020
a1d9a46
Merge branch 'staging' into quiet-i18n-pipeline
bethanyaconnor Jan 30, 2020
39fc588
Merge pull request #32931 from code-dot-org/fix_string_interpolation
daynew Jan 30, 2020
7b1a169
Merge pull request #32934 from code-dot-org/staging
deploy-code-org Jan 30, 2020
93cddb6
levelbuilder content changes (-robo-commit)
deploy-code-org Jan 30, 2020
8e1f065
Merge pull request #32935 from code-dot-org/dtl_candidate_0cc6dda5
deploy-code-org Jan 30, 2020
0d22e87
Simplify syntax
bethanyaconnor Jan 30, 2020
a4f756e
Merge pull request #32933 from code-dot-org/quiet-i18n-pipeline
bethanyaconnor Jan 30, 2020
1752b25
Merge pull request #32938 from code-dot-org/staging
deploy-code-org Jan 30, 2020
074b2ba
levelbuilder content changes (-robo-commit)
deploy-code-org Jan 31, 2020
a09896f
Merge pull request #32941 from code-dot-org/levelbuilder
deploy-code-org Jan 31, 2020
6325543
Merge pull request #32942 from code-dot-org/staging
deploy-code-org Jan 31, 2020
152436d
levelbuilder content changes (-ErinP)
deploy-code-org Jan 31, 2020
5a4f017
Merge pull request #32943 from code-dot-org/levelbuilder
Jan 31, 2020
07de1e1
Merge pull request #32944 from code-dot-org/staging
deploy-code-org Jan 31, 2020
bec5460
staging content changes (-robo-commit)
deploy-code-org Jan 31, 2020
9595c3d
Merge pull request #32945 from code-dot-org/staging
deploy-code-org Jan 31, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions 8 apps/src/applab/constants.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as utils from '../utils';
import {ICON_PREFIX, ICON_PREFIX_REGEX} from '../assetManagement/assetPrefix';
import {
ICON_PREFIX,
ICON_PREFIX_REGEX,
DATA_URL_PREFIX_REGEX
} from '../assetManagement/assetPrefix';

export {ICON_PREFIX, ICON_PREFIX_REGEX};
export {ICON_PREFIX, ICON_PREFIX_REGEX, DATA_URL_PREFIX_REGEX};
export const FOOTER_HEIGHT = 30;
export const APP_WIDTH = 320;
export const WIDGET_WIDTH = 600;
Expand Down
4 changes: 4 additions & 0 deletions 4 apps/src/applab/designMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export default designMode;
var ICON_PREFIX = applabConstants.ICON_PREFIX;
var ICON_PREFIX_REGEX = applabConstants.ICON_PREFIX_REGEX;

let DATA_PREFIX_REGEX = applabConstants.DATA_URL_PREFIX_REGEX;

var currentlyEditedElement = null;
var clipboardElement = null;
var clipboardElementTheme = null;
Expand Down Expand Up @@ -383,6 +385,8 @@ designMode.updateProperty = function(

if (ICON_PREFIX_REGEX.test(value)) {
element.src = assetPrefix.renderIconToString(value, element);
} else if (DATA_PREFIX_REGEX.test(value)) {
element.src = value;
} else {
element.src =
value === ''
Expand Down
8 changes: 8 additions & 0 deletions 8 apps/src/applab/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as elementUtils from './designElements/elementUtils';
import * as applabConstants from './constants';
import {assets as assetsApi} from '../clientApi';

let DATA_PREFIX_REGEX = applabConstants.DATA_URL_PREFIX_REGEX;

export const importableScreenShape = PropTypes.shape({
id: PropTypes.string.isRequired,
willReplace: PropTypes.bool.isRequired,
Expand Down Expand Up @@ -165,6 +167,12 @@ export function importScreensAndAssets(projectId, screens, assets) {
}

allAssetsToCopy = Object.keys(allAssetsToCopy);

// Remove data url assets as they are too long for our copy api
allAssetsToCopy = allAssetsToCopy.filter(
asset => !DATA_PREFIX_REGEX.test(asset)
);

if (allAssetsToCopy.length > 0) {
assetsApi.copyAssets(projectId, allAssetsToCopy, finishImporting, xhr => {
console.error('Failed to copy assets:', xhr);
Expand Down
2 changes: 2 additions & 0 deletions 2 apps/src/assetManagement/assetPrefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const ABSOLUTE_CDO_CURRICULUM_REGEXP = new RegExp(
'i'
);

export const DATA_URL_PREFIX_REGEX = new RegExp('^data:image');

export const ICON_PREFIX = 'icon://';
export const ICON_PREFIX_REGEX = new RegExp('^icon://');

Expand Down
2 changes: 1 addition & 1 deletion 2 bin/i18n/sync-down.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def sync_down
line.gsub!(/[\|\/\-\\][\b]/, '')

# skip lines detailing individual file extraction
next if line.start_with? "Extracting: "
next if line.start_with?("Extracting: ", "Building ")

puts line
end
Expand Down
17 changes: 17 additions & 0 deletions 17 dashboard/config/blocks/GamelabJr/gamelab_moveBackward.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"category": "Sprites",
"config": {
"func": "moveBackward",
"blockText": "move {SPRITE} {DISTANCE} pixels backward",
"args": [
{
"name": "SPRITE",
"type": "Sprite"
},
{
"name": "DISTANCE",
"type": "Number"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"category": "World",
"config": {
"color": [
240,
0.45,
0.65
],
"func": "updateTitleWithColor",
"blockText": "show title screen {BREAK} title {TITLE} color {COLOR}",
"args": [
{
"name": "BREAK",
"empty": true
},
{
"name": "TITLE"
},
{
"name": "COLOR",
"type": "Colour"
}
],
"inline": false
}
}
4 changes: 4 additions & 0 deletions 4 dashboard/config/libraries/NativeSpriteLab.interpreted.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
var extraArgs = null;
var other = [];

function draw() {
executeDrawLoopAndCallbacks();
for (var i = 0; i < other.length; i++) {
other[i]();
}
}

/* Legacy code only. Do not add any new code below here */
Expand Down
20 changes: 20 additions & 0 deletions 20 dashboard/config/libraries/ZSpriteLab3.interpreted.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var title = "";
var col = "black";
function draw2() {
console.log(World.frameCount);
fill(col);
textAlign(CENTER, CENTER);
textSize(50);
text(title, 0, 0, 400, 200);
}

function moveBackward(sprite, distance) {
moveForward(sprite, -1 * distance);
}

function updateTitleWithColor(t, c) {
title = t;
col = c;
}

other.push(draw2);
2 changes: 2 additions & 0 deletions 2 dashboard/config/scripts/csd_u6_test_algorithms_multi2.multi
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name 'CSD U6 test algorithms multi2'
editor_experiment ''
type 'multi2'
question 'A class wants to create a program that will display good morning to everyone. For example, the program will display “Good morning, Dwayne!”, “Good morning, Mari!” for each student. What TWO programming tools will be the most useful when writing this program?'
wrong 'event handlers'
right 'for loops and arrays'
Expand Down
2 changes: 2 additions & 0 deletions 2 dashboard/config/scripts/csd_u6_test_hardware_multi2.multi
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name 'CSD U6 test hardware multi2'
editor_experiment ''
type 'multi2'
question 'What TWO ANSWERS best describe the relationship between hardware (physical devices) and software (programs)?'
wrong 'Hardware must be physically controlled by a person, and software can be controlled with code.'
right 'Hardware allows software to interact with the physical world in many different ways.'
Expand Down
53 changes: 53 additions & 0 deletions 53 dashboard/config/scripts/levels/AnjaliMikeTest.level
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<GamelabJr>
<config><![CDATA[{
"game_id": 64,
"created_at": "2020-01-30T22:18:52.000Z",
"level_num": "custom",
"user_id": 886,
"properties": {
"encrypted": "false",
"skin": "gamelab",
"show_debug_watch": "true",
"block_pools": [
"GamelabJr"
],
"helper_libraries": [
"NativeSpriteLab",
"ZSpriteLab3"
],
"use_default_sprites": "true",
"hide_animation_mode": "true",
"show_type_hints": "true",
"hide_custom_blocks": true,
"all_animations_single_frame": "true",
"use_modal_function_editor": "true",
"embed": "false",
"instructions_important": "false",
"mini_rubric": "false",
"never_autoplay_video": "false",
"disable_param_editing": "true",
"disable_variable_editing": "false",
"disable_procedure_autopopulate": "false",
"top_level_procedure_autopopulate": "false",
"hide_share_and_remix": "false",
"disable_if_else_editing": "false",
"include_shared_functions": "false",
"free_play": "false",
"submittable": "false",
"expand_debugger": "false",
"debugger_disabled": "false",
"start_in_animation_tab": "false",
"pause_animations_by_default": "false",
"preload_asset_list": null,
"encrypted_examples": [

]
},
"published": true,
"notes": "",
"audit_log": "[{\"changed_at\":\"2020-01-30 22:19:26 +0000\",\"changed\":[\"notes\",\"show_debug_watch\",\"helper_libraries\",\"use_default_sprites\",\"hide_animation_mode\",\"show_type_hints\",\"all_animations_single_frame\",\"use_modal_function_editor\",\"preload_asset_list\"],\"changed_by_id\":886,\"changed_by_email\":\"anjali+labs@code.org\"},{\"changed_at\":\"2020-01-30 22:49:33 +0000\",\"changed\":[\"helper_libraries\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":886,\"changed_by_email\":\"anjali+labs@code.org\"}]",
"level_concept_difficulty": {
}
}]]></config>
<blocks/>
</GamelabJr>
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"expand_debugger": "false",
"parent_level_id": 16246,
"name_suffix": "_pilot",
"long_instructions": "# Create your Player\r\n\r\n<img src=\"https://images.code.org/8358b8d2eef2461e113e0b3093da7403-image-1476212944204.gif\" style=\"float:right\">\r\n\r\nNow you can create your player sprite. Just like the item sprites, the player sprite will fall from the top of the screen. Unlike the items, your player sprite will get faster as it falls, just like real falling objects. This is what allows it to jump up, and fall back down.\r\n\r\n# Do This\r\n\r\n* Use the `createSprite` block to make a player sprite with the label and starting position that you put on your worksheet.\r\n* Use `setAnimation` to give it the correct image.\r\n* Create a `playerFall` function that makes the sprite fall from the top of the screen. The code inside the function should use `velocityY` in a counter pattern, just as when you made the falling rock in [Lesson 17 Level 4](../../17/puzzle/4).\r\n* Call the `playerFall` function inside the draw loop.\r\n* Run the code to test your sprite.",
"long_instructions": "# Create your Player\r\n\r\n<img src=\"https://images.code.org/8358b8d2eef2461e113e0b3093da7403-image-1476212944204.gif\" style=\"float:right\">\r\n\r\nNow you can create your player sprite. Just like the item sprites, the player sprite will fall from the top of the screen. Unlike the items, your player sprite will get faster as it falls, just like real falling objects. This is what allows it to jump up, and fall back down.\r\n\r\n# Do This\r\n\r\n* Use the `createSprite` block to make a player sprite with the label and starting position that you put on your worksheet.\r\n* Use `setAnimation` to give it the correct image.\r\n* Create a `playerFall` function that makes the sprite fall from the top of the screen. The code inside the function should use `velocityY` in a counter pattern, just as when you made the falling rock in [Lesson 20 Level 4](../../20/puzzle/4).\r\n* Call the `playerFall` function inside the draw loop.\r\n* Run the code to test your sprite.",
"reference_links": [
"/docs/concepts/game-lab/velocity-and-the-counter-pattern/",
"/docs/concepts/game-lab/sprites/",
Expand All @@ -60,11 +60,14 @@
],
"mini_rubric": "false",
"encrypted": "false",
"preload_asset_list": null
"preload_asset_list": null,
"libraries_enabled": "false"
},
"published": true,
"notes": "",
"audit_log": "[{\"changed_at\":\"2017-06-04 13:55:04 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":285,\"changed_by_email\":\"harvey@pd.code.org\"},{\"changed_at\":\"2018-11-01 18:45:51 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2019-03-06 00:00:42 +0000\",\"changed\":[\"encrypted_examples\",\"preload_asset_list\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2019-05-03 19:10:13 +0000\",\"changed\":[\"encrypted_examples\",\"long_instructions\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"}]"
"audit_log": "[{\"changed_at\":\"2017-06-04 13:55:04 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":285,\"changed_by_email\":\"harvey@pd.code.org\"},{\"changed_at\":\"2018-11-01 18:45:51 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2019-03-06 00:00:42 +0000\",\"changed\":[\"encrypted_examples\",\"preload_asset_list\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2019-05-03 19:10:13 +0000\",\"changed\":[\"encrypted_examples\",\"long_instructions\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2020-01-31 18:59:36 +0000\",\"changed\":[\"encrypted_examples\",\"long_instructions\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"}]",
"level_concept_difficulty": {
}
}]]></config>
<blocks/>
</Gamelab>
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"top_level_procedure_autopopulate": "false",
"parent_level_id": 16247,
"name_suffix": "_pilot",
"long_instructions": "# User Controls\r\n\r\nNext, you should add user controls so that you can move your player around. Your player needs to move to the left when the left arrow key is pressed, to the right when the right arrow key is pressed, and jump when the space bar is pressed.\r\n\r\n# Do This\r\n\r\n* Create a new `controlPlayer` function in the \"functions\" area of your code.\r\n* Inside the `controlPlayer` function, use the `if`, `keyDown`, and `sprite.x` blocks to make your player move to the left and right according to the arrow keys. Look at <a href=\"../../12/puzzle/7\" target=\"_blank\"> Lesson 12 Puzzle 7 </a> for examples.\r\n* Inside the `controlPlayer` function, use the `if`, `keyDown`, and `velocityY` blocks to make your player jump when the up arrow is pressed. Look at <a href=\"../../15/puzzle/11\" target=\"_blank\"> Lesson 15 Puzzle 11 </a> for an example.\r\n* Call the `controlPlayer` function inside the draw loop.\r\n* Run the game and test your code.",
"long_instructions": "# User Controls\r\n\r\nNext, you should add user controls so that you can move your player around. Your player needs to move to the left when the left arrow key is pressed, to the right when the right arrow key is pressed, and jump when the space bar is pressed.\r\n\r\n# Do This\r\n\r\n* Create a new `controlPlayer` function in the \"functions\" area of your code.\r\n* Inside the `controlPlayer` function, use the `if`, `keyDown`, and `sprite.x` blocks to make your player move to the left and right according to the arrow keys. Look at <a href=\"../../15/puzzle/7\" target=\"_blank\"> Lesson 15 Puzzle 7 </a> for examples.\r\n* Inside the `controlPlayer` function, use the `if`, `keyDown`, and `velocityY` blocks to make your player jump when the up arrow is pressed. Look at <a href=\"../../18/puzzle/10\" target=\"_blank\"> Lesson 18 Puzzle 10 </a> for an example.\r\n* Call the `controlPlayer` function inside the draw loop.\r\n* Run the game and test your code.",
"reference_links": [
"/docs/concepts/game-lab/drawing-shapes/",
"/docs/concepts/game-lab/shapes-and-parameters/",
Expand All @@ -62,11 +62,14 @@
],
"mini_rubric": "false",
"encrypted": "false",
"preload_asset_list": null
"preload_asset_list": null,
"libraries_enabled": "false"
},
"published": true,
"notes": "",
"audit_log": "[{\"changed_at\":\"2017-06-06 17:41:55 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2017-06-06 17:44:11 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2018-01-02 22:57:39 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":1,\"changed_by_email\":\"josh@code.org\"},{\"changed_at\":\"2018-11-02 13:10:32 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":831,\"changed_by_email\":\"mike.harvey@code.org\"},{\"changed_at\":\"2019-03-06 00:02:42 +0000\",\"changed\":[\"encrypted_examples\",\"preload_asset_list\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2019-03-06 00:07:11 +0000\",\"changed\":[\"encrypted_examples\",\"preload_asset_list\",\"reference_links\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2019-05-03 19:11:18 +0000\",\"changed\":[\"encrypted_examples\",\"long_instructions\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"}]"
"audit_log": "[{\"changed_at\":\"2017-06-06 17:41:55 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2017-06-06 17:44:11 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2018-01-02 22:57:39 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":1,\"changed_by_email\":\"josh@code.org\"},{\"changed_at\":\"2018-11-02 13:10:32 +0000\",\"changed\":[\"markdown_instructions\",\"encrypted_examples\",\"contained_level_names\"],\"changed_by_id\":831,\"changed_by_email\":\"mike.harvey@code.org\"},{\"changed_at\":\"2019-03-06 00:02:42 +0000\",\"changed\":[\"encrypted_examples\",\"preload_asset_list\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2019-03-06 00:07:11 +0000\",\"changed\":[\"encrypted_examples\",\"preload_asset_list\",\"reference_links\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2019-05-03 19:11:18 +0000\",\"changed\":[\"encrypted_examples\",\"long_instructions\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"},{\"changed_at\":\"2020-01-31 19:02:04 +0000\",\"changed\":[\"encrypted_examples\",\"long_instructions\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":324,\"changed_by_email\":\"elizabeth@code.org\"}]",
"level_concept_difficulty": {
}
}]]></config>
<blocks/>
</Gamelab>
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.