Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit 58ab7a9

Browse files
author
clareconstantine
authored
Merge pull request code-dot-org#36598 from code-dot-org/dtp_candidate_3e835249
DTP (Test > Production: 3e83524)
2 parents b7d64a9 + 3e83524 commit 58ab7a9

30 files changed

+153
-69
lines changed

apps/src/lib/script-editor/ScriptEditor.jsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export default class ScriptEditor extends React.Component {
7979
versionYearOptions: PropTypes.arrayOf(PropTypes.string).isRequired,
8080
isLevelbuilder: PropTypes.bool,
8181
tts: PropTypes.bool,
82-
hasCourse: PropTypes.bool
82+
hasCourse: PropTypes.bool,
83+
isCourse: PropTypes.bool
8384
};
8485

8586
constructor(props) {
@@ -394,6 +395,22 @@ export default class ScriptEditor extends React.Component {
394395
visible={!this.props.hidden}
395396
pilotExperiment={this.props.pilotExperiment}
396397
/>
398+
<label>
399+
Is a Standalone Course
400+
<input
401+
name="is_course"
402+
type="checkbox"
403+
defaultChecked={this.props.isCourse}
404+
style={styles.checkbox}
405+
/>
406+
<HelpTip>
407+
<p>
408+
(Still in development) If checked, indicates that this Unit
409+
represents a standalone course. Examples of such Units include
410+
CourseA-F, Express, and Pre-Express.
411+
</p>
412+
</HelpTip>
413+
</label>
397414
</div>
398415
)}
399416

apps/src/sites/studio/pages/scripts/edit.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ export default function initPage(scriptEditorData) {
9595
versionYearOptions={scriptEditorData.version_year_options}
9696
isLevelbuilder={scriptEditorData.is_levelbuilder}
9797
tts={scriptData.tts}
98+
/* isCourse controls whether this Script/Unit is intended to be the root of a CourseOffering version.
99+
* hasCourse indicates whether this Script/Unit is part of a UnitGroup. These two in theory should be
100+
* complements, but currently (August 2020) they are not, so they are separate fields for now. */
101+
isCourse={scriptData.is_course}
98102
hasCourse={scriptEditorData.has_course}
99103
/>
100104
</Provider>,

apps/test/unit/lib/script-editor/ScriptEditorTest.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ describe('ScriptEditor', () => {
2323
describe('Script Editor', () => {
2424
it('has the correct number of each editor field type', () => {
2525
const wrapper = mount(<ScriptEditor {...DEFAULT_PROPS} hidden={false} />);
26-
expect(wrapper.find('input').length).to.equal(22);
27-
expect(wrapper.find('input[type="checkbox"]').length).to.equal(10);
26+
expect(wrapper.find('input').length).to.equal(23);
27+
expect(wrapper.find('input[type="checkbox"]').length).to.equal(11);
2828
expect(wrapper.find('textarea').length).to.equal(2);
2929
expect(wrapper.find('select').length).to.equal(5);
3030
});

dashboard/app/controllers/scripts_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def general_params
195195
:has_lesson_plan,
196196
:tts,
197197
:is_stable,
198+
:is_course,
198199
:script_announcements,
199200
:pilot_experiment,
200201
:editor_experiment,

dashboard/app/models/script.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def generate_plc_objects
122122
end
123123
end
124124

125+
# is_course - true if this Script/Unit is intended to be the root of a CourseOffering version. Used during seeding
126+
# to create the appropriate CourseVersion and CourseOffering objects. For example, this should be true for
127+
# CourseA-CourseF .script files.
125128
serialized_attrs %w(
126129
hideable_lessons
127130
peer_reviews_to_complete
@@ -1243,6 +1246,7 @@ def summarize(include_lessons = true, user = nil, include_bonus_levels = false)
12431246
assigned_section_id: assigned_section_id,
12441247
hasStandards: has_standards_associations?,
12451248
tts: tts?,
1249+
is_course: is_course?
12461250
}
12471251

12481252
#TODO: lessons should be summarized through lesson groups in the future

dashboard/config/blocks/GamelabJr/gamelab_makeNumSprites.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"category": "Sprites",
33
"config": {
44
"func": "makeNumSprites",
5-
"inline": false,
5+
"inline": true,
66
"blockText": "make {NUM} new {ANIMATION_NAME} sprites",
77
"color": [
88
355,
@@ -12,8 +12,7 @@
1212
"args": [
1313
{
1414
"name": "NUM",
15-
"type": "Number",
16-
"field": true
15+
"type": "Number"
1716
},
1817
{
1918
"name": "ANIMATION_NAME",
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name 'courseC_multi_maze_debugging8_predict1_2018_2019_2020'
2-
question 'Look closely at the code below. What is the first bug that will make this program fail?'
3-
wrong 'The program won\'t fail. Scrat will get to the acorn.', feedback: 'Incorrect. Scrat goes the wrong way after his final turn.'
4-
right 'Scrat will go the wrong way after his final turn.', feedback: 'Correct!'
5-
wrong 'Scrat takes one too few steps and ends up short of the acorn.', feedback: 'Incorrect. Taking one too few steps happens after Scrat turns the wrong way.'
6-
wrong 'I don\'t know.', feedback: 'The first error is that Scrat goes the wrong way after his final turn. '
2+
question 'Look for bugs in this code. Will Scrat reach the acorn or is there a problem?'
3+
wrong 'Scrat will reach the acorn. There are no bugs in the code.', feedback: 'Incorrect. First, Scrat turns the wrong direction, then Scrat doesn\'t move forward enough times to reach the acorn.'
4+
right 'Scrat will not reach the acorn because he turns the wrong way.', feedback: 'Correct! First, Scrat turns the wrong direction, then Scrat doesn\'t move forward enough times to reach the acorn.'
5+
right 'Scrat will not reach the acorn because there are not enough `move forward` blocks.', feedback: 'Correct! First, Scrat turns the wrong direction, then Scrat doesn\'t move forward enough times to reach the acorn.'
6+
wrong 'I don\'t know.', feedback: 'There are two bugs in this code. First, Scrat turns the wrong direction, then Scrat doesn\'t move forward enough times to reach the acorn.'
7+
8+
markdown <<MARKDOWN
9+
10+
MARKDOWN
11+
12+
teacher_markdown <<MARKDOWN
13+
14+
MARKDOWN

dashboard/config/scripts/csp_20_21_u4_assess_conditionals_pick_1.multi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ editor_experiment ''
44

55

66

7-
wrong '![](https://images.code.org/ee9cda3b7b0a4b992e6d085ca15191b4-image-1552686189426.42.47 PM.png)'
8-
wrong '![](https://images.code.org/365cfe7314133bb8f99a4075df41a2a0-image-1552685852116.36.58 PM.png)'
9-
right '![](https://images.code.org/a9a6fab0bde8929dc19b22b2a6613685-image-1574868753247.30.49 AM.png)'
10-
wrong '![](https://images.code.org/4736267db8711822944b7ccc6c9000f3-image-1552686069909.40.42 PM.png)'
7+
wrong '![](https://images.code.org/f55c7fd58d43e01cc5fc42a6768692ca-image-1599153877135.png)'
8+
wrong '![](https://images.code.org/6452795e8f284a62541d154a9c2274fd-image-1599153890602.png)'
9+
right '![](https://images.code.org/f6e473e3e008d4a71dfc869aa9e85045-image-1599153902795.png)'
10+
wrong '![](https://images.code.org/c5368a3e09d6be80cf04cbf9133ed291-image-1599153912758.png)'
1111

1212
markdown <<MARKDOWN
1313
A movie theater charges different ticket prices based on a customer's age. The prices are shown in the table below.
@@ -20,3 +20,7 @@ A movie theater charges different ticket prices based on a customer's age. The p
2020

2121
The customer's age is stored in the variable `age` and the price is stored in the variable `price`. Which piece of code will correctly decide the price for each ticket.
2222
MARKDOWN
23+
24+
teacher_markdown <<MARKDOWN
25+
26+
MARKDOWN

dashboard/config/scripts/levels/U3 Program Investigate Event-Driven 1.level

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"code_functions": {
1010
"console.log": null,
1111
"setProperty": null,
12-
"onEvent": null
12+
"onEvent": null,
13+
"comment": null
1314
},
1415
"embed": "false",
1516
"instructions_important": "false",
@@ -42,11 +43,13 @@
4243
"preload_asset_list": null,
4344
"encrypted_examples": [
4445

45-
]
46+
],
47+
"widget_mode": "false",
48+
"libraries_enabled": "false"
4649
},
4750
"published": true,
4851
"notes": "",
49-
"audit_log": "[{\"changed_at\":\"2019-02-07 17:50:22 +0000\",\"changed\":[\"notes\",\"code_functions\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-02-07 17:51:56 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\",\"encrypted_examples\",\"start_blocks\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-02-07 17:52:57 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\",\"encrypted_examples\",\"slider_speed\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-02-07 17:57:12 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\",\"encrypted_examples\",\"expand_debugger\",\"contained_level_names\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-02-11 17:20:56 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"start_blocks\",\"watchers_prepopulated\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-02-11 17:21:29 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"preload_asset_list\",\"encrypted_examples\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 21:32:11 +0000\",\"changed\":[\"code_functions\",\"start_blocks\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 21:37:37 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"preload_asset_list\",\"encrypted_examples\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 21:38:26 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"preload_asset_list\",\"encrypted_examples\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 21:39:14 +0000\",\"changed\":[\"code_functions\",\"hide_design_mode\",\"show_debug_watch\",\"watchers_prepopulated\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 21:57:59 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"preload_asset_list\",\"encrypted_examples\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 22:34:55 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-26 18:49:36 +0000\",\"changed\":[\"start_blocks\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-26 18:54:19 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"start_blocks\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-26 18:57:47 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-26 18:58:53 +0000\",\"changed\":[\"start_blocks\",\"start_html\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-26 19:02:09 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"start_blocks\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-27 20:48:10 +0000\",\"changed\":[\"start_blocks\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-27 20:48:19 +0000\",\"changed\":[\"code_functions\",\"start_blocks\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"}]",
52+
"audit_log": "[{\"changed_at\":\"2019-02-07 17:50:22 +0000\",\"changed\":[\"notes\",\"code_functions\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-02-07 17:51:56 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\",\"encrypted_examples\",\"start_blocks\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-02-07 17:52:57 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\",\"encrypted_examples\",\"slider_speed\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-02-07 17:57:12 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\",\"encrypted_examples\",\"expand_debugger\",\"contained_level_names\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-02-11 17:20:56 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"start_blocks\",\"watchers_prepopulated\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-02-11 17:21:29 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"preload_asset_list\",\"encrypted_examples\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 21:32:11 +0000\",\"changed\":[\"code_functions\",\"start_blocks\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 21:37:37 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"preload_asset_list\",\"encrypted_examples\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 21:38:26 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"preload_asset_list\",\"encrypted_examples\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 21:39:14 +0000\",\"changed\":[\"code_functions\",\"hide_design_mode\",\"show_debug_watch\",\"watchers_prepopulated\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 21:57:59 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"preload_asset_list\",\"encrypted_examples\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-21 22:34:55 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-26 18:49:36 +0000\",\"changed\":[\"start_blocks\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-26 18:54:19 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"start_blocks\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-26 18:57:47 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-26 18:58:53 +0000\",\"changed\":[\"start_blocks\",\"start_html\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-26 19:02:09 +0000\",\"changed\":[\"code_functions\",\"long_instructions\",\"start_blocks\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-27 20:48:10 +0000\",\"changed\":[\"start_blocks\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2019-06-27 20:48:19 +0000\",\"changed\":[\"code_functions\",\"start_blocks\",\"preload_asset_list\"],\"changed_by_id\":106,\"changed_by_email\":\"gtwrobel@gmail.com\"},{\"changed_at\":\"2020-09-03 17:08:04 +0000\",\"changed\":[\"code_functions\",\"preload_asset_list\",\"contained_level_names\"],\"changed_by_id\":832,\"changed_by_email\":\"hannah@code.org\"}]",
5053
"level_concept_difficulty": {
5154
}
5255
}]]></config>

0 commit comments

Comments
 (0)