Skip to content

Commit

Permalink
Merge pull request #406 from code-dot-org/ben/k5-guides-updates
Browse files Browse the repository at this point in the history
K5 guides curriculum-specified updates
  • Loading branch information
bencodeorg authored Jul 15, 2024
2 parents bfd6e0c + d7b8e70 commit a37464c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 71 deletions.
1 change: 1 addition & 0 deletions i18n/oceans.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"fishlong-pond-init3": "Or you can teach A.I. a new word by choosing New Word.",
"didYouKnow": "Did you know?",
"continue": "Continue",
"training-generic-please-continue": "Great Work! Click Continue to see what A.I. has learned.",
"areYouSure": "Are you sure?",
"eraseWarning": "Erasing A.I.'s data will permanently delete all training. Is that what you want to do?",
"erase": "Erase",
Expand Down
117 changes: 46 additions & 71 deletions src/oceans/models/guidesK5.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {AppMode, Modes} from '../constants';
import turtleImage from '@public/images/turtle-large.png';
import seahorseImage from '@public/images/seahorse-large.png';
import trashBottleImage from '@public/images/bottle-large.png';
import trashCanImage from '@public/images/can-large.png';
import I18n from '../i18n';

const imageStyleOverrides = {
Expand All @@ -12,6 +9,9 @@ const imageStyleOverrides = {
can: {bottom: '2%', left: '16%'}
};

const encourageStopTrainingCountsFishLong = [150, 200, 250];
const encourageStopTrainingCountsDefault = [100, ...encourageStopTrainingCountsFishLong];

const guidesK5 = [
{
id: "fishvtrash-training-init1",
Expand Down Expand Up @@ -42,48 +42,9 @@ const guidesK5 = [
style: "Center",
arrow: "LowerCenter",
},
{
id: "fishvtrash-training-pause1",
textFn: () => I18n.t("fishvtrash-training-pause1"),
when: {
appMode: AppMode.FishVTrash,
currentMode: Modes.Training,
fn: (state) => {
return state.yesCount + state.noCount >= 5;
},
},
style: "Info",
image: trashBottleImage,
imageStyle: imageStyleOverrides.bottle,
},
{
id: "fishvtrash-training-pause2",
textFn: () => I18n.t("fishvtrash-training-pause2"),
when: {
appMode: AppMode.FishVTrash,
currentMode: Modes.Training,
fn: (state) => {
return state.yesCount + state.noCount >= 5;
},
},
},
{
id: "fishvtrash-training-pause3",
textFn: () => I18n.t("fishvtrash-training-pause3"),
when: {
appMode: AppMode.FishVTrash,
currentMode: Modes.Training,
fn: (state) => {
return state.yesCount + state.noCount >= 15;
},
},
style: "Info",
image: trashCanImage,
imageStyle: imageStyleOverrides.can,
},
{
id: "fishvtrash-training-pause4",
textFn: () => I18n.t("fishvtrash-training-pause4"),
when: {
appMode: AppMode.FishVTrash,
currentMode: Modes.Training,
Expand All @@ -99,10 +60,23 @@ const guidesK5 = [
appMode: AppMode.FishVTrash,
currentMode: Modes.Training,
fn: (state) => {
return state.yesCount + state.noCount >= 30;
return state.yesCount + state.noCount >= 50;
},
},
},
...encourageStopTrainingCountsDefault.map(count => {
return {
id: `fishvtrash-training-generic-please-continue-count-${count}`,
textFn: () => I18n.t('training-generic-please-continue'),
when: {
appMode: AppMode.FishVTrash,
currentMode: Modes.Training,
fn: state => {
return state.yesCount + state.noCount >= count;
}
}
}
}),
{
id: "fishvtrash-predicting-init1",
textFn: () => I18n.t("fishvtrash-predicting-init1"),
Expand Down Expand Up @@ -151,7 +125,7 @@ const guidesK5 = [
},
{
id: "creaturesvtrashdemo-predicting-init1",
textFn: () => 'This is a test string.',
textFn: () => I18n.t("creaturesvtrashdemo-predicting-init1"),
when: {
appMode: AppMode.CreaturesVTrashDemo,
currentMode: Modes.Predicting,
Expand Down Expand Up @@ -233,7 +207,7 @@ const guidesK5 = [
appMode: AppMode.CreaturesVTrash,
currentMode: Modes.Training,
fn: (state) => {
return state.yesCount + state.noCount >= 5;
return state.yesCount + state.noCount >= 15;
},
},
style: "Info",
Expand All @@ -243,31 +217,6 @@ const guidesK5 = [
{
id: "creaturesvtrash-training-init3",
textFn: () => I18n.t("creaturesvtrash-training-init3"),
when: {
appMode: AppMode.CreaturesVTrash,
currentMode: Modes.Training,
fn: (state) => {
return state.yesCount + state.noCount >= 5;
},
},
},
{
id: "creaturesvtrash-training-init4",
textFn: () => I18n.t("creaturesvtrash-training-init4"),
when: {
appMode: AppMode.CreaturesVTrash,
currentMode: Modes.Training,
fn: (state) => {
return state.yesCount + state.noCount >= 15;
},
},
style: "Info",
image: turtleImage,
imageStyle: imageStyleOverrides.turtle,
},
{
id: "creaturesvtrash-training-init5",
textFn: () => I18n.t("creaturesvtrash-training-init5"),
when: {
appMode: AppMode.CreaturesVTrash,
currentMode: Modes.Training,
Expand All @@ -283,10 +232,23 @@ const guidesK5 = [
appMode: AppMode.CreaturesVTrash,
currentMode: Modes.Training,
fn: (state) => {
return state.yesCount + state.noCount >= 30;
return state.yesCount + state.noCount >= 50;
},
},
},
...encourageStopTrainingCountsDefault.map(count => {
return {
id: `creaturesvtrash-training-generic-please-continue-count-${count}`,
textFn: () => I18n.t('training-generic-please-continue'),
when: {
appMode: AppMode.CreaturesVTrash,
currentMode: Modes.Training,
fn: state => {
return state.yesCount + state.noCount >= count;
}
}
}
}),
{
id: "creaturesvtrash-predicting-init1",
textFn: () => I18n.t("creaturesvtrash-predicting-init1"),
Expand Down Expand Up @@ -426,6 +388,19 @@ const guidesK5 = [
},
},
},
...encourageStopTrainingCountsFishLong.map(count => {
return {
id: `fishlong-training-generic-please-continue-count-${count}`,
textFn: () => I18n.t('training-generic-please-continue'),
when: {
appMode: AppMode.FishLong,
currentMode: Modes.Training,
fn: state => {
return state.yesCount + state.noCount >= count;
}
}
}
}),
{
id: "fishlong-training-many",
textFn: () => I18n.t("fishlong-training-many"),
Expand Down

0 comments on commit a37464c

Please sign in to comment.