File:  [LON-CAPA] / loncom / homework / simpleproblem.problem
Revision 1.13: download - view: text, annotated - select for diffs
Thu Nov 8 22:04:43 2012 UTC (11 years, 5 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_12_X, version_2_11_X, 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, HEAD
- Consistent interface for templated pages (bug 6128).
  - simpleeditbutton tag no longer required.

    1: <problem>
    2: <script type="loncapa/perl">
    3: $questiontype=&EXT('resource.0.hiddenparts');
    4: if ($questiontype eq '!placeholder') { $questiontype=''; }
    5: $max=&EXT('resource.0.maxfoils');
    6: unless ($max) { $max=10; }
    7: $randomize=&EXT('resource.0.randomize');
    8: unless ($randomize) { $randomize='yes'; }
    9: $options=&EXT('resource.0.options');
   10: unless ($options) { $options='("true","false")'; }
   11: for ($i=1;$i<=10;$i++) {
   12:     $value[$i]=&EXT('resource.0.value'.$i);
   13:     unless ($value[$i]) { $value[$i]='unused'; }
   14:     $position[$i]=&EXT('resource.0.position'.$i);
   15:     unless ($position[$i]) { $position[$i]='random'; }
   16: }
   17: $stringanswer=&EXT('resource.0.stringanswer');
   18: unless ($stringanswer) { $stringanswer=''; }
   19: $stringtype=&EXT('resource.0.stringtype');
   20: unless ($stringtype) { $stringtype='cs'; }
   21: $numericalanswer=&EXT('resource.0.numericalanswer');
   22: unless ($numericalanswer) { $numericalanswer=''; }
   23: $numericaltolerance=&EXT('resource.0.numericaltolerance');
   24: unless ($numericaltolerance) { $numericaltolerance='5%'; }
   25: $numericalsigfigs=&EXT('resource.0.numericalsigfigs');
   26: unless ($numericalsigfigs) { $numericalsigfigs='1,15'; }
   27: $numericalunit=&EXT('resource.0.numericalunit');
   28: unless ($numericalunit) { $numericalunit=''; }
   29: $numericalformat=&EXT('resource.0.numericalformat');
   30: unless ($numericalformat) { $numericalformat=''; }
   31: $numericalscript=&EXT('resource.0.numericalscript');
   32: unless ($numericalscript) { $numericalscript=''; }
   33: </script>
   34: 
   35: <parameter name="hiddenparts" id="11" type="string" default="!placeholder" description="List of hidden parts" />
   36: 
   37: <block condition="!$questiontype"> 
   38: <startouttext />
   39: <h1>Problem Placeholder</h1>
   40: <endouttext />
   41: <part id="placeholder">
   42: <stringresponse id="placeholdersegment">
   43: </stringresponse>
   44: </part>
   45: </block>
   46: 
   47: <block condition="$questiontype"> 
   48: 
   49: <part id="radio">
   50: <startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
   51: 
   52: <radiobuttonresponse max="$max" id="radiosegment" randomize="$randomize">
   53: <foilgroup>
   54: <foil location="$position[1]" value="$value[1]" name="radiofoil1">
   55: <startouttext /><parse>&EXT('resource.0.text1')</parse><endouttext />
   56: </foil>
   57: <foil location="$position[2]" value="$value[2]" name="radiofoil2">
   58: <startouttext /><parse>&EXT('resource.0.text2')</parse><endouttext />
   59: </foil>
   60: <foil location="$position[3]" value="$value[3]" name="radiofoil3">
   61: <startouttext /><parse>&EXT('resource.0.text3')</parse><endouttext />
   62: </foil>
   63: <foil location="$position[4]" value="$value[4]" name="radiofoil4">
   64: <startouttext /><parse>&EXT('resource.0.text4')</parse><endouttext />
   65: </foil>
   66: <foil location="$position[5]" value="$value[5]" name="radiofoil5">
   67: <startouttext /><parse>&EXT('resource.0.text5')</parse><endouttext />
   68: </foil>
   69: <foil location="$position[6]" value="$value[6]" name="radiofoil6">
   70: <startouttext /><parse>&EXT('resource.0.text6')</parse><endouttext />
   71: </foil>
   72: <foil location="$position[7]" value="$value[7]" name="radiofoil7">
   73: <startouttext /><parse>&EXT('resource.0.text7')</parse><endouttext />
   74: </foil>
   75: <foil location="$position[8]" value="$value[8]" name="radiofoil8">
   76: <startouttext /><parse>&EXT('resource.0.text8')</parse><endouttext />
   77: </foil>
   78: <foil location="$position[9]" value="$value[9]" name="radiofoil9">
   79: <startouttext /><parse>&EXT('resource.0.text9')</parse><endouttext />
   80: </foil>
   81: <foil location="$position[10]" value="$value[10]" name="radiofoil10">
   82: <startouttext /><parse>&EXT('resource.0.text10')</parse><endouttext />
   83: </foil>
   84: </foilgroup>
   85: <hintgroup>
   86: <startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
   87: </hintgroup>
   88: </radiobuttonresponse>
   89: </part>
   90: 
   91: <part id="option"> 
   92: <startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
   93: <optionresponse max="$max" id="optionsegment" randomize="$randomize">
   94: <foilgroup options="$options">
   95: <foil location="$position[1]" value="$value[1]" name="optionfoil1">
   96: <startouttext /><parse>&EXT('resource.0.text1')</parse><endouttext />
   97: </foil>
   98: <foil location="$position[2]" value="$value[2]" name="optionfoil2">
   99: <startouttext /><parse>&EXT('resource.0.text2')</parse><endouttext />
  100: </foil>
  101: <foil location="$position[3]" value="$value[3]" name="optionfoil3">
  102: <startouttext /><parse>&EXT('resource.0.text3')</parse><endouttext />
  103: </foil>
  104: <foil location="$position[4]" value="$value[4]" name="optionfoil4">
  105: <startouttext /><parse>&EXT('resource.0.text4')</parse><endouttext />
  106: </foil>
  107: <foil location="$position[5]" value="$value[5]" name="optionfoil5">
  108: <startouttext /><parse>&EXT('resource.0.text5')</parse><endouttext />
  109: </foil>
  110: <foil location="$position[6]" value="$value[6]" name="optionfoil6">
  111: <startouttext /><parse>&EXT('resource.0.text6')</parse><endouttext />
  112: </foil>
  113: <foil location="$position[7]" value="$value[7]" name="optionfoil7">
  114: <startouttext /><parse>&EXT('resource.0.text7')</parse><endouttext />
  115: </foil>
  116: <foil location="$position[8]" value="$value[8]" name="optionfoil8">
  117: <startouttext /><parse>&EXT('resource.0.text8')</parse><endouttext />
  118: </foil>
  119: <foil location="$position[9]" value="$value[9]" name="optionfoil9">
  120: <startouttext /><parse>&EXT('resource.0.text9')</parse><endouttext />
  121: </foil>
  122: <foil location="$position[10]" value="$value[10]" name="optionfoil10">
  123: <startouttext /><parse>&EXT('resource.0.text10')</parse><endouttext />
  124: </foil>
  125: </foilgroup>
  126: <hintgroup>
  127: <startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
  128: </hintgroup>
  129: </optionresponse>
  130: </part>
  131: 
  132: <part id="essay"> 
  133: <startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
  134: <essayresponse id="essaysegment">
  135: <textfield></textfield>
  136: </essayresponse>
  137: </part>
  138: 
  139: <part id="string"> 
  140: <startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
  141: <stringresponse answer="$stringanswer" id="stringsegment" type="$stringtype">
  142: <textline>
  143: </textline>
  144: <hintgroup>
  145: <startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
  146: </hintgroup>
  147: </stringresponse>
  148: </part>
  149: 
  150: <part id="numerical">
  151: <script type="loncapa/perl">
  152: $tag='script';
  153: &xmlparse("<$tag type='loncapa/perl'>$numericalscript</$tag>");
  154: </script>
  155: <startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
  156: <numericalresponse unit="$numericalunit" format="$numericalformat" answer="$numericalanswer" id="numericalsegment">
  157: <responseparam name="tol" type="tolerance" default="$numericaltolerance" description="Numerical Tolerance" />
  158: <responseparam name="sig" type="int_range,0-16" default="$numericalsigfigs" description="Significant Figures" />
  159: <textline>
  160: </textline>
  161: <hintgroup>
  162: <startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
  163: </hintgroup>
  164: </numericalresponse>
  165: </part>
  166: 
  167: </block>
  168: </problem>
  169: 
  170: 

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