[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm /homework/templates CustomResponse.problem.meta DropBox.problem.meta Essay.problem.meta HintFormula.problem.meta HintMathResponse.problem.meta MultipleAnswerEither.problem.meta MultipleAnswerUnordered.problem.meta Plot_curve.problem.meta Plot_data.problem.meta RadioResponse.problem RadioResponse.problem.meta RandomLabelExample.problem.meta SelectFromOptions-4ConceptGoups.problem.meta SelectFromOptions-Simple.problem.meta SimpleFormula.problem.meta SimpleFormulaCAS.problem.meta SimpleMatching.problem.meta SimpleRank.problem.meta SimpleTrueFalse.problem.meta StringResponse.problem.meta numerical.problem numerical.problem.meta organic.problem organic.problem.meta reaction.problem.meta
www
lon-capa-cvs-allow@mail.lon-capa.org
Mon, 19 May 2008 20:38:34 -0000
This is a MIME encoded message
--www1211229514
Content-Type: text/plain
www Mon May 19 16:38:34 2008 EDT
Modified files:
/loncom/homework lonhomework.pm
/loncom/homework/templates CustomResponse.problem.meta
DropBox.problem.meta Essay.problem.meta
HintFormula.problem.meta
HintMathResponse.problem.meta
MultipleAnswerEither.problem.meta
MultipleAnswerUnordered.problem.meta
Plot_curve.problem.meta
Plot_data.problem.meta
RadioResponse.problem
RadioResponse.problem.meta
RandomLabelExample.problem.meta
SelectFromOptions-4ConceptGoups.problem.meta
SelectFromOptions-Simple.problem.meta
SimpleFormula.problem.meta
SimpleFormulaCAS.problem.meta
SimpleMatching.problem.meta
SimpleRank.problem.meta
SimpleTrueFalse.problem.meta
StringResponse.problem.meta
numerical.problem numerical.problem.meta
organic.problem organic.problem.meta
reaction.problem.meta
Log:
Bug #1724: Categories, helplinks, and examples for templates
--www1211229514
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20080519163834.txt"
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.291 loncom/homework/lonhomework.pm:1.292
--- loncom/homework/lonhomework.pm:1.291 Tue Mar 11 22:46:53 2008
+++ loncom/homework/lonhomework.pm Mon May 19 16:38:04 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.291 2008/03/12 02:46:53 raeburn Exp $
+# $Id: lonhomework.pm,v 1.292 2008/05/19 20:38:04 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1079,8 +1079,10 @@
}
my @files = glob($Apache::lonnet::perlvar{'lonIncludes'}.
'/templates/*.'.$glob_extension);
- @files = map {[$_,&mt(&Apache::lonnet::metadata($_, 'title'))]} (@files);
- @files = sort {$a->[1] cmp $b->[1]} (@files);
+ @files = map {[$_,&mt(&Apache::lonnet::metadata($_, 'title')),
+ (&Apache::lonnet::metadata($_, 'category')?&mt(&Apache::lonnet::metadata($_, 'category')):&mt('Miscellaneous')),
+ &mt(&Apache::lonnet::metadata($_, 'help'))]} (@files);
+ @files = sort {$a->[2].$a->[1] cmp $b->[2].$b->[1]} (@files);
my ($midpoint,$seconddiv,$numfiles);
$numfiles = 0;
foreach my $file (@files) {
@@ -1095,16 +1097,28 @@
}
}
my $count = 0;
+ my $currentcategory='';
foreach my $file (@files) {
next if ($file->[1] !~ /\S/);
+ if ($file->[2] ne $currentcategory) {
+ $currentcategory=$file->[2];
+ $count++;
+ if ((!$seconddiv) && ($count >= $midpoint)) {
+ $result .= '</div>'."\n".'<div class="LC_left_float">'."\n";
+ $seconddiv = 1;
+ }
+ $result.='<h3>'.$currentcategory.'</h3>';
+ }
$result .=
'<label><input type="radio" name="template" value="'.$file->[0].'" />'.
- $file->[1].'</label><br />'."\n";
- $count ++;
- if ((!$seconddiv) && ($count >= $midpoint)) {
- $result .= '</div>'."\n".'<div class="LC_left_float">'."\n";
- $seconddiv = 1;
+ $file->[1].'</label>';
+ if ($file->[3]) {
+ $result.=&Apache::loncommon::help_open_topic($file->[3]);
}
+ my $filename=$file->[0];
+ $filename=~s/^\/home\/httpd\/html//;
+ $result.=' <font size="-2"><a href="'.$filename.'" target="sample">'.&mt('Example').'</font></a><br />'."\n";
+ $count ++;
}
if ($numfiles > 0) {
$result .= '</div>'."\n".'<div class="LC_clear_float_footer"></div>'."\n";
Index: loncom/homework/templates/CustomResponse.problem.meta
diff -u loncom/homework/templates/CustomResponse.problem.meta:1.1 loncom/homework/templates/CustomResponse.problem.meta:1.2
--- loncom/homework/templates/CustomResponse.problem.meta:1.1 Tue Jul 18 13:24:39 2006
+++ loncom/homework/templates/CustomResponse.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,3 @@
<title>Custom Response</title>
+<category>Free Form</category>
+<help>Custom_Response_Problems</help>
Index: loncom/homework/templates/DropBox.problem.meta
diff -u loncom/homework/templates/DropBox.problem.meta:1.4 loncom/homework/templates/DropBox.problem.meta:1.5
--- loncom/homework/templates/DropBox.problem.meta:1.4 Wed May 23 14:25:09 2007
+++ loncom/homework/templates/DropBox.problem.meta Mon May 19 16:38:30 2008
@@ -10,3 +10,4 @@
<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>
<title>Drop Box</title>
+<category>Handgraded Problems</category>
Index: loncom/homework/templates/Essay.problem.meta
diff -u loncom/homework/templates/Essay.problem.meta:1.2 loncom/homework/templates/Essay.problem.meta:1.3
--- loncom/homework/templates/Essay.problem.meta:1.2 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/Essay.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Essay Response</title>
+<category>Handgraded Problems</category>
Index: loncom/homework/templates/HintFormula.problem.meta
diff -u loncom/homework/templates/HintFormula.problem.meta:1.1 loncom/homework/templates/HintFormula.problem.meta:1.2
--- loncom/homework/templates/HintFormula.problem.meta:1.1 Mon Jan 22 16:48:55 2007
+++ loncom/homework/templates/HintFormula.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Formula Response using Computer Algebra System and Hints</title>
+<category>Algebraic Response Problems</category>
Index: loncom/homework/templates/HintMathResponse.problem.meta
diff -u loncom/homework/templates/HintMathResponse.problem.meta:1.1 loncom/homework/templates/HintMathResponse.problem.meta:1.2
--- loncom/homework/templates/HintMathResponse.problem.meta:1.1 Mon Jan 22 16:48:55 2007
+++ loncom/homework/templates/HintMathResponse.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Math Response using Computer Algebra System and Hints</title>
+<category>Algebraic Response Problems</category>
Index: loncom/homework/templates/MultipleAnswerEither.problem.meta
diff -u loncom/homework/templates/MultipleAnswerEither.problem.meta:1.1 loncom/homework/templates/MultipleAnswerEither.problem.meta:1.2
--- loncom/homework/templates/MultipleAnswerEither.problem.meta:1.1 Fri Jul 6 13:32:41 2007
+++ loncom/homework/templates/MultipleAnswerEither.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>One of Multiple Answers Numerical Problem</title>
+<category>Numerical Problems</category>
Index: loncom/homework/templates/MultipleAnswerUnordered.problem.meta
diff -u loncom/homework/templates/MultipleAnswerUnordered.problem.meta:1.1 loncom/homework/templates/MultipleAnswerUnordered.problem.meta:1.2
--- loncom/homework/templates/MultipleAnswerUnordered.problem.meta:1.1 Fri Jul 6 13:32:41 2007
+++ loncom/homework/templates/MultipleAnswerUnordered.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Unordered Multi-Answer Formula Response Problem</title>
+<category>Algebraic Response Problems</category>
Index: loncom/homework/templates/Plot_curve.problem.meta
diff -u loncom/homework/templates/Plot_curve.problem.meta:1.1 loncom/homework/templates/Plot_curve.problem.meta:1.2
--- loncom/homework/templates/Plot_curve.problem.meta:1.1 Wed Dec 17 11:56:59 2003
+++ loncom/homework/templates/Plot_curve.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Curve Plot with Numerical Response</title>
+<category>Numerical Problems</category>
Index: loncom/homework/templates/Plot_data.problem.meta
diff -u loncom/homework/templates/Plot_data.problem.meta:1.1 loncom/homework/templates/Plot_data.problem.meta:1.2
--- loncom/homework/templates/Plot_data.problem.meta:1.1 Wed Dec 17 11:56:59 2003
+++ loncom/homework/templates/Plot_data.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Data Plot with Numerical Response</title>
+<category>Numerical Problems</category>
Index: loncom/homework/templates/RadioResponse.problem
diff -u loncom/homework/templates/RadioResponse.problem:1.9 loncom/homework/templates/RadioResponse.problem:1.10
--- loncom/homework/templates/RadioResponse.problem:1.9 Thu Feb 22 14:57:28 2007
+++ loncom/homework/templates/RadioResponse.problem Mon May 19 16:38:30 2008
@@ -32,9 +32,6 @@
</foil>
</foilgroup>
-
- <hintgroup><startouttext /><endouttext />
- </hintgroup>
</radiobuttonresponse>
Index: loncom/homework/templates/RadioResponse.problem.meta
diff -u loncom/homework/templates/RadioResponse.problem.meta:1.4 loncom/homework/templates/RadioResponse.problem.meta:1.5
--- loncom/homework/templates/RadioResponse.problem.meta:1.4 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/RadioResponse.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,3 @@
<title>Radio Button Response</title>
+<category>Multiple Choice Problems</category>
+<help>Radio_Response_Problems</help>
Index: loncom/homework/templates/RandomLabelExample.problem.meta
diff -u loncom/homework/templates/RandomLabelExample.problem.meta:1.2 loncom/homework/templates/RandomLabelExample.problem.meta:1.3
--- loncom/homework/templates/RandomLabelExample.problem.meta:1.2 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/RandomLabelExample.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Randomly Labelled Image with Option Response</title>
+<category>Multiple Choice Problems</category>
Index: loncom/homework/templates/SelectFromOptions-4ConceptGoups.problem.meta
diff -u loncom/homework/templates/SelectFromOptions-4ConceptGoups.problem.meta:1.2 loncom/homework/templates/SelectFromOptions-4ConceptGoups.problem.meta:1.3
--- loncom/homework/templates/SelectFromOptions-4ConceptGoups.problem.meta:1.2 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/SelectFromOptions-4ConceptGoups.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Option Response - Concept Groups</title>
+<category>Multiple Choice Problems</category>
Index: loncom/homework/templates/SelectFromOptions-Simple.problem.meta
diff -u loncom/homework/templates/SelectFromOptions-Simple.problem.meta:1.2 loncom/homework/templates/SelectFromOptions-Simple.problem.meta:1.3
--- loncom/homework/templates/SelectFromOptions-Simple.problem.meta:1.2 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/SelectFromOptions-Simple.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,3 @@
<title>Option Response - Matching</title>
+<category>Multiple Choice Problems</category>
+<help>Option_Response_Matching_Example</help>
Index: loncom/homework/templates/SimpleFormula.problem.meta
diff -u loncom/homework/templates/SimpleFormula.problem.meta:1.3 loncom/homework/templates/SimpleFormula.problem.meta:1.4
--- loncom/homework/templates/SimpleFormula.problem.meta:1.3 Mon Jan 22 16:48:55 2007
+++ loncom/homework/templates/SimpleFormula.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,3 @@
<title>Formula Response with Samples</title>
+<help>Formula_Response_Sampling</help>
+<category>Algebraic Response Problems</category>
Index: loncom/homework/templates/SimpleFormulaCAS.problem.meta
diff -u loncom/homework/templates/SimpleFormulaCAS.problem.meta:1.1 loncom/homework/templates/SimpleFormulaCAS.problem.meta:1.2
--- loncom/homework/templates/SimpleFormulaCAS.problem.meta:1.1 Mon Jan 22 16:48:55 2007
+++ loncom/homework/templates/SimpleFormulaCAS.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Formula Response using Computer Algebra System</title>
+<category>Algebraic Response Problems</category>
Index: loncom/homework/templates/SimpleMatching.problem.meta
diff -u loncom/homework/templates/SimpleMatching.problem.meta:1.2 loncom/homework/templates/SimpleMatching.problem.meta:1.3
--- loncom/homework/templates/SimpleMatching.problem.meta:1.2 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/SimpleMatching.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Matching Response</title>
+<category>Multiple Choice Problems</category>
Index: loncom/homework/templates/SimpleRank.problem.meta
diff -u loncom/homework/templates/SimpleRank.problem.meta:1.2 loncom/homework/templates/SimpleRank.problem.meta:1.3
--- loncom/homework/templates/SimpleRank.problem.meta:1.2 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/SimpleRank.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,3 @@
<title>Rank Response</title>
+<category>Multiple Choice Problems</category>
+<help>Ranking_Problems</help>
Index: loncom/homework/templates/SimpleTrueFalse.problem.meta
diff -u loncom/homework/templates/SimpleTrueFalse.problem.meta:1.2 loncom/homework/templates/SimpleTrueFalse.problem.meta:1.3
--- loncom/homework/templates/SimpleTrueFalse.problem.meta:1.2 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/SimpleTrueFalse.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Option Response - True/False</title>
+<category>Multiple Choice Problems</category>
Index: loncom/homework/templates/StringResponse.problem.meta
diff -u loncom/homework/templates/StringResponse.problem.meta:1.3 loncom/homework/templates/StringResponse.problem.meta:1.4
--- loncom/homework/templates/StringResponse.problem.meta:1.3 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/StringResponse.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,3 @@
<title>String Response</title>
+<category>Free Form</category>
+<help>String_Response_Problems</help>
Index: loncom/homework/templates/numerical.problem
diff -u loncom/homework/templates/numerical.problem:1.6 loncom/homework/templates/numerical.problem:1.7
--- loncom/homework/templates/numerical.problem:1.6 Thu Apr 22 13:14:30 2004
+++ loncom/homework/templates/numerical.problem Mon May 19 16:38:30 2008
@@ -7,10 +7,6 @@
What is $a + $b?<endouttext />
<numericalresponse answer="$c">
<responseparam type="tolerance" default="5%" name="tol" description="Numerical Tolerance" />
- <responseparam name="sig" type="int_range,0-16" default="0,15" description="Significant Figures" />
<textline />
- <hintgroup>
- <startouttext /><endouttext />
- </hintgroup>
</numericalresponse>
</problem>
Index: loncom/homework/templates/numerical.problem.meta
diff -u loncom/homework/templates/numerical.problem.meta:1.2 loncom/homework/templates/numerical.problem.meta:1.3
--- loncom/homework/templates/numerical.problem.meta:1.2 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/numerical.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,3 @@
<title>Numerical Response</title>
+<help>Numerical_Response_Simple_Example</help>
+<category>Numerical Problems</category>
Index: loncom/homework/templates/organic.problem
diff -u loncom/homework/templates/organic.problem:1.2 loncom/homework/templates/organic.problem:1.3
--- loncom/homework/templates/organic.problem:1.2 Tue Feb 22 14:51:39 2005
+++ loncom/homework/templates/organic.problem Mon May 19 16:38:30 2008
@@ -8,8 +8,5 @@
<endouttext />
<organicresponse jmeanswer="4 3 C 6.33 -6.22 C 7.73 -6.22 O 8.43 -7.43 O 8.43 -5.00 1 2 1 2 3 1 2 4 2" answer="CC(=O)O">
<textline readonly="yes" />
- <hintgroup showoncorrect="no">
- <startouttext /><endouttext />
- </hintgroup>
</organicresponse>
</problem>
Index: loncom/homework/templates/organic.problem.meta
diff -u loncom/homework/templates/organic.problem.meta:1.2 loncom/homework/templates/organic.problem.meta:1.3
--- loncom/homework/templates/organic.problem.meta:1.2 Tue Feb 22 14:51:39 2005
+++ loncom/homework/templates/organic.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Organic Material Response</title>
+<category>Chemistry Problems</category>
Index: loncom/homework/templates/reaction.problem.meta
diff -u loncom/homework/templates/reaction.problem.meta:1.1 loncom/homework/templates/reaction.problem.meta:1.2
--- loncom/homework/templates/reaction.problem.meta:1.1 Fri Feb 18 00:42:45 2005
+++ loncom/homework/templates/reaction.problem.meta Mon May 19 16:38:30 2008
@@ -1 +1,2 @@
<title>Chemical Reaction Response</title>
+<category>Chemistry Problems</category>
--www1211229514--