Skip to content

Commit

Permalink
Merge branch 'develop' for version 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jakory committed Oct 12, 2016
2 parents 74bff68 + f420f35 commit d7866fe
Show file tree
Hide file tree
Showing 17 changed files with 1,284 additions and 293 deletions.
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ the Opal device that is paired with this node. Due to licensing, the full set
of graphics required for the game is available on request from students in the
Personal Robots Group. Please email students in the group to inquire.

### Stories

Due to licensing, only a couple sample stories are provided in this repository.
These can imported into the database, and story scripts generated, using the
`source_ods/story-test-set.ods` spreadsheet and the provided
`ss_process_story_ods.py` script (described below). The full game requires a
set of 42 stories. This full set is available on request from students in the
Personal Robots Group. Please email students in the group to inquire.

## ROS messages

This node subscribes to the ROS topic `/sar/robot_state` to receive messages of
Expand Down Expand Up @@ -317,6 +326,15 @@ will look like this:

`STORY`

That said: Depending on your script, you may want to specify that a new story
should be selected before attempting to load the story or play back the story.
A `STORY` line may optionally take a string argument "SETUP", which indicates
that the next story should be selected. You will then need to use the usual
script lines for loading and playing back the story.

`STORY SETUP`


### Story scripts

The story scripts follow the same format as the main session scripts. See the
Expand Down Expand Up @@ -352,10 +370,15 @@ load graphics and tell the robot how to read aloud the story, and add
meta-information about the stories and the questions to ask about each story to
the database.

Note that the script assumes a very particular organization of the
Note that the script assumes a very particular organization of the
spreadsheet. An example spreadsheet containing two stories is provided in
`source_ods/story-test-set.ods`.

In addition, the script clears existing data from several tables, so you should
run the script with all the spreadsheets you need to import at once. If you run
the script again later, some or all of the previously imported data may be
deleted.

Run as follows:

`python ss_process_story_ods.py [-h] [-d [DB]] [-o [OUT_DIR]] ods_files
Expand All @@ -381,7 +404,7 @@ Optional arguments:

### Personalization

There are two levels of personalization. First is the level of the story
There are two kinds of personalization. First is the level of the story
presented. Players start at level 1. If they get sufficient emotion questions
correct about the stories they hear, in the next session, they are leveled up.
The percentage of questions they need to get correct to level up can be set in
Expand All @@ -406,6 +429,22 @@ couple guiding principles:
We query the database to determine the player's past performance and stories
heard.

## Testing

We are using python's unittest framework for testing. Some of the tests require
an initialized and filled database, so you will need to create one prior to
running the tests.

Steps:
- Initialize the database with the `ss_init_db.py` script as described above.
- Fill the database with the full set of 42 SAR stories using the
`ss_process_story_ods.py` script. If you use only the example stories, a
couple tests may need to be modified, since they assume that the full set of
stories will be present and can be referenced.
- Run `python -m unittest discover` from the `src/` directory. This will
automatically find all files in that directory containing tests, and will run
all the tests.

## Version notes

This program was developed and tested with:
Expand Down
1 change: 1 addition & 0 deletions game_scripts/session_scripts/demo-story.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ROBOT DO "Touch start when you are ready to hear the story!<anticipate>"
WAIT START 300
OPAL CLEAR
PAUSE 1
STORY SETUP
OPAL LOAD_STORY
ROBOT STORY_INTRO
ROBOT DO "Let's look <lookat-game> at the story together."
Expand Down
2 changes: 1 addition & 1 deletion game_scripts/session_scripts/demo-yesno-scene.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "name": "buttons/start_button_wide.png", "tag": "PlayObject", "draggable": "false", "slot": "1", "isAnswerSlot": "false"}
{ "name": "buttons/start_button_square.png", "tag": "PlayObject", "draggable": "false", "slot": "1", "isAnswerSlot": "false"}
26 changes: 17 additions & 9 deletions game_scripts/story_scripts/demo-story-1.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
ROBOT DO "Lisa was putting on her shoes in the morning. Bella the dog took Lisa's favorite shoe. Lisa tried to get her shoe back from Bella. Bella wouldn't give it back. Lisa tried again but Bella still wouldn't give it back. Lisa's mom came into the room. She took the shoe from Bella. Then Lisa's mom gave the shoe back to her."
OPAL HIGHLIGHT scene0
ROBOT DO "Lisa was putting on her shoes in the morning. Bella the dog took Lisa's favorite shoe."
OPAL HIGHLIGHT scene1
ROBOT DO "Lisa tried to get her shoe back from Bella. Bella wouldn't give it back."
OPAL HIGHLIGHT scene2
ROBOT DO "Lisa tried again but Bella still wouldn't give it back."
OPAL HIGHLIGHT scene3
ROBOT DO "Lisa's mom came into the room. She took the shoe from Bella. Then Lisa's mom gave the shoe back to her."
ROBOT DO "The end."
OPAL HIGHLIGHT
PAUSE 2
OPAL LOAD_ANSWERS answers/lisa_happy.png, answers/lisa_sad.png, answers/lisa_excited.png, answers/lisa_surprised.png
OPAL SET_CORRECT {"correct":["lisa_sad"], "incorrect":["lisa_happy","lisa_excited","lisa_surprised"]}
ROBOT DO How did Lisa feel when she saw Bella take her favorite shoe?
ROBOT DO "How did Lisa feel when she saw Bella take her favorite shoe?"
WAIT CORRECT_INCORRECT 10
ROBOT DO Lisa felt sad.
ROBOT DO "Lisa felt sad."
OPAL CLEAR ANSWERS
PAUSE 1
OPAL LOAD_ANSWERS answers/lisa_excited.png, answers/lisa_happy.png, answers/lisa_bored.png, answers/lisa_frustrated.png
OPAL SET_CORRECT {"correct":["lisa_frustrated"], "incorrect":["lisa_excited","lisa_happy","lisa_bored"]}
ROBOT DO How did Lisa feel when she couldn't get her shoe back?
ROBOT DO "How did Lisa feel when she couldn't get her shoe back?"
WAIT CORRECT_INCORRECT 10
ROBOT DO Lisa felt frustrated.
ROBOT DO "Lisa felt frustrated."
OPAL CLEAR ANSWERS
PAUSE 1
OPAL LOAD_ANSWERS answers/lisa_angry.png, answers/lisa_afraid.png, answers/lisa_frustrated.png, answers/lisa_happy.png
OPAL SET_CORRECT {"correct":["lisa_happy"], "incorrect":["lisa_angry","lisa_afraid","lisa_frustrated"]}
ROBOT DO How did Lisa feel when she got her shoe back from her mom?
OPAL LOAD_ANSWERS answers/lisa_mad.png, answers/lisa_scared.png, answers/lisa_frustrated.png, answers/lisa_happy.png
OPAL SET_CORRECT {"correct":["lisa_happy"], "incorrect":["lisa_mad","lisa_scared","lisa_frustrated"]}
ROBOT DO "How did Lisa feel when she got her shoe back from her mom?"
WAIT CORRECT_INCORRECT 10
ROBOT DO Lisa felt happy.
ROBOT DO "Lisa felt happy."
OPAL CLEAR ANSWERS
Binary file modified source_ods/story-test-set.ods
Binary file not shown.
Loading

0 comments on commit d7866fe

Please sign in to comment.