[LON-CAPA-cvs] cvs: modules /josh conconvert.pl conv-wrap.pl match-con.pl

taceyjo1 lon-capa-cvs@mail.lon-capa.org
Thu, 22 Apr 2004 15:35:30 -0000


This is a MIME encoded message

--taceyjo11082648130
Content-Type: text/plain

taceyjo1		Thu Apr 22 11:35:30 2004 EDT

  Added files:                 
    /modules/josh	conv-wrap.pl match-con.pl 

  Modified files:              
    /modules/josh	conconvert.pl 
  Log:
  This little set of scripts can bulk convert NofM and matching problems from CAPA to LON-CAPA, see usage in each file for more information.  
  Saves a lot of time and energy.  PS: style police, don't look, it just isn't pretty
  
  
  
--taceyjo11082648130
Content-Type: text/plain
Content-Disposition: attachment; filename="taceyjo1-20040422113530.txt"

Index: modules/josh/conconvert.pl
diff -u modules/josh/conconvert.pl:1.2 modules/josh/conconvert.pl:1.3
--- modules/josh/conconvert.pl:1.2	Fri Aug  1 10:46:03 2003
+++ modules/josh/conconvert.pl	Thu Apr 22 11:35:30 2004
@@ -1,44 +1,30 @@
-#!/bin/perl
+#!/usr/bin/perl
 #maybe I will make this better by using command line options, etc, when 
 #I get more time
 
-chdir "/home/jt/hw";
-print "Hello\n";
-@something = glob "*";
+#USAGE: conconvert.pl <filename> it will take a NofM problem and convert it with filename <filename.problem>, or use wrapper
+
+
+
+
+#chdir "/home/jt/hw";
+print "Hello NofM\n";
+#@something = glob "*";
 #print "@something\n";
 #foreach $something (@something) {
 #	print "$something\n";
 #}
-$a = 1;
-#unshift(@something, 'glb');
+#$a = 1;
+##unshift(@something, 'glb');
 #print "@something\n";
-while ($a == 1) {
-#useless thing
-	chdir "/home/jt/hw";
-	$quest = "";
-	$s1a = "";
-	$s2a = "";
-	$s3a = "";
-	$s4a = "";
-	$s1b = "";
-	$s2b = "";
-	$s3b = "";
-	$s4b = "";
-	$s1c = "";
-	$s2c = "";
-	$s3c = "";
-	$s4c = "";
-	$s1d = "";
-	$s2d = "";
-	$s3d = "";
-	$s4d = "";
-	$dpro = 0;
-	
-$file = pop(@something);
-if ($file eq ""){
-	$a= 3;
-	last;
-	}
+#while ($a == 1) {
+
+#$file = pop(@something);
+#if ($file eq ""){
+#	$a= 3;
+#	last;
+#	}
+$file=$ARGV[0];
 open FILE, "$file";
 print "$file\n";
 @working = <FILE>;
@@ -52,7 +38,14 @@
 	if ($quest =~ m%\?%) {
 	$quest = $` . "?";
 	}
-
+	#Let there be hint support!
+	if ($working =~ m|/HIN| and $found ne '1') {
+		$hint = $';#'
+		if ($hint =~ m|No Hint|i) {}
+		else {$hint =~ s/^\s*//; 
+		$found=1;}
+		}
+		#Now we make the items.
 
 #Set 1 Block
 	if ($working =~ m%^/LET s1a="%) {
@@ -277,6 +270,353 @@
 	}
 	}
 	
+if ($working =~ m%^/LET s5a="%) {
+	$epro = 1;
+	}
+#Set 4 Block
+	if ($epro == 1)
+	{
+	if ($working =~ m%^/LET s5a="%) {
+		$s5a = $';
+		}
+	if ($s5a =~ m%\"%){
+		$s5a = $`;
+		$s5a .= '.';
+	}
+	
+	if ($working =~ m%^/LET s5b="%) {
+		$s5b = $';
+	}
+	if ($s5b =~ m%\"%){
+		$s5b = $`;
+		$s5b .= '.';
+	}
+	if ($s5b =~ m%Statement%) {
+		$s5b = "none";
+	}
+	if ($s5b eq ".") {
+		$s5b = "none";
+	}
+
+	
+	if ($working =~ m%^/LET s5c="%) {
+		$s5c = $';
+	}
+	if ($s5c =~ m%\"%){
+		$s5c = $`;
+		$s5c .= '.';
+	}
+	if ($s5c =~ m%Statement%) {
+		$s5c = "none";
+	}
+	if ($s5c eq ".") {
+		$s5c = "none";
+	}
+
+	if ($working =~ m%^/LET s5d="%) {
+		$s5d = $';
+	}
+	if ($s5d =~ m%\"%){
+		$s5d = $`;
+		$s5d .= '.';
+	}
+	if ($s5d =~ m%Statement%) {
+		$s5d = "none";
+	}
+	if ($s5d eq ".") {
+		$s5d = "none";
+	}
+	if ($working =~ m%^/LET a5a=%) {
+		$a5a = $';
+	}
+	if ($working =~ m%^/LET a5b=%) {
+		$a5b = $';
+	}
+	if ($working =~ m%^/LET a5c=%) {
+		$a5c = $';
+	}
+	if ($working =~ m%^/LET a5d=%) {
+		$a5d = $';
+	}
+	}
+	if ($working =~ m%^/LET s6a="%) {
+	$fpro = 1;
+	}
+#Set 4 Block
+	if ($fpro == 1)
+	{
+	if ($working =~ m%^/LET s6a="%) {
+		$s6a = $';
+		}
+	if ($s6a =~ m%\"%){
+		$s6a = $`;
+		$s6a .= '.';
+	}
+	
+	if ($working =~ m%^/LET s6b="%) {
+		$s6b = $';
+	}
+	if ($s6b =~ m%\"%){
+		$s6b = $`;
+		$s6b .= '.';
+	}
+	if ($s6b =~ m%Statement%) {
+		$s6b = "none";
+	}
+	if ($s6b eq ".") {
+		$s6b = "none";
+	}
+
+	
+	if ($working =~ m%^/LET s6c="%) {
+		$s6c = $';
+	}
+	if ($s6c =~ m%\"%){
+		$s6c = $`;
+		$s6c .= '.';
+	}
+	if ($s6c =~ m%Statement%) {
+		$s6c = "none";
+	}
+	if ($s6c eq ".") {
+		$s6c = "none";
+	}
+
+	if ($working =~ m%^/LET s6d="%) {
+		$s6d = $';
+	}
+	if ($s6d =~ m%\"%){
+		$s6d = $`;
+		$s6d .= '.';
+	}
+	if ($s6d =~ m%Statement%) {
+		$s6d = "none";
+	}
+	if ($s6d eq ".") {
+		$s6d = "none";
+	}
+	if ($working =~ m%^/LET a6a=%) {
+		$a6a = $';
+	}
+	if ($working =~ m%^/LET a6b=%) {
+		$a6b = $';
+	}
+	if ($working =~ m%^/LET a6c=%) {
+		$a6c = $';
+	}
+	if ($working =~ m%^/LET a6d=%) {
+		$a6d = $';
+	}
+	}
+	
+	if ($working =~ m%^/LET s7a="%) {
+	$gpro = 1;
+	}
+#Set 4 Block
+	if ($gpro == 1)
+	{
+	if ($working =~ m%^/LET s7a="%) {
+		$s7a = $';
+		}
+	if ($s7a =~ m%\"%){
+		$s7a = $`;
+		$s7a .= '.';
+	}
+	
+	if ($working =~ m%^/LET s7b="%) {
+		$s7b = $';
+	}
+	if ($s7b =~ m%\"%){
+		$s7b = $`;
+		$s7b .= '.';
+	}
+	if ($s7b =~ m%Statement%) {
+		$s7b = "none";
+	}
+	if ($s7b eq ".") {
+		$s7b = "none";
+	}
+
+	
+	if ($working =~ m%^/LET s7c="%) {
+		$s7c = $';
+	}
+	if ($s7c =~ m%\"%){
+		$s7c = $`;
+		$s7c .= '.';
+	}
+	if ($s7c =~ m%Statement%) {
+		$s7c = "none";
+	}
+	if ($s7c eq ".") {
+		$s7c = "none";
+	}
+
+	if ($working =~ m%^/LET s7d="%) {
+		$s7d = $';
+	}
+	if ($s7d =~ m%\"%){
+		$s7d = $`;
+		$s7d .= '.';
+	}
+	if ($s7d =~ m%Statement%) {
+		$s7d = "none";
+	}
+	if ($s7d eq ".") {
+		$s7d = "none";
+	}
+	if ($working =~ m%^/LET a7a=%) {
+		$a7a = $';
+	}
+	if ($working =~ m%^/LET a7b=%) {
+		$a7b = $';
+	}
+	if ($working =~ m%^/LET a7c=%) {
+		$a7c = $';
+	}
+	if ($working =~ m%^/LET a7d=%) {
+		$a7d = $';
+	}
+	}
+	if ($working =~ m%^/LET s8a="%) {
+	$hpro = 1;
+	}
+#Set 4 Block
+	if ($hpro == 1)
+	{
+	if ($working =~ m%^/LET s8a="%) {
+		$s8a = $';
+		}
+	if ($s8a =~ m%\"%){
+		$s8a = $`;
+		$s8a .= '.';
+	}
+	
+	if ($working =~ m%^/LET s8b="%) {
+		$s8b = $';
+	}
+	if ($s8b =~ m%\"%){
+		$s8b = $`;
+		$s8b .= '.';
+	}
+	if ($s8b =~ m%Statement%) {
+		$s8b = "none";
+	}
+	if ($s8b eq ".") {
+		$s8b = "none";
+	}
+
+	
+	if ($working =~ m%^/LET s8c="%) {
+		$s8c = $';
+	}
+	if ($s8c =~ m%\"%){
+		$s8c = $`;
+		$s8c .= '.';
+	}
+	if ($s8c =~ m%Statement%) {
+		$s8c = "none";
+	}
+	if ($s8c eq ".") {
+		$s8c = "none";
+	}
+
+	if ($working =~ m%^/LET s8d="%) {
+		$s8d = $';
+	}
+	if ($s8d =~ m%\"%){
+		$s8d = $`;
+		$s8d .= '.';
+	}
+	if ($s8d =~ m%Statement%) {
+		$s8d = "none";
+	}
+	if ($s8d eq ".") {
+		$s8d = "none";
+	}
+	if ($working =~ m%^/LET a8a=%) {
+		$a8a = $';
+	}
+	if ($working =~ m%^/LET a8b=%) {
+		$a8b = $';
+	}
+	if ($working =~ m%^/LET a8c=%) {
+		$a8c = $';
+	}
+	if ($working =~ m%^/LET a8d=%) {
+		$a8d = $';
+	}
+	}
+	if ($working =~ m%^/LET s9a="%) {
+	$ipro = 1;
+	}
+#Set 4 Block
+	if ($ipro == 1)
+	{
+	if ($working =~ m%^/LET s9a="%) {
+		$s9a = $';
+		}
+	if ($s9a =~ m%\"%){
+		$s9a = $`;
+		$s9a .= '.';
+	}
+	
+	if ($working =~ m%^/LET s9b="%) {
+		$s9b = $';
+	}
+	if ($s9b =~ m%\"%){
+		$s9b = $`;
+		$s9b .= '.';
+	}
+	if ($s9b =~ m%Statement%) {
+		$s9b = "none";
+	}
+	if ($s9b eq ".") {
+		$s9b = "none";
+	}
+
+	
+	if ($working =~ m%^/LET s9c="%) {
+		$s9c = $';
+	}
+	if ($s9c =~ m%\"%){
+		$s9c = $`;
+		$s9c .= '.';
+	}
+	if ($s9c =~ m%Statement%) {
+		$s9c = "none";
+	}
+	if ($s9c eq ".") {
+		$s9c = "none";
+	}
+
+	if ($working =~ m%^/LET s9d="%) {
+		$s9d = $';
+	}
+	if ($s9d =~ m%\"%){
+		$s9d = $`;
+		$s9d .= '.';
+	}
+	if ($s9d =~ m%Statement%) {
+		$s9d = "none";
+	}
+	if ($s9d eq ".") {
+		$s9d = "none";
+	}
+	if ($working =~ m%^/LET a9a=%) {
+		$a9a = $';
+	}
+	if ($working =~ m%^/LET a9b=%) {
+		$a9b = $';
+	}
+	if ($working =~ m%^/LET a9c=%) {
+		$a9c = $';
+	}
+	if ($working =~ m%^/LET a9d=%) {
+		$a9d = $';
+	}
+	}
+	
 #Ok, Lets do the answers
 	if ($working =~ m%^/LET a1a=%) {
 		$a1a = $';
@@ -328,6 +668,61 @@
 $a4c = 26;
 $a4d = 26; 
 }
+if ($epro == 0)
+{
+$s5a = "none";
+$s5b = "none";
+$s5c = "none";
+$s5d = "none";
+$a5a = 26;
+$a5b = 26;
+$a5c = 26;
+$a5d = 26; 
+}
+if ($fpro == 0)
+{
+$s6a = "none";
+$s6b = "none";
+$s6c = "none";
+$s6d = "none";
+$a6a = 26;
+$a6b = 26;
+$a6c = 26;
+$a6d = 26; 
+}
+if ($gpro == 0)
+{
+$s7a = "none";
+$s7b = "none";
+$s7c = "none";
+$s7d = "none";
+$a7a = 26;
+$a7b = 26;
+$a7c = 26;
+$a7d = 26; 
+}
+if ($hpro == 0)
+{
+$s8a = "none";
+$s8b = "none";
+$s8c = "none";
+$s8d = "none";
+$a8a = 26;
+$a8b = 26;
+$a8c = 26;
+$a8d = 26; 
+}
+if ($ipro == 0)
+{
+$s9a = "none";
+$s9b = "none";
+$s9c = "none";
+$s9d = "none";
+$a9a = 26;
+$a9b = 26;
+$a9c = 26;
+$a9d = 26; 
+}
 #print "$quest\n";
 print "......................";
 #print "$s1a\n";
@@ -381,7 +776,6 @@
 
 
 $file .= ".problem";
-chdir "/home/jt/done";
 open FILE, "> $file";
 print "$file";
 select FILE;
@@ -535,7 +929,204 @@
 }
 print '</conceptgroup>';
 }
-print '</foilgroup>
+
+if ($epro == 1){
+print '<conceptgroup concept="Five">';
+print "\n";
+if ($s5a ne "none"){
+	print '<foil name="FiveA" value="';
+	if ($a5a == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s5a";
+print '<endouttext />
+</foil>';
+}
+if ($s5b ne "none"){
+	print '<foil name="FiveB" value="';
+	if ($a5b == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s5b";
+print '<endouttext />
+</foil>';
+}
+if ($s5c ne "none"){
+	print '<foil name="FiveC" value="';
+	if ($a5c == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s5c";
+print '<endouttext />
+</foil>';
+}
+if ($s5d ne "none"){
+	print '<foil name="FiveD" value="';
+	if ($a5d == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s5d";
+print '<endouttext />
+</foil>';
+}
+print '</conceptgroup>';
+}
+
+if ($fpro == 1){
+print '<conceptgroup concept="Six">';
+print "\n";
+if ($s6a ne "none"){
+	print '<foil name="SixA" value="';
+	if ($a6a == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s6a";
+print '<endouttext />
+</foil>';
+}
+if ($s6b ne "none"){
+	print '<foil name="SixB" value="';
+	if ($a6b == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s6b";
+print '<endouttext />
+</foil>';
+}
+if ($s6c ne "none"){
+	print '<foil name="SixC" value="';
+	if ($a6c == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s6c";
+print '<endouttext />
+</foil>';
+}
+if ($s6d ne "none"){
+	print '<foil name="SixD" value="';
+	if ($a6d == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s6d";
+print '<endouttext />
+</foil>';
+}
+print '</conceptgroup>';
+}
+
+if ($gpro == 1){
+print '<conceptgroup concept="Seven">';
+print "\n";
+if ($s7a ne "none"){
+	print '<foil name="SevenA" value="';
+	if ($a7a == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s7a";
+print '<endouttext />
+</foil>';
+}
+if ($s7b ne "none"){
+	print '<foil name="SevenB" value="';
+	if ($a7b == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s7b";
+print '<endouttext />
+</foil>';
+}
+if ($s7c ne "none"){
+	print '<foil name="SevenC" value="';
+	if ($a7c == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s7c";
+print '<endouttext />
+</foil>';
+}
+if ($s7d ne "none"){
+	print '<foil name="SevenD" value="';
+	if ($a7d == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s7d";
+print '<endouttext />
+</foil>';
+}
+print '</conceptgroup>';
+}
+
+if ($hpro == 1){
+print '<conceptgroup concept="Eight">';
+print "\n";
+if ($s8a ne "none"){
+	print '<foil name="EightA" value="';
+	if ($a8a == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s8a";
+print '<endouttext />
+</foil>';
+}
+if ($s8b ne "none"){
+	print '<foil name="EightB" value="';
+	if ($a8b == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s8b";
+print '<endouttext />
+</foil>';
+}
+if ($s8c ne "none"){
+	print '<foil name="EightC" value="';
+	if ($a8c == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s8c";
+print '<endouttext />
+</foil>';
+}
+if ($s8d ne "none"){
+	print '<foil name="EightD" value="';
+	if ($a8d == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s8d";
+print '<endouttext />
+</foil>';
+}
+print '</conceptgroup>';
+}
+
+if ($ipro == 1){
+print '<conceptgroup concept="Nine">';
+print "\n";
+if ($s9a ne "none"){
+	print '<foil name="NineA" value="';
+	if ($a9a == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s9a";
+print '<endouttext />
+</foil>';
+}
+if ($s9b ne "none"){
+	print '<foil name="NineB" value="';
+	if ($a9b == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s9b";
+print '<endouttext />
+</foil>';
+}
+if ($s9c ne "none"){
+	print '<foil name="NineC" value="';
+	if ($a9c == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s9c";
+print '<endouttext />
+</foil>';
+}
+if ($s9d ne "none"){
+	print '<foil name="NineD" value="';
+	if ($a9d == 1){ print 'True"><startouttext />';}
+	else {print 'False"><startouttext />';}
+print "\u$s9d";
+print '<endouttext />
+</foil>';
+}
+print '</conceptgroup>';
+}
+print '</foilgroup>';
+if ($found eq '1') {
+print "
+<hintgroup showoncorrect=\"no\">
+    <startouttext />$hint<endouttext />
+</hintgroup>\n\n";
+}
+print '
   </optionresponse>
 </problem>';
 select STDOUT;
@@ -548,4 +1139,3 @@
 #Output! 
 
 
-}

Index: modules/josh/conv-wrap.pl
+++ modules/josh/conv-wrap.pl
#!/usr/bin/perl
#Wrapper to detect and call the script that it needs to.
#USAGE: Put this and the files match-con.pl and conconvert.pl in path, and go into a directory that has problems that need to be converted
#and use this wrapper to detect and convert the files that it can do.



use Cwd;
my $cwd = cwd();
$cwd=$cwd.'/';

print "The wrapper is wrapping\n";
@something = glob "*";
#print "@something\n";
#foreach $something (@something) {
#	print "$something\n";
#}
$a = 1;
#unshift(@something, 'glb');
#print "@something\n";
while ($a == 1) {
#useless thing
$file = pop(@something);
if ($file eq ""){
	$a= 3;
	last;
	}
open FILE, "$file";
$match=0;
$nofm=0;
while ($line = <FILE>) {
    if ($line =~ /tp1/i) { $match=1; }
    if ($line =~ /a1a/i) { $nofm=1; }
}

if ($match eq '1' and $nofm eq '0') { print "$file is matching\n"; $filename = $cwd.$file; system("match-con.pl $filename"); }
if ($nofm eq '1' and $match eq '0') { print "$file is NofM\n"; $filename = $cwd.$file; system("conconvert.pl $filename");}
if ($nofm eq '0' and $match eq '0') { print "Can't detect type, aborting!\n"; }

}

Index: modules/josh/match-con.pl
+++ modules/josh/match-con.pl
#!/usr/bin/perl
#maybe I will make this better by using command line options, etc, when 
#I get more time
#USAGE: match-con.pl <filename> will convert a matching problem from capa to lon-capa into <filename.problem> or use wrapper


#chdir '/home/jt/match-con-test';
print "Hello Matching\n";
#@something = glob "*";
#print "@something\n";
#foreach $something (@something) {
#	print "$something\n";
#}
#$a = 1;
#unshift(@something, 'glb');
#print "@something\n";
#while ($a == 1) {
#useless thing
$itemcount=1;
$counter=1;
$items[0]="TopTopTop";
#$file = pop(@something);
#if ($file eq ""){
#	$a= 3;
#	last;
#	}
$file=$ARGV[0];
open FILE, "$file";
print "$file...............................\n";
@working = <FILE>;
foreach $working (@working){
#Question Block
#I hate whitespace, a lot
chomp ($working);
$working =~ s/^\s*//; 
	if ($working =~ m%^\w%) {

	$end = $';
#' Stupid bluefish :P
	$beg = $&;
	$quest = $beg.$end;

}
	if ($quest =~ m%\?%) {
	$quest = $` . "?";

	}
	#Let there be hint support!
	if ($working =~ m|/HIN| and $found ne '1') {
		$hint = $';#'
		if ($hint =~ m|No Hint|i) {}
		else {$hint =~ s/^\s*//; 
		$found=1;}
		}
		#Now we make the items.

$item="/LET tp".$itemcount."=\""; #"
	if ($working =~ $item) {
		$temp=$';#'
		$temp =~ s/"//;#"
		$item[$itemcount]=$temp;
		$itemcount++;
		}
		
	#Ok, now we bring up the Other the things to match, can't think of better way at the moment to do this.. ahh well'
	#You've got questions '
	
	if ($working =~ m|/LET s1a=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s1a="none";}
		else { $s1a=$temp; }
		}
	if ($working =~ m|/LET s1b=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s1b="none";}
		else { $s1b=$temp; }
		}
	if ($working =~ m|/LET s1c=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s1c="none";}
		else { $s1c=$temp; }
		}
	if ($working =~ m|/LET s1d=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s1d="none";}
		else { $s1d=$temp; }
		}
	if ($s1a eq "") { $s1a="none" }
	if ($s1b eq "") { $s1b="none" }
	if ($s1c eq "") { $s1c="none" }
	if ($s1d eq "") { $s1d="none" }
	#We've got answers '
	if ($s1a eq "none") { $x1a = "none"; }
	else {
	if ($working =~ m|/LET x1a=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x1a="none";}
		else { $x1a=$temp; }
		}
		}
	if ($s1b eq "none") { $x1b = "none"; }	
	else {
	if ($working =~ m|/LET x1b=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x1b="none";}
		else { $x1b=$temp; }
		}
		}
	if ($s1c eq "none") { $x1c = "none"; }
	else {
	if ($working =~ m|/LET x1c=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x1c="none";}
		else { $x1c=$temp; }
		}
		}
	if ($s1d eq "none") { $x1d = "none"; }
	else {
	if ($working =~ m|/LET x1d=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x1d="none";}
		else { $x1d=$temp; }
		}
		}
		
	if ($x1a eq "") { $x1a="none" }
	if ($x1b eq "") { $x1b="none" }
	if ($x1c eq "") { $x1c="none" }
	if ($x1d eq "") { $x1d="none" }
	
	
	
	
	
	if ($working =~ m|/LET s2a=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s2a="none";}
		else { $s2a=$temp; }
		}
	if ($working =~ m|/LET s2b=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s2b="none";}
		else { $s2b=$temp; }
		}
	if ($working =~ m|/LET s2c=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s2c="none";}
		else { $s2c=$temp; }
		}
	if ($working =~ m|/LET s2d=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s2d="none";}
		else { $s2d=$temp; }
		}
	if ($s2a eq "") { $s2a="none" }
	if ($s2b eq "") { $s2b="none" }
	if ($s2c eq "") { $s2c="none" }
	if ($s2d eq "") { $s2d="none" }
	#We've got answers '
	if ($s2a eq "none") { $x2a = "none"; }
	else {
	if ($working =~ m|/LET x2a=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x2a="none";}
		else { $x2a=$temp; }
		}
		}
	if ($s2b eq "none") { $x2b = "none"; }	
	else {
	if ($working =~ m|/LET x2b=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x2b="none";}
		else { $x2b=$temp; }
		}
		}
	if ($s2c eq "none") { $x2c = "none"; }
	else {
	if ($working =~ m|/LET x2c=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x2c="none";}
		else { $x2c=$temp; }
		}
		}
	if ($s2d eq "none") { $x2d = "none"; }
	else {
	if ($working =~ m|/LET x2d=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x2d="none";}
		else { $x2d=$temp; }
		}
		}
		
	if ($x2a eq "") { $x2a="none" }
	if ($x2b eq "") { $x2b="none" }
	if ($x2c eq "") { $x2c="none" }
	if ($x2d eq "") { $x2d="none" }
	
	
	if ($working =~ m|/LET s3a=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s3a="none";}
		else { $s3a=$temp; }
		}
	if ($working =~ m|/LET s3b=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s3b="none";}
		else { $s3b=$temp; }
		}
	if ($working =~ m|/LET s3c=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s3c="none";}
		else { $s3c=$temp; }
		}
	if ($working =~ m|/LET s3d=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s3d="none";}
		else { $s3d=$temp; }
		}
	if ($s3a eq "") { $s3a="none" }
	if ($s3b eq "") { $s3b="none" }
	if ($s3c eq "") { $s3c="none" }
	if ($s3d eq "") { $s3d="none" }
	#We've got answers '
	if ($s3a eq "none") { $x3a = "none"; }
	else {
	if ($working =~ m|/LET x3a=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x3a="none";}
		else { $x3a=$temp; }
		}
		}
	if ($s3b eq "none") { $x3b = "none"; }	
	else {
	if ($working =~ m|/LET x3b=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x3b="none";}
		else { $x3b=$temp; }
		}
		}
	if ($s3c eq "none") { $x3c = "none"; }
	else {
	if ($working =~ m|/LET x3c=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x3c="none";}
		else { $x3c=$temp; }
		}
		}
	if ($s3d eq "none") { $x3d = "none"; }
	else {
	if ($working =~ m|/LET x3d=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x3d="none";}
		else { $x3d=$temp; }
		}
		}
		
	if ($x3a eq "") { $x3a="none" }
	if ($x3b eq "") { $x3b="none" }
	if ($x3c eq "") { $x3c="none" }
	if ($x3d eq "") { $x3d="none" }
	
	
	if ($working =~ m|/LET s4a=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s4a="none";}
		else { $s4a=$temp; }
		}
	if ($working =~ m|/LET s4b=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s4b="none";}
		else { $s4b=$temp; }
		}
	if ($working =~ m|/LET s4c=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s4c="none";}
		else { $s4c=$temp; }
		}
	if ($working =~ m|/LET s4d=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s4d="none";}
		else { $s4d=$temp; }
		}
	if ($s4a eq "") { $s4a="none" }
	if ($s4b eq "") { $s4b="none" }
	if ($s4c eq "") { $s4c="none" }
	if ($s4d eq "") { $s4d="none" }
	#We've got answers '
	if ($s4a eq "none") { $x4a = "none"; }
	else {
	if ($working =~ m|/LET x4a=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x4a="none";}
		else { $x4a=$temp; }
		}
		}
	if ($s4b eq "none") { $x4b = "none"; }	
	else {
	if ($working =~ m|/LET x4b=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x4b="none";}
		else { $x4b=$temp; }
		}
		}
	if ($s4c eq "none") { $x4c = "none"; }
	else {
	if ($working =~ m|/LET x4c=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x4c="none";}
		else { $x4c=$temp; }
		}
		}
	if ($s4d eq "none") { $x4d = "none"; }
	else {
	if ($working =~ m|/LET x4d=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x4d="none";}
		else { $x4d=$temp; }
		}
		}
		
	if ($x4a eq "") { $x4a="none" }
	if ($x4b eq "") { $x4b="none" }
	if ($x4c eq "") { $x4c="none" }
	if ($x4d eq "") { $x4d="none" }
	
	if ($working =~ m|/LET s5a=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s5a="none";}
		else { $s5a=$temp; }
		}
	if ($working =~ m|/LET s5b=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s5b="none";}
		else { $s5b=$temp; }
		}
	if ($working =~ m|/LET s5c=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s5c="none";}
		else { $s5c=$temp; }
		}
	if ($working =~ m|/LET s5d=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s5d="none";}
		else { $s5d=$temp; }
		}
	if ($s5a eq "") { $s5a="none" }
	if ($s5b eq "") { $s5b="none" }
	if ($s5c eq "") { $s5c="none" }
	if ($s5d eq "") { $s5d="none" }
	#We've got answers '
	if ($s5a eq "none") { $x5a = "none"; }
	else {
	if ($working =~ m|/LET x5a=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x5a="none";}
		else { $x5a=$temp; }
		}
		}
	if ($s5b eq "none") { $x5b = "none"; }	
	else {
	if ($working =~ m|/LET x5b=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x5b="none";}
		else { $x5b=$temp; }
		}
		}
	if ($s5c eq "none") { $x5c = "none"; }
	else {
	if ($working =~ m|/LET x5c=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x5c="none";}
		else { $x5c=$temp; }
		}
		}
	if ($s5d eq "none") { $x5d = "none"; }
	else {
	if ($working =~ m|/LET x5d=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x5d="none";}
		else { $x5d=$temp; }
		}
		}
		
	if ($x5a eq "") { $x5a="none" }
	if ($x5b eq "") { $x5b="none" }
	if ($x5c eq "") { $x5c="none" }
	if ($x5d eq "") { $x5d="none" }
	
	if ($working =~ m|/LET s6a=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s6a="none";}
		else { $s6a=$temp; }
		}
	if ($working =~ m|/LET s6b=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s6b="none";}
		else { $s6b=$temp; }
		}
	if ($working =~ m|/LET s6c=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s6c="none";}
		else { $s6c=$temp; }
		}
	if ($working =~ m|/LET s6d=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s6d="none";}
		else { $s6d=$temp; }
		}
	if ($s6a eq "") { $s6a="none" }
	if ($s6b eq "") { $s6b="none" }
	if ($s6c eq "") { $s6c="none" }
	if ($s6d eq "") { $s6d="none" }
	#We've got answers '
	if ($s6a eq "none") { $x6a = "none"; }
	else {
	if ($working =~ m|/LET x6a=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x6a="none";}
		else { $x6a=$temp; }
		}
		}
	if ($s6b eq "none") { $x6b = "none"; }	
	else {
	if ($working =~ m|/LET x6b=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x6b="none";}
		else { $x6b=$temp; }
		}
		}
	if ($s6c eq "none") { $x6c = "none"; }
	else {
	if ($working =~ m|/LET x6c=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x6c="none";}
		else { $x6c=$temp; }
		}
		}
	if ($s6d eq "none") { $x6d = "none"; }
	else {
	if ($working =~ m|/LET x6d=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x6d="none";}
		else { $x6d=$temp; }
		}
		}
		
	if ($x6a eq "") { $x6a="none" }
	if ($x6b eq "") { $x6b="none" }
	if ($x6c eq "") { $x6c="none" }
	if ($x6d eq "") { $x6d="none" }
	
	
	
		if ($working =~ m|/LET s7a=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s7a="none";}
		else { $s7a=$temp; }
		}
	if ($working =~ m|/LET s7b=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s7b="none";}
		else { $s7b=$temp; }
		}
	if ($working =~ m|/LET s7c=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s7c="none";}
		else { $s7c=$temp; }
		}
	if ($working =~ m|/LET s7d=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s7d="none";}
		else { $s7d=$temp; }
		}
	if ($s7a eq "") { $s7a="none" }
	if ($s7b eq "") { $s7b="none" }
	if ($s7c eq "") { $s7c="none" }
	if ($s7d eq "") { $s7d="none" }
	#We've got answers '
	if ($s7a eq "none") { $x7a = "none"; }
	else {
	if ($working =~ m|/LET x7a=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x7a="none";}
		else { $x7a=$temp; }
		}
		}
	if ($s7b eq "none") { $x7b = "none"; }	
	else {
	if ($working =~ m|/LET x7b=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x7b="none";}
		else { $x7b=$temp; }
		}
		}
	if ($s7c eq "none") { $x7c = "none"; }
	else {
	if ($working =~ m|/LET x7c=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x7c="none";}
		else { $x7c=$temp; }
		}
		}
	if ($s7d eq "none") { $x7d = "none"; }
	else {
	if ($working =~ m|/LET x7d=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x7d="none";}
		else { $x7d=$temp; }
		}
		}
		
	if ($x7a eq "") { $x7a="none" }
	if ($x7b eq "") { $x7b="none" }
	if ($x7c eq "") { $x7c="none" }
	if ($x7d eq "") { $x7d="none" }
	
	
	
		if ($working =~ m|/LET s8a=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s8a="none";}
		else { $s8a=$temp; }
		}
	if ($working =~ m|/LET s8b=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s8b="none";}
		else { $s8b=$temp; }
		}
	if ($working =~ m|/LET s8c=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s8c="none";}
		else { $s8c=$temp; }
		}
	if ($working =~ m|/LET s8d=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s8d="none";}
		else { $s8d=$temp; }
		}
	if ($s8a eq "") { $s8a="none" }
	if ($s8b eq "") { $s8b="none" }
	if ($s8c eq "") { $s8c="none" }
	if ($s8d eq "") { $s8d="none" }
	#We've got answers '
	if ($s8a eq "none") { $x8a = "none"; }
	else {
	if ($working =~ m|/LET x8a=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x8a="none";}
		else { $x8a=$temp; }
		}
		}
	if ($s8b eq "none") { $x8b = "none"; }	
	else {
	if ($working =~ m|/LET x8b=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x8b="none";}
		else { $x8b=$temp; }
		}
		}
	if ($s8c eq "none") { $x8c = "none"; }
	else {
	if ($working =~ m|/LET x8c=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x8c="none";}
		else { $x8c=$temp; }
		}
		}
	if ($s8d eq "none") { $x8d = "none"; }
	else {
	if ($working =~ m|/LET x8d=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x8d="none";}
		else { $x8d=$temp; }
		}
		}
		
	if ($x8a eq "") { $x8a="none" }
	if ($x8b eq "") { $x8b="none" }
	if ($x8c eq "") { $x8c="none" }
	if ($x8d eq "") { $x8d="none" }
	
	
		if ($working =~ m|/LET s9a=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s9a="none";}
		else { $s9a=$temp; }
		}
	if ($working =~ m|/LET s9b=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s9b="none";}
		else { $s9b=$temp; }
		}
	if ($working =~ m|/LET s9c=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s9c="none";}
		else { $s9c=$temp; }
		}
	if ($working =~ m|/LET s9d=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s9d="none";}
		else { $s9d=$temp; }
		}
	if ($s9a eq "") { $s9a="none" }
	if ($s9b eq "") { $s9b="none" }
	if ($s9c eq "") { $s9c="none" }
	if ($s9d eq "") { $s9d="none" }
	#We've got answers '
	if ($s9a eq "none") { $x9a = "none"; }
	else {
	if ($working =~ m|/LET x9a=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x9a="none";}
		else { $x9a=$temp; }
		}
		}
	if ($s9b eq "none") { $x9b = "none"; }	
	else {
	if ($working =~ m|/LET x9b=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x9b="none";}
		else { $x9b=$temp; }
		}
		}
	if ($s9c eq "none") { $x9c = "none"; }
	else {
	if ($working =~ m|/LET x9c=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x9c="none";}
		else { $x9c=$temp; }
		}
		}
	if ($s9d eq "none") { $x9d = "none"; }
	else {
	if ($working =~ m|/LET x9d=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x9d="none";}
		else { $x9d=$temp; }
		}
		}
		
	if ($x9a eq "") { $x9a="none" }
	if ($x9b eq "") { $x9b="none" }
	if ($x9c eq "") { $x9c="none" }
	if ($x9d eq "") { $x9d="none" }
	
	
		if ($working =~ m|/LET s10a=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s10a="none";}
		else { $s10a=$temp; }
		}
	if ($working =~ m|/LET s10b=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s10b="none";}
		else { $s10b=$temp; }
		}
	if ($working =~ m|/LET s10c=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s10c="none";}
		else { $s10c=$temp; }
		}
	if ($working =~ m|/LET s10d=\"|) { 	#"	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $s10d="none";}
		else { $s10d=$temp; }
		}
	if ($s10a eq "") { $s10a="none" }
	if ($s10b eq "") { $s10b="none" }
	if ($s10c eq "") { $s10c="none" }
	if ($s10d eq "") { $s10d="none" }
	#We've got answers '
	if ($s10a eq "none") { $x10a = "none"; }
	else {
	if ($working =~ m|/LET x10a=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x10a="none";}
		else { $x10a=$temp; }
		}
		}
	if ($s10b eq "none") { $x10b = "none"; }	
	else {
	if ($working =~ m|/LET x10b=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#" 
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x10b="none";}
		else { $x10b=$temp; }
		}
		}
	if ($s10c eq "none") { $x10c = "none"; }
	else {
	if ($working =~ m|/LET x10c=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x10c="none";}
		else { $x10c=$temp; }
		}
		}
	if ($s10d eq "none") { $x10d = "none"; }
	else {
	if ($working =~ m|/LET x10d=|) { 	
		$temp=$';#'
		$temp =~ s/"/ /;#"
		if ($temp =~ m|item| or $temp =~ m|^\s|) { $x10d="none";}
		else { $x10d=$temp; }
		}
		}
		
	if ($x10a eq "") { $x10a="none" }
	if ($x10b eq "") { $x10b="none" }
	if ($x10c eq "") { $x10c="none" }
	if ($x10d eq "") { $x10d="none" }
	
#This is the foreach loop	
}
#print "$x2a\n";
#print "$x2b\n";
#print "$x2c\n";
#print "$x2d";
#foreach $itemt (@item){ print "$itemt"; } 
#print "$quest\n";
#print "$hint";



$file .= ".problem";
chdir "/home/jt/done";
open FILE, "> $file";
print "$file";
select FILE;
print '<problem><startouttext />';
print "$quest";
print '<endouttext />'; print "\n";
print '<matchresponse max="10" randomize="yes">
    <foilgroup>
        <itemgroup location="top" randomize="yes">'; print "\n";
foreach $itempick (@item) {
if ($itempick eq "") {}
else { print '<item location="random" name="';print "$itempick\">";
print '<startouttext />';print "$itempick";print '<endouttext />
</item>'; }

}
print ' </itemgroup>'; print "\n\n";
if ($s1a eq "none" or $x1a eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x1a]\" name=\"OneA\">
       <startouttext />$s1a<endouttext />
       </foil>\n\n"; }
if ($s1b eq "none" or $x1b eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x1b]\" name=\"OneB\">
       <startouttext />$s1b<endouttext />
       </foil>\n\n"; }
if ($s1c eq "none" or $x1c eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x1c]\" name=\"OneC\">
       <startouttext />$s1c<endouttext />
       </foil>\n\n"; }
if ($s1d eq "none" or $x1d eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x1d]\" name=\"OneD\">
       <startouttext />$s1d<endouttext />
       </foil>\n\n"; }

if ($s2a eq "none" or $x2a eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x2a]\" name=\"TwoA\">
       <startouttext />$s2a<endouttext />
       </foil>\n\n"; }
if ($s2b eq "none" or $x2b eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x2b]\" name=\"TwoB\">
       <startouttext />$s2b<endouttext />
       </foil>\n\n"; }
if ($s2c eq "none" or $x2c eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x2c]\" name=\"TwoC\">
       <startouttext />$s2c<endouttext />
       </foil>\n\n"; }
if ($s2d eq "none" or $x2d eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x2d]\" name=\"TwoD\">
       <startouttext />$s2d<endouttext />
       </foil>\n\n"; }
       
if ($s3a eq "none" or $x3a eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x3a]\" name=\"ThreeA\">
       <startouttext />$s3a<endouttext />
       </foil>\n\n"; }
if ($s3b eq "none" or $x3b eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x3b]\" name=\"ThreeB\">
       <startouttext />$s3b<endouttext />
       </foil>\n\n"; }
if ($s3c eq "none" or $x3c eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x3c]\" name=\"ThreeC\">
       <startouttext />$s3c<endouttext />
       </foil>\n\n"; }
if ($s3d eq "none" or $x3d eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x3d]\" name=\"ThreeD\">
       <startouttext />$s3d<endouttext />
       </foil>\n\n"; }
       


if ($s4a eq "none" or $x4a eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x4a]\" name=\"FourA\">
       <startouttext />$s4a<endouttext />
       </foil>\n\n"; }
if ($s4b eq "none" or $x4b eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x4b]\" name=\"FourB\">
       <startouttext />$s4b<endouttext />
       </foil>\n\n"; }
if ($s4c eq "none" or $x4c eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x4c]\" name=\"FourC\">
       <startouttext />$s4c<endouttext />
       </foil>\n\n"; }
if ($s4d eq "none" or $x4d eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x4d]\" name=\"FourD\">
       <startouttext />$s4d<endouttext />
       </foil>\n\n"; }
       


if ($s5a eq "none" or $x5a eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x5a]\" name=\"FiveA\">
       <startouttext />$s5a<endouttext />
       </foil>\n\n"; }
if ($s5b eq "none" or $x5b eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x5b]\" name=\"FiveB\">
       <startouttext />$s5b<endouttext />
       </foil>\n\n"; }
if ($s5c eq "none" or $x5c eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x5c]\" name=\"FiveC\">
       <startouttext />$s5c<endouttext />
       </foil>\n\n"; }
if ($s5d eq "none" or $x5d eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x5d]\" name=\"FiveD\">
       <startouttext />$s5d<endouttext />
       </foil>\n\n"; }
       


if ($s6a eq "none" or $x6a eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x6a]\" name=\"SixA\">
       <startouttext />$s6a<endouttext />
       </foil>\n\n"; }
if ($s6b eq "none" or $x6b eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x6b]\" name=\"SixB\">
       <startouttext />$s6b<endouttext />
       </foil>\n\n"; }
if ($s6c eq "none" or $x6c eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x6c]\" name=\"SixC\">
       <startouttext />$s6c<endouttext />
       </foil>\n\n"; }
if ($s6d eq "none" or $x6d eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x6d]\" name=\"SixD\">
       <startouttext />$s6d<endouttext />
       </foil>\n\n"; }
       


if ($s7a eq "none" or $x7a eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x7a]\" name=\"SevenA\">
       <startouttext />$s7a<endouttext />
       </foil>\n\n"; }
if ($s7b eq "none" or $x7b eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x7b]\" name=\"SevenB\">
       <startouttext />$s7b<endouttext />
       </foil>\n\n"; }
if ($s7c eq "none" or $x7c eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x7c]\" name=\"SevenC\">
       <startouttext />$s7c<endouttext />
       </foil>\n\n"; }
if ($s7d eq "none" or $x7d eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x7d]\" name=\"SevenD\">
       <startouttext />$s7d<endouttext />
       </foil>\n\n"; }
       


if ($s8a eq "none" or $x8a eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x8a]\" name=\"EightA\">
       <startouttext />$s8a<endouttext />
       </foil>\n\n"; }
if ($s8b eq "none" or $x8b eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x8b]\" name=\"EightB\">
       <startouttext />$s8b<endouttext />
       </foil>\n\n"; }
if ($s8c eq "none" or $x8c eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x8c]\" name=\"EightC\">
       <startouttext />$s8c<endouttext />
       </foil>\n\n"; }
if ($s8d eq "none" or $x8d eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x8d]\" name=\"EightD\">
       <startouttext />$s8d<endouttext />
       </foil>\n\n"; }
       


if ($s9a eq "none" or $x9a eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x9a]\" name=\"NineA\">
       <startouttext />$s9a<endouttext />
       </foil>\n\n"; }
if ($s9b eq "none" or $x9b eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x9b]\" name=\"NineB\">
       <startouttext />$s9b<endouttext />
       </foil>\n\n"; }
if ($s9c eq "none" or $x9c eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x9c]\" name=\"NineC\">
       <startouttext />$s9c<endouttext />
       </foil>\n\n"; }
if ($s9d eq "none" or $x9d eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x9d]\" name=\"NineD\">
       <startouttext />$s9d<endouttext />
       </foil>\n\n"; }
       


if ($s10a eq "none" or $x10a eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x10a]\" name=\"TenA\">
       <startouttext />$s10a<endouttext />
       </foil>\n\n"; }
if ($s10b eq "none" or $x10b eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x10b]\" name=\"TenB\">
       <startouttext />$s10b<endouttext />
       </foil>\n\n"; }
if ($s10c eq "none" or $x10c eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x10c]\" name=\"TenC\">
       <startouttext />$s10c<endouttext />
       </foil>\n\n"; }
if ($s10d eq "none" or $x10d eq "none") {} else {
print "<foil location=\"random\" value=\"$item[$x10d]\" name=\"TenD\">
       <startouttext />$s10d<endouttext />
       </foil>\n\n"; }
       


if ($found eq '1') {
print "
<hintgroup showoncorrect=\"no\">
    <startouttext />$hint<endouttext />
</hintgroup>\n\n";
}














print'    </foilgroup>
</matchresponse>
</problem>';

#This is the while loop

--taceyjo11082648130--