Skip to content

Commit

Permalink
Merge pull request #42319 from code-dot-org/dtp_candidate_cebd3e42
Browse files Browse the repository at this point in the history
DTP (Test > Production: cebd3e4)
  • Loading branch information
tim-dot-org committed Sep 2, 2021
2 parents 6b57be2 + f9afb0a commit 2c0936a
Show file tree
Hide file tree
Showing 77 changed files with 7,710 additions and 2,701 deletions.
29 changes: 29 additions & 0 deletions dashboard/app/controllers/admin_users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,35 @@ def delete_progress_form
count
end

def delete_progress
params.require([:user_id, :script_id, :reason])

user_id = params[:user_id]
script_id = params[:script_id]
user_storage_id = storage_id_for_user_id(user_id)

FirehoseClient.instance.put_record(
:analysis,
{
study: 'reset-progress',
event: 'admin-delete-progress',
user_id: user_id,
script_id: script_id,
data_json: {
signed_in_user: current_user.username,
reason: params[:reason]
}.to_json
}
)

UserScript.where(user_id: user_id, script_id: script_id).destroy_all
UserLevel.where(user_id: user_id, script_id: script_id).destroy_all
ChannelToken.where(storage_id: user_storage_id, script_id: script_id).destroy_all unless user_storage_id.nil?
TeacherFeedback.where(student_id: user_id, script_id: script_id).destroy_all

redirect_to user_progress_form_path({user_identifier: user_id}), notice: "Progress deleted."
end

# get /admin/permissions
def permissions_form
search_term = params[:search_term]
Expand Down
2 changes: 2 additions & 0 deletions dashboard/app/models/channel_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#

class ChannelToken < ApplicationRecord
acts_as_paranoid # Use deleted_at column instead of deleting rows.

belongs_to :user
belongs_to :level

Expand Down
2 changes: 1 addition & 1 deletion dashboard/app/models/sections/section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def add_student(student, added_by = nil)
# added_by is passed only from the sections_students_controller, used by teachers to
# manager their rosters.
unless added_by&.id == user_id || (LOGIN_TYPES_OAUTH.include? login_type)
return ADD_STUDENT_RESTRICTED if restrict_section == TRUE && (!follower || follower.deleted?)
return ADD_STUDENT_RESTRICTED if restrict_section == true && (!follower || follower.deleted?)
end

# Unless the sections login type is Google or Clever
Expand Down
2 changes: 2 additions & 0 deletions dashboard/app/models/user_level.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
class UserLevel < ApplicationRecord
AUTOLOCK_PERIOD = 1.day

acts_as_paranoid # Use deleted_at column instead of deleting rows.

belongs_to :user
belongs_to :level
belongs_to :script
Expand Down
2 changes: 2 additions & 0 deletions dashboard/app/models/user_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
class UserScript < ApplicationRecord
include SerializedProperties

acts_as_paranoid # Use deleted_at column instead of deleting rows.

belongs_to :user
belongs_to :script

Expand Down
3 changes: 3 additions & 0 deletions dashboard/config/blocks/GamelabJr/gamelab_playSoundOptions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function playSoundOptions(choice){
playSound(choice);
}
35 changes: 35 additions & 0 deletions dashboard/config/blocks/GamelabJr/gamelab_playSoundOptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"category": "World",
"config": {
"func": "playSoundOptions",
"docFunc": "gamelab_playSoundOptions",
"blockText": "play sound {SOUND}",
"args": [
{
"name": "SOUND",
"options": [
[
"accent",
"'sound://category_accent/puzzle_game_accent_a_01.mp3'"
],
[
"boing",
"'sound://category_digital/boing_2.mp3'"
],
[
"button",
"'sound://category_app/app_button_1.mp3'"
],
[
"crunch",
"'sound://category_collect/clicky_crunch.mp3'"
],
[
"swing",
"'sound://category_swish/quick_swing.mp3'"
]
]
}
]
}
}
36 changes: 32 additions & 4 deletions dashboard/config/locales/scripts.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22614,8 +22614,8 @@ en:
description_teacher: Students explore the use of casting and truncation to help the owner of the Project Mercury Pastries Food Truck round their prices to whole dollar numbers. Students apply casting and rounding techniques to generate random numbers using `Math.random()` within specific ranges.
lesson-5:
name: Comparing Values to Make Decisions
description_student: 'Today is all about using code to make decisions. You compare relationships between values while using conditional statements to help the `Painter` make decisions. '
description_teacher: 'Students use relational operators to write and evaluate expressions. Students expand their use of `if` statements to compare values stored in variables and array elements. '
description_student: 'In The Neighborhood, you have used Boolean methods to help the `Painter` make decisions about navigating and painting. In this lesson, you learn to use relational operators to write Boolean expressions and use these with `if` statements to expand the conditions you can check while navigating and painting in The Neighborhood. '
description_teacher: Students use relational operators to write and evaluate Boolean expressions. Students then use these relational operators to expand the conditions they can check with `if` statements. Students revisit The Neighborhood to practice writing expressions with relational operators in `if` statements to navigate and paint under specific conditions.
lesson-6:
name: Adding Randomness to a Program
description_student: One of the most common use cases for generating random numbers are games of chance like rolling dice, shuffling playing cards, and flipping a coin. Games often use random numbers to generate different outcomes. Today, you add randomization to the Pop the Balloon game by adding a dice rolling feature.
Expand Down Expand Up @@ -25869,7 +25869,9 @@ en:
description_student:
description_teacher: "- Use setProperty() to change elements on the screen\n - Focus on colors and x/y positions using random numbers\n- Use setText() to change text on screen \n- NO circuit playground; NO if statements; NO variables"
lesson-5:
name: Unplugged Board Inputs?
name: Sensors
description_student:
description_teacher:
lesson-6:
name: Board Inputs (Button Toggle)
description_student:
Expand Down Expand Up @@ -25927,7 +25929,33 @@ en:
name: 'Project: Maker'
description_student:
description_teacher:
lesson_groups: {}
lesson-13:
name: Accelerometer
description_student:
description_teacher:
lesson-14:
name: Music + Arrays
description_student:
description_teacher:
lesson-15:
name: 'Mini Project: Sensors'
lesson-17:
name: Physical Outputs (LEDs)
description_student:
description_teacher:
lesson-16:
name: Physical Inputs
lesson-18:
name: Prototyping
lesson-19:
name: Project
lesson_groups:
lessonGroup-3:
display_name: Content
lessonGroup-2:
display_name: Content
lessonGroup-4:
display_name: Content
name: csdu6-playground
title: CSD Unit 6 Playground
description_audience: ''
Expand Down
12 changes: 12 additions & 0 deletions dashboard/config/scripts/csa_u4l4_l3.match
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name 'CSA U4L4-L3'
title 'Check for Understanding'
description 'Match each term to its correct definition.'
height 'auto'
question 'cast'
answer 'to assign a value of one type to another'
question 'relational operator'
answer 'used to compare numeric values or arithmetic expressions'
question 'truncate'
answer 'remove everything to the right of the decimal point'
question 'static method'
answer 'a method that is called by the class instead of by an instance of the class'
26 changes: 26 additions & 0 deletions dashboard/config/scripts/csa_u4l4_l5.multi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name 'CSA U4L4-L5'
title 'Check for Understanding'
description 'What is printed as a result of the execution of the code segment?'

right 'x = 5 y = -1'
wrong 'x = 1 y = 1'
wrong 'x = 3 y = 2'
wrong 'x = -1 y = -1'
wrong 'x = 4 y = 3'

markdown <<MARKDOWN
```
int x = 3;
int y = -1;

if (x - 2 > y) {
x = x - y;
}

if (y + 3 >= x) {
y = y + x;
}

System.out.print("x = " + x + " y = " + y);
```
MARKDOWN
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name 'CSD U6 - Accelerometer - Chal_2022'
display_name 'Challenge Levels'

sublevels
level 'CSD U6 - Accelerometer - CA_2022'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name 'CSD U6 - Accelerometer - Prac_2022'
display_name 'Practice Levels'

sublevels
level 'CSD U6 - Accelerometer - PA_2022'
5 changes: 5 additions & 0 deletions dashboard/config/scripts/csd_u6_music_chal_2022.bubble_choice
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name 'CSD U6 - Music - Chal_2022'
display_name 'Challenge Levels'

sublevels
level 'CSD U6 - Music - CA_2022'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name 'CSD U6 - Sensors - Chal_2022'
display_name 'Challenge Levels'

sublevels
level 'CSD U6 - Sensors - CA_2022'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name 'CSD U6 - Sensors - Prac_2022'
display_name 'Practice Levels'

sublevels
level 'CSD U6 - Sensors - PA_2022'
21 changes: 21 additions & 0 deletions dashboard/config/scripts/levels/CSA Music Video Demo.level
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Javalab>
<config><![CDATA[{
"properties": {
"encrypted": "false",
"encrypted_examples": [

],
"long_instructions": "Demo for Unit 7 in The Theater",
"mini_rubric": "false",
"submittable": "false",
"hide_share_and_remix": "false",
"csa_view_mode": "theater"
},
"game_id": 68,
"published": true,
"created_at": "2021-09-02T18:30:59.000Z",
"level_num": "custom",
"user_id": 9271,
"audit_log": "[{\"changed_at\":\"2021-09-02 18:31:02 +0000\",\"changed\":[\"encrypted_examples\"],\"changed_by_id\":9271,\"changed_by_email\":\"jamila@code.org\"}]"
}]]></config>
</Javalab>
66 changes: 66 additions & 0 deletions dashboard/config/scripts/levels/CSA Pop the Balloons Demo.level
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<Javalab>
<config><![CDATA[{
"properties": {
"encrypted": "false",
"long_instructions": "Demo for The Playground",
"mini_rubric": "false",
"submittable": "false",
"hide_share_and_remix": "false",
"csa_view_mode": "playground",
"start_sources": {
"MyPlayground.java": {
"text": "public class MyPlayground {\n public static void main(String[] args) {\n\n\tPopBalloonsGame.play();\n \n }\n}",
"isVisible": true
},
"PopBalloonsGame.java": {
"text": "public final class PopBalloonsGame {\n\n\n \n}",
"isVisible": true
},
"PopBalloonsDisplay.java": {
"text": "public final class PopBalloonsDisplay {\n\n\n\n}",
"isVisible": true
},
"Balloons.java": {
"text": "public class Balloons extends ClickableImage {\n\n\n\n}",
"isVisible": true
},
"RollButton.java": {
"text": "public class RollButton extends ClickableImage {\n\n\n \n}",
"isVisible": true
}
},
"starter_assets": {
"balloon1.png": "8fbf1645-88a4-4203-92d0-286e38dbd024.png",
"balloon2.png": "f3de569b-b655-42f7-af5d-bd023196aa1f.png",
"balloon3.png": "8f734973-bb37-4343-ba15-fa4896792fa2.png",
"balloon4.png": "988ad003-ddbd-4f46-9c7d-550f84fdf03d.png",
"balloon5.png": "c21fcb7e-cd65-4824-af0f-cbc08c29fb2b.png",
"balloon6.png": "1112f474-2d1b-4c1f-be1f-47bae4ded515.png",
"balloon7.png": "b52afc09-3214-4db5-a1c5-4f0e7c64d5d8.png",
"balloon8.png": "b97bbff0-1ca9-4e72-8800-b1d7b1536847.png",
"balloon9.png": "5c0bd1eb-14c1-438e-8166-181ac321cdab.png",
"balloon10.png": "afb1aa3f-61d9-44dd-9622-9243300457ff.png",
"dice1.png": "794a8326-14cf-428b-a40f-2f3374b81973.png",
"dice2.png": "411a2fee-95c1-4f94-9d12-19fba3e77e90.png",
"dice3.png": "b112c0ea-7854-4395-9ec7-6310bf4aacb4.png",
"dice4.png": "8311d244-3d63-4772-9699-84fbfd9e4fd7.png",
"dice5.png": "b257c183-52e4-4a17-ad24-b499f573e69e.png",
"dice6.png": "9de4f09c-f2a9-4ec3-9b51-f980a21b7c72.png",
"poppedBlue.png": "f637f11f-ebf4-4396-a2c1-e900ff258cb1.png",
"poppedGreen.png": "2d349bdf-1735-4802-93b4-795b0cf9af7f.png",
"poppedOrange.png": "43cf60ed-6a6b-416b-b271-4f0136584573.png",
"poppedPurple.png": "209e7e76-cba3-4e77-976a-a2344c3991db.png",
"poppedTeal.png": "3ffe1fb8-4fa9-4927-88dd-ed96ed70d6db.png",
"rollButton.png": "60c949b5-c889-4709-8791-0bfd6187149f.png",
"pop.wav": "ef2d56e2-a98b-476b-bd11-e13a8a807141.wav",
"diceRoll.wav": "6733d30a-a6a4-4520-93e1-223172888723.wav"
}
},
"game_id": 68,
"created_at": "2021-09-02T18:04:34.000Z",
"level_num": "custom",
"user_id": 9271,
"published": true,
"audit_log": "[{\"changed_at\":\"2021-09-02 18:04:38 +0000\",\"changed\":[\"encrypted_examples\"],\"changed_by_id\":9271,\"changed_by_email\":\"jamila@code.org\"},{\"changed_at\":\"2021-09-02 18:13:04 +0000\",\"changed\":[],\"changed_by_id\":9271,\"changed_by_email\":\"jamila@code.org\"},{\"changed_at\":\"2021-09-02 18:14:43 +0000\",\"changed\":[\"start_sources\"],\"changed_by_id\":9271,\"changed_by_email\":\"jamila@code.org\"},{\"changed_at\":\"2021-09-02 18:29:42 +0000\",\"changed\":[],\"changed_by_id\":9271,\"changed_by_email\":\"jamila@code.org\"}]"
}]]></config>
</Javalab>
21 changes: 21 additions & 0 deletions dashboard/config/scripts/levels/CSA U4L4-L1.level
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Javalab>
<config><![CDATA[{
"properties": {
"encrypted": "false",
"encrypted_examples": [

],
"long_instructions": "exploring operators activity",
"mini_rubric": "false",
"submittable": "false",
"hide_share_and_remix": "false",
"csa_view_mode": "console"
},
"game_id": 68,
"published": true,
"created_at": "2021-09-02T14:49:41.000Z",
"level_num": "custom",
"user_id": 9271,
"audit_log": "[{\"changed_at\":\"2021-09-02 14:50:04 +0000\",\"changed\":[\"encrypted_examples\"],\"changed_by_id\":9271,\"changed_by_email\":\"jamila@code.org\"}]"
}]]></config>
</Javalab>

0 comments on commit 2c0936a

Please sign in to comment.