@@ -1237,7 +1237,7 @@ sub SOLUTION {
1237
1237
1238
1238
if ($displayMode =~/HTML / and $envir ->{use_knowls_for_solutions }) {
1239
1239
TEXT ($PAR , knowlLink(SOLUTION_HEADING (), value => escapeSolutionHTML("$BR$solution_body$PAR" ),
1240
- base64 => 1 ));
1240
+ base64 => 1 , type => 'solution' ));
1241
1241
} elsif ($displayMode =~ /TeX /) {
1242
1242
TEXT (
1243
1243
"\n%%% BEGIN SOLUTION\n" , #Marker used in PreTeXt LaTeX extraction ; contact alex . jordan@pcc.edu before modifying
@@ -1299,7 +1299,7 @@ sub hint {
1299
1299
sub HINT {
1300
1300
if ($displayMode =~/HTML / and $envir ->{use_knowls_for_hints }) {
1301
1301
TEXT ($PAR , knowlLink(HINT_HEADING (), value => escapeSolutionHTML($BR . hint(@_) . $PAR),
1302
- base64 => 1 )) if hint(@_ );
1302
+ base64 => 1 , type => 'hint' )) if hint(@_ );
1303
1303
} elsif ($displayMode =~ /TeX /) {
1304
1304
TEXT (
1305
1305
"\n%%% BEGIN HINT\n" , #Marker used in PreTeXt LaTeX extraction ; contact alex . jordan@pcc.edu before modifying
@@ -2391,12 +2391,12 @@ =head2 Formatting macros
2391
2391
OL (@array ) # formats the array as an Ordered List ( <OL > </OL > ) enumerated by letters .
2392
2392
# See BeginList() and EndList in unionLists.pl for a more powerful version
2393
2393
# of this macro.
2394
- knowlLink ($display_text , url => $url , value =>'' )
2394
+ knowlLink ($display_text , url => $url , value =>'' , type => '' )
2395
2395
# Places a reference to a knowl for the URL with the specified text in the problem .
2396
- # A common usage is \{ 'for help', url =>knowlLink(alias('prob1_help.html') \} )
2396
+ # A common usage is \{ 'for help', url =>knowlLink(alias('prob1_help.html')) \} )
2397
2397
# where alias finds the full address of the prob1_help.html file in the same directory
2398
2398
# as the problem file
2399
- knowlLink ($display_text , url => '' , value = <<EOF ); # this starts a here document that ends at EOF (left justified )
2399
+ knowlLink ($display_text , url => '' , type => '' , value = <<EOF ); # this starts a here document that ends at EOF (left justified )
2400
2400
help text goes here . ....
2401
2401
EOF
2402
2402
# This version of the knowl reference facilitates immediate reference to a HERE document
@@ -2579,11 +2579,11 @@ sub htmlLink {
2579
2579
2580
2580
sub knowlLink {
2581
2581
# an new syntax for knowlLink that facilitates a local HERE document
2582
- # suggested usage knowlLink(text , [url => . .., value => ....])
2582
+ # suggested usage knowlLink(text , [url => . .., value => ..., type => .. .])
2583
2583
my $display_text = shift ;
2584
2584
my @options = @_ ; # so we can check parity
2585
2585
my %options = @options ;
2586
- WARN_MESSAGE ('usage knowlLink($display_text, [url => $url, value => $helpMessage] );' .
2586
+ WARN_MESSAGE ('usage knowlLink($display_text, [url => $url, value => $helpMessage, type => "help/hint/solution/..." ] );' .
2587
2587
qq !after the display_text the information requires key /value pairs .
2588
2588
Received @options !, scalar(@options )%2 ) if scalar(@options )%2 ;
2589
2589
# check that options has an even number of inputs
@@ -2596,7 +2596,10 @@ sub knowlLink {
2596
2596
$properties = qq ! knowl = "$options{url}" !;
2597
2597
}
2598
2598
else {
2599
- WARN_MESSAGE ('usage knowlLink($display_text, [url => $url, value => $helpMessage] );' );
2599
+ WARN_MESSAGE ('usage knowlLink($display_text, [url => $url, value => $helpMessage, type => "help/hint/solution/..."] );' );
2600
+ }
2601
+ if ($options {type }) {
2602
+ $properties . = qq! data-type = "$options{type}"!;
2600
2603
}
2601
2604
#my $option_string = qq!url = "$options{url}" value = "$options{value}" !;
2602
2605
MODES (
@@ -2625,7 +2628,7 @@ sub helpLink {
2625
2628
my $helpurl = shift ;
2626
2629
return "" if(not defined($envir {'localHelpURL' }));
2627
2630
if (defined $helpurl ) {
2628
- return knowlLink($display_text , url => $envir {'localHelpURL' }. $helpurl);
2631
+ return knowlLink($display_text , url => $envir {'localHelpURL' }. $helpurl, type => 'help' );
2629
2632
}
2630
2633
my %typeHash = (
2631
2634
'angle' => 'Entering-Angles.html' ,
@@ -2662,7 +2665,7 @@ sub helpLink {
2662
2665
2663
2666
# If infoRef is still '' , we give up and just print plain text
2664
2667
return $display_text unless ($infoRef );
2665
- return knowlLink($display_text , url => $envir {'localHelpURL' }. $infoRef);
2668
+ return knowlLink($display_text , url => $envir {'localHelpURL' }. $infoRef, type => 'help' );
2666
2669
# Old way of doing this:
2667
2670
# return htmlLink( $envir{'localHelpURL'}.$infoRef, $type1,
2668
2671
#'target="ww_help" onclick="window.open(this.href, this.target, \'width=550, height=350, scrollbars=yes, resizable=on\'); return false;"');
0 commit comments