File:  [LON-CAPA] / doc / homework / Attic / homework4.html
Revision 1.4: download - view: text, annotated - select for diffs
Wed Dec 20 23:51:24 2000 UTC (23 years, 4 months ago) by albertel
Branches: MAIN
CVS tags: HEAD
- fixed screwed up definition of <scriptlib> and <parserlib>

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
  <head>
    <title>LON-CAPA Homework System</title>
  </head>

  <body>
    <h1>LON-CAPA Homework System</h1>
    
    <h2>Tags</h2>
    <ul>
      <b> Outtext is gone now</b>
      <li>
	Output Tags
	
	<p>
	  This set of tags control how and when data gets sent to the
	  student, it also provides hints to the data's markup and
	  when it should be autoconverted, and when it should be
	  ignored. All of these tags except <b>&lt;outtext&gt;</b> are
	  valid and parsed by &parsed() inside a <b>&lt;script&gt;</b>.
	</p>
	<p>
	  Additionaly any perl style variables are replaced with the
	  values of the variable in the problem namespace.
	</p>
	<ul>

	  <li>
	    <b>&lt;outtext&gt;</b> all data inside is assumed to be valid
	    html, the handler will attempt to autoconvert to the
	    output type. The only thing tags allowed inside are the
	    ones listed below.
	  </li>
	  <li>
	    <b>&lt;target&gt;</b> This tag specifies data that is not in
	    HTMl format inside an <b>&lt;outtext&gt;</b>. Takes a required
	    argument <i>type</i> and an optional argument
	    <i>dest</i>. <i>type</i> specifies a known valid
	    output target which is the format of the
	    data. <i>dest</i> specifies a list of possible output
	    targets that the data should be autoconverted for. The
	    <i>type</i> of the data is assumed to be a
	    <i>dest</i>. If the current target is not a
	    <i>dest</i> then the data is ignored.
	  </li>
	  
	  <li>
	    <b>&lt;tex&gt;</b> shorthand for &lt;target type=``tex''&gt;
	    <i>dest</i> is a valid argument.
	  </li>
	  
	  <li>
	    <b>&lt;ascii&gt;</b> shorthand for &lt;target type=``ascii''&gt;
	    <i>dest</i> is a valid argument.
	  </li>
	  
	  <li>
	    <b>&lt;web&gt;</b> shorthand for &lt;target type=``web''&gt;
	    <i>dest</i> is a valid argument.
	  </li>
	  
	  <li>
	    <b>&lt;mathml&gt;</b> shorthand for &lt;target
	    type=``mathml''&gt; <i>dest</i> is a valid argument,
	    mathml may be passed along unconverted in a web output
	    target.
	  </li>
	  
	</ul>
      </li>
    <br>
    <li>
      Form Elements:
      
      <p>
	This set of tags soley generate a representation of the proper
	form element on the output device. Need to look at what should
	  be provided when an exam is wanted.
      </p>
      <ul>
	<li> 
	  <b>&lt;radio&gt;</b> 
	  
	  <p>
	    web - provides a single button to check on and off, when
	    checked on all other radio buttons in the current
	    <b>&lt;answergroup&gt;</b> level will be set to off.
	  </p>
	  
	  <p>
	    tex - generates a circle before the data inside
	  </p>
	</li>
	<li>
	  <b>&lt;list&gt;</b>
	  <p>
	    web - provides a drop down box of all the possible options
	  </p>
	  <p>
	    tex - the list is displayed an students can select the
	    correct option
	  </p>
	</li>
	<li>
	  <b>&lt;textline&gt;</b>
	  <p>
	    web - a single line of reponse is provided to type into.
	  </p>
	  <p>
	    tex - a line is provided.
	  </p>
	</li>
	<li>
	  <b>&lt;textarea&gt;</b>
	  <p>
	    web - a textarea form is provided allowing multiples
	    lines of response
	  </p>
	  <p>
	    tex - a configureable number of lines is provided,
	    configured through the argument numlines, defaults to 10
	  </p>
	</li>
	<li>
	  <b>&lt;check&gt;</b>
	  <p>
	    web - either a checkbutton, or two radio buttons are provided
	  </p>
	  <p>
	    tex - a small box that can be checked is provided.
	  </p>
	</li>
	<li>
	  <b>&lt;button&gt;</b> -  Not sure this is useful
	</li>
      </ul>
    </li>
    <li>
      Randomiztion
      <ul>
	<li>
	  <b>&lt;randomlist&gt;</b> this tag will cause the parser to
	  randomly select the order that it parses the next level of
	  tags, tags another leveldown will be done in order
	  though. Example:
	  <pre>
<b>&lt;randomlist&gt;</b>
        <b>&lt;tag1&gt;</b>
		<b>&lt;subtag1&gt;</b>
		<b>&lt;/subtag1&gt;</b>
		<b>&lt;subtag2&gt;</b>
		<b>&lt;/subtag2&gt;</b>
	<b>&lt;/tag1&gt;</b>
	<b>&lt;tag2&gt;</b>
		<b>&lt;subtag1&gt;</b>
		<b>&lt;/subtag1&gt;</b>
		<b>&lt;subtag2&gt;</b>
		<b>&lt;/subtag2&gt;</b>
	<b>&lt;/tag2&gt;</b>
<b>&lt;/randomlist&gt;</b>
</pre>
	  In this example, <b>&lt;tag1&gt;</b> or <b>&lt;tag2&gt;</b> will be
	  done first, but <b>&lt;subtag1&gt;</b> will always happen before
	  <b>&lt;subtag2&gt;</b>.
	</li>
	<li>
	  <b>&lt;foil&gt;</b>, <b>&lt;showfoil/&gt;</b>,
	  <b>&lt;showrandomfoil/&gt;</b> These tags combine to allow the
	  user greater control over the exact placement of a
	  randomized problem text. a <b>&lt;foil&gt;</b> tag defines a
	  section of the problem that will appear in places a
	  <b>&lt;showfoil/&gt;</b> or <b>&lt;showrandomfoil/&gt;</b> mark.
	  Internally, the parser will make a pass over an entire
	  answer group and count the number of <b>&lt;foil&gt;</b>,
	  <b>&lt;showfoil/&gt;</b>, and <b>&lt;showrandomfoil/&gt;</b> tags
	  that are used it will then make another pass and parse all
	  of the <b>&lt;foil&gt;</b> storing the results of these parses,
	  while parsing for each <b>&lt;show*&gt;</b> tag it hits it will
	  send to the output device a foil, the <b>&lt;show*&gt;</b> it
	  hit was a <b>&lt;showfoil&gt;</b> and this was the nth
	  <b>&lt;show*&gt;</b> it hit, it will display the nth foil. For
	  each <b>&lt;showrandomfoil&gt;</b> it hits it will randomly pick
	  from the remaining foils a foil to send to the output. If
	  there are more <b>&lt;show*&gt;</b> tags than foils, the extra
	  <b>&lt;show*&gt;</b> will have nothing sent out. If there are
	  more <b>&lt;foil&gt;</b> tags, the extras won't appear.  When
	  mixing <b>&lt;showfoil&gt;</b> and <b>&lt;showrandomfoil&gt;</b> the
	  result is undefined.
	</li>
      </ul>
    </li>
    <li>
      Answer Section
      <ul>
	<li>
	  <b> answergroup has little in the way of purpose anymore, showrandomfoil is it</b>
	  <b>&lt;answergroup&gt;</b> this defines a grouping of
	  <b>&lt;*response&gt;</b> that when responded to must all be
	  right in order for any to be right, this also allows
	  subgroups to exist. For example 1 of N questions that have a
	  1 of N hint question for a leaf in the orginal 1of N
	  question. The closing tag in this group uses the results
	  from the <b>&lt;*response&gt;</b>s to decide whether this
	  grouping was correct, and assigns a grade, and provides any
	  feedback.  

          <br><i>ID</i>, if this isn't set it will be set during
          the publication step. It is used to assign parameters names
          in a way that can be tracked if an instructor modifies
          things by hand.

	  <br><i>name</i> optional, if set, it will be used by the
	  resource assembly tool when one is modfiying parameters.

	</li>
	<li>
	  <b>&lt;*response&gt;</b> further documentation will be available
	  in the future. Roughly these will take a set of data from
	  the enclosed input structures, and one or more correct
	  answers and return a correct of incorrect result, it may
	  also suggest a consumption of a try, and may provide a
	  reason for the incorrectness.

	  <br>Required possible arguments:
	  
          <br><i>ID</i>, if this isn't set it will be set during
          the publication step. It is used to assign parameters names
          in a way that can be tracked if an instructor modifies
          things by hand.

	  <br><i>name</i> optional, if set, it will be used by the
	  resource assembly tool when one is modfiying parameters.
	</li>
	<li>
	  <b>&lt;responseparam&gt;</b> can appear inside a <b>&lt;*response&gt;</b>,
	  they provided config options for the <b>&lt;*response&gt;</b>
	  
	  <br><i>name</i> specifies the parameter name, what are
	  possible values depends on the <b>&lt;*response&gt;</b>

	  <br><i>type</i> specifies the possible values for this
	  type, possible arguments are: "option1|option2|option3" or
	  "numerictype,lownum-highnum" numeric type can be either int
	  or float

	  <br><i>default</i> specifies the default value for this
	  parameter if the instructor doesn't specifiy it

	  <br><i>ID</i>, if this isn't set it will be set during
	  the publication step. It is used to assign parameters names
	  in a way that can be tracked if an instructor modifies
	  things by hand.
	</li>
      </ul>
    </li>
    <li>
      Problem Contruction
      <ul>
	<li>
	  <b>&lt;problem&gt;</b> highest level tag, tells the parser that
	  this is a problem file

	  <br><i>name</i> optional, if set, it will be used by the
	  resource assembly tool when one is modfiying parameters.
	</li>
	<li>
	  <b>part needs to get much of answergroups writeup</b>
	  <b>&lt;part&gt;</b> a problem can consist of multiple parts,
	  each of these parts can be included or not included through
	  the construction of a page using the RAT, 

          <br><i>ID</i>, if this isn't set it will be set during
          the publication step. It is used to assign parameters names
          in a way that can be tracked if an instructor modifies
          things by hand.

	  <br><i>name</i> optional, if set, it will be used by the
	  resource assembly tool when one is modfiying parameters.
	</li>
	<li>
	  <b>&lt;block&gt;</b> are section of the problem that can be
	  conditional, and provide visual grouping clues. The optional
	  arg <i>condition</i> is set to a perl snippet that
	  controls whether the parser will evaluate the
	  <b>&lt;block&gt;</b> or not. Helper function will be created for
	  making hints and other study aids easy to contruct.
	</li>
	<li>
	  <b>&lt;import&gt;</b> causes the parse to read an additional
	  file in and parse it as if the entire text of file had
	  existed at the location of the <b>&lt;import&gt;</b>
	</li>
	<li>
	  <b>&lt;script&gt;</b> the enclosed body of text is parsed
	  directly in a safe Perl enviroment. Variables set here are
	  available throught the rest of the problem code, but all
	  actions taken persit only for the scope of the
	  <b>&lt;problem&gt;</b>. Except values which are expressly saved
	  and restored
	</li>
	<li>
	  <b>&lt;while&gt;</b> implements a while loop, required argument
	  <i>condition</i> is a perl scriptlet that when evaluated
	  results in a true or false value, on true the entirty of the
	  text between the whiles is parsed. The condition is tested
	  again, etc. If false it goes to the next node in the parse.
	</li>
      </ul>
    </li>
    <li>
      Libraries
      <ul>
	<li>
	  <b>&lt;parserlib&gt;</b> the enclosed name is a file that
	  contains definition for new tags.
	</li>
	<li>
	  <b>&lt;scriptlib&gt;</b> the enclosed name is a file that
	  contains extensions to the parser.
	</li>
      </ul>
    </li>
  </ul>


    <h2>CAPA compatability function Calls</h2> Please refer to the
    CAPA manual for documentation on what these functions do.
    <ul>
      <li> random </li>
      <li> random_normal </li>
      <li> random_beta </li>
      <li> random_gamma </li>
      <li> random_poisson </li>
      <li> random_exponential </li>
      <li> random_chi </li>
      <li> random_noncentral_chi </li>
      <li> choose </li>
      <li> var_in_tex </li>
      <li> capa_id </li>
      <li> class, section, set, problem, name, student_number </li>
      <li> due_date, open_date, answer_date </li>
      <li> to_string </li>
      <li> sub_string </li>
      <li> strlen </li>
      <li> get_seed </li>
      <li> set_seed </li>
      <li> init_array </li>
      <li> array_max, array_min </li>
      <li> array_moments </li>
      <li> to_int </li>
      <li> format </li>
      <li> pick </li>
      <li> sin, cos, tan, asin, acos, atan, atan2 </li>
      <li> sinh, cosh, tanh, asinh, acosh, atanh </li>
      <li> j0, j1, jn, y0, y1, yn </li>
      <li> log, log10 </li>
      <li> exp, pow </li>
      <li> erf, erfc </li>
      <li> sqrt </li>
      <li> min, max </li>
      <li> abs, floor, ceil, sgn, mod, remainder </li>
      <li> factorial </li>
      <li> roundto </li>
      <li> eval_formula </li>
      <li> capa_id_plus </li>
      <li> seat_number </li>
      <li> duration </li>
      <li> is_open, is_due, is_answer </li>
      <li> managermode </li>
    </ul>

    <hr>
    <address><a href="mailto:albertel@marvin.lite.msu.edu">Guy Albertelli</a></address>
<!-- Created: Mon Mar 27 16:14:28 EST 2000 -->
<!-- hhmts start -->
Last modified: Tue Nov 21 19:08:18 EST 2000
<!-- hhmts end -->
  </body>
</html>

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