--- loncom/homework/chemresponse.pm 2021/12/24 11:07:42 1.101 +++ loncom/homework/chemresponse.pm 2025/01/27 18:43:23 1.103 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # chemical equation style response # -# $Id: chemresponse.pm,v 1.101 2021/12/24 11:07:42 raeburn Exp $ +# $Id: chemresponse.pm,v 1.103 2025/01/27 18:43:23 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -217,7 +217,7 @@ function submitSmiles() { } } function openHelpWindow() { - window.open("http://peter-ertl.com/jsme/2013_03/help.html","","scrollbars=yes,resizable=yes,width=500,height=600"); + window.open("https://jsme-editor.github.io/help.html","","scrollbars=yes,resizable=yes,width=500,height=600"); } @@ -558,10 +558,15 @@ sub start_organicstructure { my $width=&Apache::lonxml::get_param('width',$parstack,$safeeval); my $molecule=&Apache::lonxml::get_param('molecule',$parstack,$safeeval); my $options=&Apache::lonxml::get_param('options',$parstack,$safeeval); + my $alttext=&Apache::lonxml::get_param('alt',$parstack,$safeeval); + if ($alttext eq '') { + $alttext = &mt('Organic structure'); + } + $alttext = &HTML::Entities::encode($alttext,'<>&"'); my $id=&Apache::loncommon::get_cgi_id(); $result="'; &Apache::lonnet::appenv( {'cgi.'.$id.'.JME' => &escape($molecule), 'cgi.'.$id.'.PNG' => 1, @@ -610,12 +615,14 @@ sub start_organicstructure { [ ['reaction','Is a reaction'], ['border','Draw a border'] ], $token); + $result .= '
'.&Apache::edit::text_arg('Alt text in JME img tag:','alt',$token,30). + ' ('.&mt('student-viewable in HTML source').')'; $result .=&Apache::edit::end_row(); } elsif ($target eq 'modified') { my $constructtag=&Apache::edit::get_new_args($token,$parstack, $safeeval,'molecule', 'width','texwidth', - 'options'); + 'options','alt'); if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } } return $result;