--- loncom/homework/daxesave.pm 2023/08/28 18:58:44 1.7 +++ loncom/homework/daxesave.pm 2023/11/19 21:28:17 1.9 @@ -1,7 +1,7 @@ # The LearningOnline Network # Convert and save a problem from Daxe. # -# $Id: daxesave.pm,v 1.7 2023/08/28 18:58:44 raeburn Exp $ +# $Id: daxesave.pm,v 1.9 2023/11/19 21:28:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,7 +43,14 @@ sub handler { my $request = shift; $request->content_type('text/plain'); - + + my %editors = &Apache::loncommon::permitted_editors(); + unless ($editors{'daxe'}) { + $request->content_type('text/plain'); + $request->print(&mt('Daxe editor not enabled for this Authoring Space')); + return OK; + } + # path should be in the form "/daxeopen/priv/..." # or "/daxeopen/uploaded/$cdom/$cnum/(docs|supplemental)/(default|\d+)/\d+/" my $path = $env{'form.path'}; @@ -125,8 +132,8 @@ sub handler { $unsupported = $1; } unless ($unsupported) { - my $url = &Apache::lonnet::finishuserfileupload($cnum,$cdom,'file', - "$type/$folder/$rid/$fname"); + my $url = &Apache::lonnet::userfileupload('file','daxesave',"$type/$folder/$rid", + undef,undef,undef,$cnum,$cdom); if ($url =~ m{^/uploaded/$cdom/$cnum/$type/$folder/$rid/}) { $request->print("ok\n"); } else {