[LON-CAPA-cvs] cvs: loncom /homework simpleproblem.problem simpleproblem.problem.meta doc/loncapafiles loncapafiles.lpml

www lon-capa-cvs@mail.lon-capa.org
Sun, 06 Jul 2003 10:40:35 -0000


www		Sun Jul  6 06:40:35 2003 EDT

  Added files:                 
    /loncom/homework	simpleproblem.problem simpleproblem.problem.meta 

  Modified files:              
    /doc/loncapafiles	loncapafiles.lpml 
  Log:
  Trying to make the Simple Problem button in DOCS do something.
  
  All simple problems will have the same "published" source code, not need
  for cross-machine loading.
  
  Also no need for special treatment of these problems anywhere else in LON-CAPA.
  
  Problem type, question text, values, etc, are stored in course's resource 
  data, along with the deadlines, etc. These are already nicely cached.
  
  Will write little "editor" which sets these parameters, 
  lonsimpleproblemedit.pm.
  
  Modification should have minimal impact:
  
  * one new handler
  * two new files with the source code and metadata for the problem
  * one new command in structuretags to generate the Edit button for this
  * removal of easter egg in londocs.pm and pointing to the right URL
  
  
  
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.260 doc/loncapafiles/loncapafiles.lpml:1.261
--- doc/loncapafiles/loncapafiles.lpml:1.260	Sat Jul  5 06:07:11 2003
+++ doc/loncapafiles/loncapafiles.lpml	Sun Jul  6 06:40:35 2003
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.260 2003/07/05 10:07:11 www Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.261 2003/07/06 10:40:35 www Exp $ -->
 
 <!--
 
@@ -952,6 +952,22 @@
 a cgi-script (not mod_perl), which contacts MySQL and pulls
 out all records in "|"-separated format.
 To be used by very simple harvesting engines.
+</description>
+</file>
+<file>
+<source>loncom/homework/simpleproblem.problem</source>
+<target dist='default'>home/httpd/html/res/lib/templates/simpleproblem.problem</target>
+<categoryname>interface file</categoryname>
+<description>
+Generic resource for DOCS "Simple Problem"
+</description>
+</file>
+<file>
+<source>loncom/homework/simpleproblem.problem.meta</source>
+<target dist='default'>home/httpd/html/res/lib/templates/simpleproblem.problem.meta</target>
+<categoryname>interface file</categoryname>
+<description>
+Meta file for generic resource for DOCS "Simple Problem"
 </description>
 </file>
 <file>

Index: loncom/homework/simpleproblem.problem
+++ loncom/homework/simpleproblem.problem
<problem>

<script type="loncapa/perl">
$questiontype=&EXT('resource.0.questiontype');
unless ($questiontype) { $questiontype='radio'; }
$max=&EXT('resource.0.maxfoils');
unless ($max) { $max=10; }
$randomize=&EXT('resource.0.randomize');
unless ($randomize) { $randomize='yes'; }
$options=&EXT('resource.0.options');
unless ($options) { $options='("true","false")'; }
for ($i=1;$i<=10;$i++) {
    $value[$i]=&EXT('resource.0.value'.$i);
    unless ($value[$i]) { $value[$i]='unused'; }
    $position[$i]=&EXT('resource.0.position'.$i);
    unless ($position[$i]) { $position[$i]='random'; }
}
</script>

<startouttext />&EXT('resource.0.questiontext')<endouttext />

<block condition="&EXT('resource.0.questiontype') eq 'radio'"> 
<radiobuttonresponse max="$max" id="radiosegment" randomize="$randomize">
<foilgroup>
<foil location="$position[1]" value="$value[1]" name="radiofoil1">
<startouttext />&EXT('resource.0.text1')<endouttext />
</foil>
<foil location="$position[2]" value="$value[2]" name="radiofoil2">
<startouttext />&EXT('resource.0.text2')<endouttext />
</foil>
<foil location="$position[3]" value="$value[3]" name="radiofoil3">
<startouttext />&EXT('resource.0.text3')<endouttext />
</foil>
<foil location="$position[4]" value="$value[4]" name="radiofoil4">
<startouttext />&EXT('resource.0.text4')<endouttext />
</foil>
<foil location="$position[5]" value="$value[5]" name="radiofoil5">
<startouttext />&EXT('resource.0.text5')<endouttext />
</foil>
<foil location="$position[6]" value="$value[6]" name="radiofoil6">
<startouttext />&EXT('resource.0.text6')<endouttext />
</foil>
</foilgroup>
<foil location="$position[7]" value="$value[7]" name="radiofoil7">
<startouttext />&EXT('resource.0.text7')<endouttext />
</foil>
<foil location="$position[8]" value="$value[8]" name="radiofoil8">
<startouttext />&EXT('resource.0.text8')<endouttext />
</foil>
<foil location="$position[9]" value="$value[9]" name="radiofoil9">
<startouttext />&EXT('resource.0.text9')<endouttext />
</foil>
<foil location="$position[10]" value="$value[10]" name="radiofoil10">
<startouttext />&EXT('resource.0.text10')<endouttext />
</foil>
<hintgroup>
<startouttext />&EXT('resource.0.hinttext')<endouttext />
</hintgroup>
</radiobuttonresponse>
</block>

<block condition="&EXT('resource.0.questiontype') eq 'option'"> 
<optionresponse max="$max" id="radiosegment" randomize="$randomize">
<foilgroup options="$options">
<foil location="$position[1]" value="$value[1]" name="optionfoil1">
<startouttext />&EXT('resource.0.text1')<endouttext />
</foil>
<foil location="$position[2]" value="$value[2]" name="optionfoil2">
<startouttext />&EXT('resource.0.text2')<endouttext />
</foil>
<foil location="$position[3]" value="$value[3]" name="optionfoil3">
<startouttext />&EXT('resource.0.text3')<endouttext />
</foil>
<foil location="$position[4]" value="$value[4]" name="optionfoil4">
<startouttext />&EXT('resource.0.text4')<endouttext />
</foil>
<foil location="$position[5]" value="$value[5]" name="optionfoil5">
<startouttext />&EXT('resource.0.text5')<endouttext />
</foil>
<foil location="$position[6]" value="$value[6]" name="optionfoil6">
<startouttext />&EXT('resource.0.text6')<endouttext />
</foil>
</foilgroup>
<foil location="$position[7]" value="$value[7]" name="optionfoil7">
<startouttext />&EXT('resource.0.text7')<endouttext />
</foil>
<foil location="$position[8]" value="$value[8]" name="optionfoil8">
<startouttext />&EXT('resource.0.text8')<endouttext />
</foil>
<foil location="$position[9]" value="$value[9]" name="optionfoil9">
<startouttext />&EXT('resource.0.text9')<endouttext />
</foil>
<foil location="$position[10]" value="$value[10]" name="optionfoil10">
<startouttext />&EXT('resource.0.text10')<endouttext />
</foil>
<hintgroup>
<startouttext />&EXT('resource.0.hinttext')<endouttext />
</hintgroup>
</optionresponse>
</block>

</problem>

Index: loncom/homework/simpleproblem.problem.meta
+++ loncom/homework/simpleproblem.problem.meta

<abstract></abstract>
<author>LON-CAPA</author>
<copyright>default</copyright>
<creationdate>1057430792</creationdate>
<customdistributionfile></customdistributionfile>
<dependencies></dependencies>
<keywords></keywords>
<language>notset </language>
<lastrevisiondate>1057435470</lastrevisiondate>
<mime>problem</mime>
<notes></notes>
<owner>templates@lib</owner>
<parameter part="0" package="part"></parameter>
<stores part="0" name="awarded" type="float" display="Partial Credit Factor [Part: 0]"></stores>
<stores part="0" name="solved" type="string" display="Problem Status [Part: 0]"></stores>
<stores part="0" name="tries" type="int_zeropos" display="Number of Attempts [Part: 0]"></stores>
<subject></subject>
<title>Simple Problem Template</title>

<parameter part="0" name="totalfoils" type="int_pos" default="" display="Total Foils"></parameter>

<parameter part="0" name="maxfoils" type="int_pos" default="" display="Max Foils"></parameter>

<parameter part="0" name="questiontype" type="string" default="radio" display="Questiontype"></parameter>

<parameter part="0" name="text1" type="string" default="" display="Text 1"></parameter>

<parameter part="0" name="value1" type="string" default="true" display="Value 1"></parameter>


<parameter part="0" name="text2" type="string" default="" display="Text 2"></parameter>

<parameter part="0" name="value2" type="string" default="false" display="Value 2"></parameter>


<parameter part="0" name="text3" type="string" default="" display="Text 3"></parameter>

<parameter part="0" name="value3" type="string" default="false" display="Value 3"></parameter>


<parameter part="0" name="text4" type="string" default="" display="Text 4"></parameter>

<parameter part="0" name="value4" type="string" default="false" display="Value 4"></parameter>

<parameter part="0" name="questiontext" type="string" default="Dude!!!" display="Question Text"></parameter>