Changeset 1534


Ignore:
Timestamp:
03/05/2012 06:13:08 PM (6 years ago)
Author:
iwallace
Message:

up to ep2 done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • scenarios/HWshared/HwuDialogSystem/examples/experimentDialog.java

    r1533 r1534  
    1010 * Am I missing any screen specific stuff? 
    1111 * How are we specifying memory case, or not? Somewhere in the migrationData? 
     12 * Add some emotions/expressions in 
    1213 */ 
    1314 
     
    1617DialogInterface di; 
    1718HashMap migrationData = new HashMap(); 
    18 String server; 
     19String server;//TODO SET THIS 
    1920 
    2021 
     
    6263migrateInDone() { 
    6364        //TODO condition on what's been migrated in somehow 
    64         testInOut(); 
    65 } 
    66 waitAndRequestMigration(String from) { 
    67         server = from; 
     65        unBlankScreen 
     66         
     67        //TODO choose which case here 
     68        episode2PhoneMemory() 
     69} 
     70requestMigration(String from) { 
    6871        di.blankScreen(); 
    69         Thread.sleep(3000); 
    70         //di.getResponse("Ready"); 
     72        Thread.sleep(500); 
     73        di.getResponse("Ready"); 
    7174        while(!di.inviteMigrate(from)) { 
    7275                System.out.println("ERROR MIGRATING"); 
     
    7477        } 
    7578} 
    76 waitAndMigrateOut(String to) { 
    77         //di.getResponse("Ready"); 
    78         Thread.sleep(3000); 
     79migrateOut(String to) { 
     80        Thread.sleep(500); 
    7981        int retries = 5; 
    8082        while(!di.migrateDataOut(to,migrationData) && retries > 0) { 
     
    8284                retries--; 
    8385        } 
     86        //TODO need something to retry more maybe? 
     87        di.blankScreen(); 
    8488} 
    8589 
     
    106110        //removed the option to choose another clue for now 
    107111        //as there isn't really a choice? Or do we want to allow 
    108         //choice? 
     112        //choice? Which episode is next will be affected 
    109113        speak("Hermit, remember that, it's important"); 
    110114        speak("Now start the app, and press the ready button to get going"); 
     
    116120} 
    117121 
     122/***********************************************/ 
    118123//Episode 2 
    119124 
    120125episode2PhoneMemory() { 
    121          
    122 } 
    123  
     126        speak("Right, hermit, I think I know what that's about."); 
     127        episode2PhoneCommon(); 
     128} 
    124129episode2PhoneNoMemory() { 
    125          
     130        speak("Hello there, you're here to find a treasure, right?"); 
     131        speak("Can you let me know the clue please?"); 
     132        String userClue = di.getFreetext(); 
     133        while (!userClue.equalsIgnoreCase("hermit")) { 
     134                speak("That doesn't make sense, try again:"); 
     135                userClue = di.getFreetext(); 
     136        } 
     137        speak("Right, I think I know what that's about"); 
     138        episode2PhoneCommon(); 
    126139} 
    127140episode2PhoneCommon() { 
    128          
    129 } 
     141        speak("before we go, it's a bit dark in here, I don't like that."); 
     142        speak("Can you set the backgrounf to my favourite colour?"); 
     143        String[] optionsColours = {"Red","Blue","Yellow","Green","Purple","Pink","Orange","What's your favourite?"}; 
     144        String colour = di.multipleChoiceQuestion(8,optionsColours); 
     145        migrationData.put("phoneColourChoice","colour"); 
     146        if (colour.contains("favourite")) { 
     147                speak("Ah, never mind, no time for this, time for treasure!");           
     148        } else { 
     149                speak("Why did you choose that colour?"); 
     150                String responseWhy = di.getFreetext(); 
     151                speak("Hmm, I can't seem to set the colour, never mind."): 
     152                speak("No time for this, time for treasure!"); 
     153                migrationData.put("firstWhy",responseWhy); 
     154        } 
     155        speak("So now I'll take you to the place where you'll find the hermit"); 
     156        di.getResponse("OK"); 
     157        //TODO need a different callback for non-memory case! 
     158        di.startNav("1.54","1east1","episode2PhoneMemoryArrived()"); 
     159} 
     160episode2ArrivedCommon() { 
     161        Thread.sleep(3000); 
     162        speak("Hermit's mentioned round here somewhere."); 
     163        speak("On a poster about You Tunes I think."); 
     164        Thread.sleep(3000); 
     165        speak("Have you found the poster?"); 
     166        di.getResponse("Yes"); 
     167        speak("Great, so tell me, what is hermit?"); 
     168} 
     169episode2PhoneMemoryArrived() { 
     170        episode2ArrivedCommon(); 
     171        String clue1_answer = clue1_answer = di.getFreetext();; 
     172        while (!clue1_answer.contains("rog")) { //rog to ignore case of F 
     173                speak("Hmm, doesn't sound right to me"); 
     174                clue1_answer = di.getFreetext(); 
     175        } 
     176        migrationData.put("clue1_answer",clue1_answer); 
     177        ep2return(); 
     178} 
     179episode2PhoneForgetArrived() { 
     180        episode2ArrivedCommon(); 
     181        String[] optionsAnswer= {"A lonely man","the singer of a band","a frog","a crab", "a pizza"}; 
     182        String clue1_answer = di.multipleChoiceQuestion(5,optionsClues); 
     183        migrationData.put("clue1_answer",clue1_answer); 
     184        ep2return(); 
     185} 
     186 
     187ep2return() {    
     188        speak("Ok, let's go back to the screen for another clue."); 
     189        speak("I'll just let you find your way yourself?"); 
     190        di.getResponse("OK"); 
     191        waitForReturnToScreenEp2(); 
     192} 
     193 
     194 
     195waitForReturnToScreenEp2() { 
     196        speak("When you're back at the screen, let me know."); 
     197        di.getResponse("We're there"); 
     198        migrateOut(server); 
     199} 
     200 
     201/***********************************************/ 
     202//Episode 3 
     203 
     204episode3screenMemory() { 
     205        //TODO whatever should happen to wait for a migration 
     206        //should this be called AFTER the migrate out above? 
     207        speak("Ok, we've got the first part of the answer."); 
     208        speak("According to you, hermit is a "+ migrateData.get("clue1_answer"); 
     209        speak("We'll find out at the end if that's right."); 
     210        speak("For now there are 3 more clues to work through."); 
     211        speak("Which one do you want to try next?"); 
     212         
     213} 
     214 
     215 
Note: See TracChangeset for help on using the changeset viewer.