Skip to content

Commit

Permalink
Merge pull request #36527 from code-dot-org/dtp_candidate_821920e5
Browse files Browse the repository at this point in the history
DTP (Test > Production: 821920e)
  • Loading branch information
jmkulwik committed Aug 31, 2020
2 parents c8f4469 + 7bf130e commit cbf6d4f
Show file tree
Hide file tree
Showing 44 changed files with 905 additions and 212 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/bin/bash

DB_USER=${DB_USER?Required}
DB_PASSWORD=${DB_PASSWORD?Required}
DB_MASTER_HOST=${DB_MASTER_HOST?Required}

# Options reference: https://github.com/github/gh-ost/blob/master/go/cmd/gh-ost/main.go
args=(
# MySQL user
--user=${DB_USER}

# MySQL password
--password=${DB_PASSWORD}

# We don't have a reporting replica anymore, so carry out all operations on primary database
--allow-on-master

# MySQL hostname (preferably a replica, not the master)
--host=${DB_MASTER_HOST}

# (optional) explicitly tell gh-ost the identity of the master.
# Format: some.host.com[:port]
# This is useful in master-master setups where you wish to pick an explicit master,
# or in a tungsten-replicator where gh-ost is unable to determine the master
--assume-master-host=${DB_MASTER_HOST}

# while this file exists, migration will postpone the final stage of swapping tables,
# and will keep on syncing the ghost table.
# Cut-over/swapping would be ready to perform the moment the file is deleted.
--postpone-cut-over-flag-file=/tmp/gh-ost.cutover

# directory where hook files are found (default: empty, ie. hooks disabled).
# Hook files found on this path, and conforming to hook naming conventions will be executed
--hooks-path=${PWD}

# database name (mandatory)
--database="dashboard_production"

# table name (mandatory)
--table="user_levels"

# verbose
--verbose

# alter statement (mandatory)
--alter="ADD time_spent int"

# Drop a possibly existing Ghost table (remains from a previous run?) before beginning operation.
# Default is to panic and abort if such table exists
# --initially-drop-ghost-table

# Drop a possibly existing OLD table (remains from a previous run?) before beginning operation.
# Default is to panic and abort if such table exists
# --initially-drop-old-table

# Comma delimited status-name=threshold.
# e.g: 'Threads_running=100,Threads_connected=500'.
# When status exceeds threshold, app throttles writes
--max-load=Threads_running=30

# set to 'true' when you know for certain your server uses 'ROW' binlog_format.
# gh-ost is unable to tell, even after reading binlog_format, whether the replication process does indeed use 'ROW',
# and restarts replication to be certain RBR setting is applied.
# Such operation requires SUPER privileges which you might not have.
# Setting this flag avoids restarting replication and you can proceed to use gh-ost without SUPER privileges
--assume-rbr

# amount of rows to handle in each iteration (allowed range: 100-100,000)
--chunk-size=1000

# batch size for DML events to apply in a single transaction (range 1-100)
--dml-batch-size=100

# Default number of retries for various operations before panicking
--default-retries=1000

# choose cut-over type (default|atomic, two-step)
--cut-over=default

# actually count table rows as opposed to estimate them (results in more accurate progress estimation)
--exact-rowcount

# (with --exact-rowcount)
# when true (default): count rows after row-copy begins, concurrently, and adjust row estimate later on;
# when false: first count rows, then start row copy
--concurrent-rowcount

# when this file is created, gh-ost will immediately terminate, without cleanup
--panic-flag-file=/tmp/gh-ost.panic.flag

# actually execute the alter & migrate the table. Default is noop: do some tests and exit
# --execute
)

./gh-ost "${args[@]}"
3 changes: 2 additions & 1 deletion dashboard/app/controllers/activities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class ActivitiesController < ApplicationController
protect_from_forgery except: :milestone

MAX_INT_MILESTONE = 2_147_483_647
MAX_INT_TIME_SPENT = 3600

MIN_LINES_OF_CODE = 0
MAX_LINES_OF_CODE = 1000
Expand Down Expand Up @@ -179,7 +180,7 @@ def track_progress_for_user
end
if @script_level
# convert milliseconds to seconds
time_since_last_milestone = [(params[:timeSinceLastMilestone].to_f / 1000).ceil.to_i, MAX_INT_MILESTONE].min
time_since_last_milestone = [(params[:timeSinceLastMilestone].to_f / 1000).ceil.to_i, MAX_INT_TIME_SPENT].min
@user_level, @new_level_completed = User.track_level_progress(
user_id: current_user.id,
level_id: @level.id,
Expand Down
5 changes: 3 additions & 2 deletions dashboard/app/helpers/levels_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,9 @@ def set_tts_options(level_options, app_options)
end

def set_hint_prompt_options(level_options)
if @script && @script.hint_prompt_enabled?
level_options[:hintPromptAttemptsThreshold] = @level.hint_prompt_attempts_threshold
default_hint_prompt_attempts_threshold = 6.5
if @script&.hint_prompt_enabled?
level_options[:hintPromptAttemptsThreshold] = @level.hint_prompt_attempts_threshold || default_hint_prompt_attempts_threshold
end
end

Expand Down
6 changes: 1 addition & 5 deletions dashboard/app/models/script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -810,11 +810,7 @@ def tts_update
end

def hint_prompt_enabled?
[
Script::COURSE2_NAME,
Script::COURSE3_NAME,
Script::COURSE4_NAME
].include?(name)
csf?
end

def hide_solutions?
Expand Down
2 changes: 1 addition & 1 deletion dashboard/config/locales/blocks.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ en:
gamelab_hideTitleScreen:
text: hide title screen
gamelab_isKeyPressed:
text: is {KEY} pressed
text: "{KEY} is pressed"
options:
KEY:
'"up"': up
Expand Down
4 changes: 2 additions & 2 deletions dashboard/config/scripts/csp_asynch3_feedback_in_ci.external
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ To do this we should provide feedback that is **public** (not just to the indivi
Let’s break down why each of those aspects of the feedback is important:

* **Public:** Feedback can change students’ expectations of themselves, but also other students’ expectations of them. Being public also communicates your expectations and values in the classroom.
* **Specific:** You want to communicate the things you value, being specific will help students understand what actions you want them to repeat. “That’s a great idea!” doesn’t explain what was great about the idea.
* **Specific:** You want to communicate your values when it comes to the learning process and the learning community. Being specific will help students understand what actions you want them to repeat. “That’s a great idea!” doesn’t explain what was great about the idea.
* **Intellectual:** Giving feedback to a student about how they are nice, friendly, cooperative, etc. is useful, but it doesn’t change their conception of themselves as computer science students. If we’re going to change what it means to be “smart” in computer science, we have to highlight how actions helped move learning forward.

Note: These qualities come from the work done by the <a href="https://www.mathagency.org/status-mindset-resources" target="blank">MIAC Network</a> and researchers working with <a href="https://complexinstruction.stanford.edu/" target="blank">Complex Instruction</a>. This has been adapted for computer science classrooms in this module.

## Are you ready to try it out?!
## Are you ready to try it out?
In the next level, you will have a chance to think about how you can put your academic-status-influencing skills to use!

MARKDOWN
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ markdown <<MARKDOWN

## Context

You have seen parts of each of the highlighted lessons below in Unit 5. In module 3, you looked at U5L1 in your asynchronous work and then saw U5L2 in the synchronous workshop in a “model lesson” format. Earlier in the module you also looked at lessons 3 or 4 from this unit.
You have seen parts of each of the highlighted lessons below in Unit 5. In Module 3, you looked at U5L1 in your asynchronous work and then saw U5L2 in the synchronous workshop in a “model lesson” format. Earlier in the module you also looked at Lessons 3 or 4 from this unit.

In this set of asynchronous work, you have also seen parts of U5L5 and U5L9 which introduced you to the mental models for loops and traversals. We are now going to spend some time digging into U5L10 which follows the last lesson you looked at - U5L9 - Traversals Explore.

Expand Down
4 changes: 2 additions & 2 deletions dashboard/config/scripts/csp_module_1_wrap_up.external
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ markdown <<MARKDOWN

## Next Steps

1. Return to your cohort's shared slide deck for Module 1. You can access this through your Digital Digest.
1. Return to your cohort's shared slide deck for Module 1.
2. Add any questions that came up for you while completing this asynchronous work to the "Questions from Asynchronous Work" slide. As you are adding your questions, read through the questions that are already there. If you have answers or ideas to any of the questions add them to the "Answer" column.
3. Answer the reflection question on the "Group Reflection" slide. Facilitators will read these reflections and use them to help shape your next workshop together. Participants will also be able to see what you write in this section too.
4. Take the pre-survey for the Module 1 Workshop.
5. Join us for the Module 1 Synchronous Workshop. The date and time of the next call can be found in the Digital Digest.
5. Join us for the Module 1 Synchronous Workshop.
MARKDOWN
4 changes: 2 additions & 2 deletions dashboard/config/scripts/csp_module_2_wrap_up.external
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ markdown <<MARKDOWN

## Next steps

1. Return to your cohort's shared slide deck for Module 2. You can access this through your Digital Digest.
1. Return to your cohort's shared slide deck for Module 2.
2. Follow the directions in the shared slide deck to finish final reflections or tasks for this module.
3. Join us for the Module 2 synchronous workshop. The date and time of the next call can be found in the Digital Digest.
3. Join us for the Module 2 synchronous workshop.
MARKDOWN
2 changes: 1 addition & 1 deletion dashboard/config/scripts/csp_module_3_wrap_up.external
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ markdown <<MARKDOWN

## Next steps

1. Return to your cohort's shared slide deck for Module 3. You can access this through your Digital Digest.
1. Return to your cohort's shared slide deck for Module 3.
2. Follow the directions in the shared slide deck to finish final reflections or tasks for this module.
3. Join us for the Module 3 synchronous workshop. The date and time of the next call can be found in the Digital Digest.

Expand Down
2 changes: 1 addition & 1 deletion dashboard/config/scripts/csp_module_4_wrap_up.external
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ markdown <<MARKDOWN

## Next Steps

1. Return to your cohort's shared slide deck for Module 4. You can access this through your Digital Digest.
1. Return to your cohort's shared slide deck for Module 4.
2. Follow the directions in the shared slide deck to finish final reflections or tasks for this module.
3. Join us for the Module 4 synchronous workshop. The date and time of the next call can be found in the Digital Digest.
MARKDOWN
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ markdown <<MARKDOWN

## Module 4 Overview

Welcome to the Module 4 asynchronous work for CS Principles! These experiences will help prepare you for the following synchronous module and also help you understand the content and curriculum as you prepare to teach your own students. Combined, these asynchronous tasks should take about 90 minutes to complete, but you can start and stop at your own pace.
Welcome to the Module 4 asynchronous work for CS Principles! These experiences will help prepare you for the following synchronous workshop and also help you understand the content and curriculum as you prepare to teach your own students. Combined, these asynchronous tasks should take about 90 minutes to complete, but you can start and stop at your own pace.

**During this asynchronous work you will:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ markdown <<MARKDOWN

## Module 3 Overview

Welcome to the Module 3 asynchronous work for CS Principles! These experiences will help prepare you for the following synchronous module and also help you understand the content and curriculum as you prepare to teach your own students. Combined, these asynchronous tasks should take about 90 minutes to complete, but you can start and stop at your own pace.
Welcome to the Module 3 asynchronous work for CS Principles! These experiences will help prepare you for the following synchronous workshop and also help you understand the content and curriculum as you prepare to teach your own students. Combined, these asynchronous tasks should take about 90 minutes to complete, but you can start and stop at your own pace.

**During this asynchronous work you will:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ Choose **ONE** of the options below to engage with for 20 minutes:

As you engage in the level progression, pay attention to what academic skills you might see your students demonstrate during this lesson.

*Note: The above links will take you to the student-facing course. If you worked on these levels earlier in your own exploration of the course, you may see your previous work saved in these levels. This is to be expected.*

MARKDOWN
Loading

0 comments on commit cbf6d4f

Please sign in to comment.