File:  [LON-CAPA] / loncom / html / adm / helper / test.helper
Revision 1.1: download - view: text, annotated - select for diffs
Fri Apr 11 18:21:00 2003 UTC (21 years, 3 months ago) by bowersj2
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_99_0, version_2_9_1, version_2_9_0, version_2_8_X, version_2_8_99_1, version_2_8_99_0, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_X, version_2_5_99_1, version_2_5_99_0, version_2_5_2, version_2_5_1, version_2_5_0, version_2_4_X, version_2_4_99_0, version_2_4_2, version_2_4_1, version_2_4_0, version_2_3_X, version_2_3_99_0, version_2_3_2, version_2_3_1, version_2_3_0, version_2_2_X, version_2_2_99_1, version_2_2_99_0, version_2_2_2, version_2_2_1, version_2_2_0, version_2_1_X, version_2_1_99_3, version_2_1_99_2, version_2_1_99_1, version_2_1_99_0, version_2_1_3, version_2_1_2, version_2_1_1, version_2_1_0, version_2_12_X, version_2_11_X, version_2_11_5, version_2_11_4_uiuc, version_2_11_4_msu, version_2_11_4, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3, version_2_11_2_uiuc, version_2_11_2_msu, version_2_11_2_educog, version_2_11_2, version_2_11_1, version_2_11_0_RC3, version_2_11_0_RC2, version_2_11_0_RC1, version_2_11_0, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, version_2_0_X, version_2_0_99_1, version_2_0_2, version_2_0_1, version_2_0_0, version_1_99_3, version_1_99_2, version_1_99_1_tmcc, version_1_99_1, version_1_99_0_tmcc, version_1_99_0, version_1_3_X, version_1_3_3, version_1_3_2, version_1_3_1, version_1_3_0, version_1_2_X, version_1_2_99_1, version_1_2_99_0, version_1_2_1, version_1_2_0, version_1_1_X, version_1_1_99_5, version_1_1_99_4, version_1_1_99_3, version_1_1_99_2, version_1_1_99_1, version_1_1_99_0, version_1_1_3, version_1_1_2, version_1_1_1, version_1_1_0, version_1_0_99_3, version_1_0_99_2, version_1_0_99_1, version_1_0_99, version_1_0_3, version_1_0_2, version_1_0_1, version_1_0_0, version_0_99_5, version_0_99_4, version_0_99_3, version_0_99_2, version_0_99_1, version_0_99_0, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, conference_2003, bz6209-base, bz6209, bz5969, bz2851, PRINT_INCOMPLETE_base, PRINT_INCOMPLETE, HEAD, GCI_3, GCI_2, GCI_1, BZ5971-printing-apage, BZ5434-fox, BZ4492-merge, BZ4492-feature_horizontal_radioresponse
test.helper exercises the major features of the helper system. It is
meant for testing and will not be included in a normal install.

    1: <helper title="Test Helper">
    2:   <state name="START" title="Tom">
    3:     <message>
    4:       <message_text><p>Hey, bob, <b>this is great</b>!</p></message_text>
    5:       <nextstate>Harry</nextstate>
    6:       </message>
    7:     <message>
    8:       <message_text><p>This is <b>another message</b>!</p></message_text>
    9:       </message>
   10:     </state>
   11:   <state name="Harry" title="Harry"> 
   12:     <message>
   13:       <message_text>This is Hairy Beatle, may I help you?</message_text>
   14:       </message>
   15:     <choices variable="harry">
   16:       <choice computer='1' nextstate="Good">Yes</choice>
   17:       <choice computer='0' nextstate="Bad">No</choice>
   18:       </choices>
   19:     </state>
   20:   <state name="Good" title="Great!">
   21:     <message>
   22:       <message_text>I'm happy to hear I can help you. - Hairy Beetle</message_text>
   23:       <nextstate>Sally</nextstate>
   24:       </message>
   25:     </state>
   26:   <state name="Bad" title="Horrible!">
   27:     <message>
   28:       <message_text>I'm horrified to hear I can't help you. - Hairy Beetle</message_text>
   29:       <nextstate>Sally</nextstate>
   30:       </message>
   31:     </state>
   32:   <state name="Sally" title="Sally">
   33:     <message>
   34:       <message_text>Please select the kind of games you are interested in.<br /></message_text>
   35:       </message>
   36:     <choices variable="gametype" multichoice='1'>
   37:       <nextstate>DATE</nextstate>
   38:       <choice computer="rts"
   39:         ><b>R</b>eal <b>T</b>ime <b>S</b>trategy</choice>
   40:       <choice computer="puzzle"
   41:         >P<i>u</i>z<i>z</i>l<i>e</i></choice>
   42:       <condition><clause>return 0;</clause>
   43:         <choice computer='shouldnotsee'>You should not see this.</choice>
   44:       </condition>
   45:       <condition><clause>return 1;</clause>
   46:         <choice computer='shouldsee'>You should see this.</choice>
   47:       </condition>
   48:     <exec>
   49:       push @{$state->{CHOICES}}, ['The Human Name!', 'compname'];
   50:     </exec>
   51:       </choices>
   52:     </state>
   53:   <state name="DATE" title="Choose a Date!">
   54:     <message>
   55:       <message_text>This is a test of the date state, with minutes:</message_text>
   56:       </message>
   57:     <date variable="date" hoursminutes='1'></date>
   58:     <message>
   59:       <message_text>and without:</message_text>
   60:       </message>
   61:     <date variable="date2">
   62:       <nextstate>RESOURCE</nextstate>
   63:       </date>
   64:     </state>
   65:   <state name="RESOURCE" title="Choose a resource">
   66:     <message><message_text>Choose a resource</message_text></message>
   67:     <resource variable="res1"></resource>
   68:     <message><message_text>Choose a resource</message_text></message>
   69:     <resource variable="res2">
   70:       <filterfunc>return $res->is_map()</filterfunc>
   71:       <nextstate>STUDENT</nextstate>
   72:       </resource>    
   73:     </state>
   74:   <state name="STUDENT" title="Choose a Student">
   75:     <message><message_text>Choose a student:<br /></message_text>
   76:              <nextstate>FILES</nextstate></message>
   77:     <student variable='stu1' />
   78:     <student variable='stu2' multichoice='1' />
   79:     </state>
   80:   <state name="FILES" title="Choose some files">
   81:     <message><message_text>Choose some files. Or else.</message_text></message>
   82:     <files variable='files1'>
   83:       <nextstate>FINAL</nextstate>
   84:       <filechoice>return '/home/jerf/public_html';</filechoice>
   85:       </files>
   86:     <message><message_text>Choose some other files. Or else.</message_text></message>
   87:     <files variable='files2' multichoice="1">
   88:       <filechoice>return '/home/jerf/public_html';</filechoice>
   89:       <filefilter>return $filename =~ /(.html$)|(.htm$)/;</filefilter>
   90:       </files>
   91:     </state>
   92:   <state name="FINAL" title="Final State">
   93:     <message><message_text>This is the final state.</message_text></message>
   94:     </state>
   95:   </helper>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>