Subversion Repositories wimsdev

Rev

Rev 3298 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !if $wims_read_parm=help
  2.  
  3.  The \special method "help" accepts two parameters. The first is a key
  4.  which will be put to the variable \help_subject within the help text,
  5.  and the second is the text of the link.
  6.  
  7.  If the \special{help} is put into statement or feedback of an exercise,
  8.  the help will use popup mode, unlike the usual "help" link in the module.
  9.  
  10.  All the help content should be put into the oef source. No facility is
  11.  planned for module-level help, as the principle is that the independency
  12.  of oef files should not be destroyed by helps. However, if you have
  13.  several exercises sharing the same help texts, you may consider using cpp
  14.  with an "#include" directive.
  15. <p>
  16.  
  17. <b>Example:</b>
  18.  <pre>
  19.  \title{Guess}
  20.  \statement{ Guess a word :  
  21.    \special{help test1,First clue}
  22.  }
  23.  \answer{1}{Monk}
  24.  \help{
  25.    This is the help: help subject=\help_subject
  26.    <p>
  27.    \if{\help_subject issametext or \help_subject issametext none}{
  28.      \special{help test0,here}
  29.    }
  30.    \if{\help_subject issametext test1}{
  31.      The first letter is <b>M</b>. You can find another clue
  32.      \special{help test2,here}
  33.    }
  34.   \if{\help_subject issametext test2}{Here is the second clue.
  35.     The second letter is <b>o</b>
  36.    }
  37.   \if{\help_subject issametext test0}{Here is the  
  38.     \special{help test1,clue 1}, \special{help test2,clue 2}
  39.    }
  40.  }
  41.  </pre>
  42.  
  43.  !exit
  44. !endif
  45. !set prompt=!item 2 to -1 of $wims_read_parm
  46. !default prompt=$wims_read_parm
  47. !if $prompt != $empty
  48.  !if $cmd=help
  49.   !href cmd=help&special_parm=$(wims_read_parm[1]) $prompt
  50.  !else
  51.   !href target=wims_mhelp cmd=help&special_parm=$(wims_read_parm[1]) $prompt
  52.  !endif
  53. !endif
  54.  
  55.