version 1.122, 2014/12/06 20:08:16
|
version 1.125, 2018/11/20 19:14:14
|
Line 68 sub start_essayresponse {
|
Line 68 sub start_essayresponse {
|
($Apache::lonhomework::type eq 'anonsurveycred')) { |
($Apache::lonhomework::type eq 'anonsurveycred')) { |
$hiddendraft = '<input type="hidden" name="HWDRAFT'.$part.'_'.$id.'" value="yes" />'; |
$hiddendraft = '<input type="hidden" name="HWDRAFT'.$part.'_'.$id.'" value="yes" />'; |
} else { |
} else { |
$result = &draft_row($part,$id,$ncol,$uploadedfiletypes); |
$result = &draft_row($part,$id,$ncol,$uploadedfiletypes,'essayresponse'); |
} |
} |
if ($ncol > 0) { |
if ($ncol > 0) { |
$result .= &get_collab_row($part,$id,$coll,$ncol); |
$result .= &get_collab_row($part,$id,$coll,$ncol); |
Line 98 sub start_essayresponse {
|
Line 98 sub start_essayresponse {
|
} |
} |
|
|
sub draft_row { |
sub draft_row { |
my ($part,$id,$ncol,$uploadedfiletypes) = @_; |
my ($part,$id,$ncol,$uploadedfiletypes,$resptype) = @_; |
my $status_text = &mt('Submission type'); |
my $status_text = &mt('Submission type'); |
if ($Apache::lonhomework::history{"resource.$part.award"} eq 'DRAFT') { |
if ($Apache::lonhomework::history{"resource.$part.award"} eq 'DRAFT') { |
$status_text .= '<br />'.&mt('(Currently -- draft)'); |
$status_text .= '<br />'.&mt('(Currently -- draft)'); |
Line 107 sub draft_row {
|
Line 107 sub draft_row {
|
unless ($ncol || $uploadedfiletypes) { |
unless ($ncol || $uploadedfiletypes) { |
$closure = 1; |
$closure = 1; |
} |
} |
|
my %label = ( |
|
draft => { |
|
essayresponse => &mt('Save entries below (not submitted for credit yet)'), |
|
externalresponse => &mt('Save entries below (not submitted for grading yet)'), |
|
}, |
|
submit => { |
|
essayresponse => &mt('Submit entries below as answer to receive credit'), |
|
externalresponse => &mt('Submit entries below for grading'), |
|
} |
|
); |
return &Apache::lonhtmlcommon::row_title($status_text). |
return &Apache::lonhtmlcommon::row_title($status_text). |
'<label>'. |
'<label>'. |
'<input type="radio" name="HWDRAFT'.$part.'_'.$id.'" value="yes" checked="checked" />'. |
'<input type="radio" name="HWDRAFT'.$part.'_'.$id.'" value="yes" checked="checked" />'. |
' '.&mt('Submit entries below as answer to receive credit').'</label> <br />'. |
' '.$label{'submit'}{$resptype}.'</label> <br />'. |
'<label>'. |
'<label>'. |
'<input type="radio" name="HWDRAFT'.$part.'_'.$id.'" value="no" /> '. |
'<input type="radio" name="HWDRAFT'.$part.'_'.$id.'" value="no" /> '. |
&mt('Save entries below (not submitted for credit yet)'). |
$label{'draft'}{$resptype}.'</label>'. |
'</label>'. |
|
&Apache::lonhtmlcommon::row_closure($closure); |
&Apache::lonhtmlcommon::row_closure($closure); |
} |
} |
|
|
Line 217 sub end_essayresponse {
|
Line 226 sub end_essayresponse {
|
&escape($crsid)); |
&escape($crsid)); |
my $essayurl= |
my $essayurl= |
&Apache::lonnet::declutter($ENV{'REQUEST_URI'}); |
&Apache::lonnet::declutter($ENV{'REQUEST_URI'}); |
my ($adom,$aname,$apath)= |
if ($essayurl eq 'lib/templates/simpleproblem.problem') { |
($essayurl=~/^($LONCAPA::domain_re)\/($LONCAPA::username_re)\/(.*)$/); |
my %crsinfo = &Apache::lonnet::coursedescription($crsid); |
$apath=&escape($apath); |
my $cdom = $crsinfo{'domain'}; |
$apath=~s/\W/\_/gs; |
my $cnum = $crsinfo{'num'}; |
&Apache::lonnet::put('nohist_essay_'.$apath, |
my ($map,$id,$res) = &Apache::lonnet::decode_symb($symb); |
{ $akey => $response },$adom,$aname); |
if ($map =~ m{^\Quploaded/$cdom/$cnum/\E(default(?:|_\d+)\.(?:sequence|page))$}) { |
|
my $apath = $1.'_'.$id; |
|
$apath=~s/\W/\_/gs; |
|
my $akey = join('.',&escape($name),&escape($domain)); |
|
&Apache::lonnet::put('nohist_essay_'.$apath, |
|
{ $akey => $response },$cdom,$cnum); |
|
} |
|
} else { |
|
my ($adom,$aname,$apath)= |
|
($essayurl=~/^($LONCAPA::domain_re)\/($LONCAPA::username_re)\/(.*)$/); |
|
$apath=&escape($apath); |
|
$apath=~s/\W/\_/gs; |
|
&Apache::lonnet::put('nohist_essay_'.$apath, |
|
{ $akey => $response },$adom,$aname); |
|
} |
} |
} |
} |
} |
} |
} |
} |
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::end_table(); |
$result.=&Apache::edit::end_table(); |
|
|
Line 318 sub file_submission {
|
Line 341 sub file_submission {
|
if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"} || |
if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"} || |
$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"}) { |
$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"}) { |
if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}) { |
if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}) { |
@portfiles = split(/,/,$Apache::lonhomework::history{"resource.$part.$id.portfiles"}); |
my @possfiles = split(/,/,$Apache::lonhomework::history{"resource.$part.$id.portfiles"}); |
|
foreach my $file (@possfiles) { |
|
my ($path,$name) = ($file =~ m{^(.*/)([^/]+)$}); |
|
my ($origname,$version,$ext) = &Apache::lonnet::file_name_version_ext($name); |
|
unless ($version) { |
|
push(@portfiles,$file); |
|
} |
|
} |
} |
} |
$uploadedurl = $Apache::lonhomework::history{"resource.$part.$id.uploadedurl"}; |
$uploadedurl = $Apache::lonhomework::history{"resource.$part.$id.uploadedurl"}; |
if (ref($deletions) eq 'ARRAY') { |
if (ref($deletions) eq 'ARRAY') { |