Skip to content

Commit

Permalink
add spaces before/after, change method name,
Browse files Browse the repository at this point in the history
change download content type
  • Loading branch information
as6325400 committed Sep 23, 2024
1 parent 7b977fc commit c691776
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion webapp/src/Controller/Team/SubmissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function downloadAction(int $submitId): Response
$submitId));
}

if($this->submissionService->getSubmissionFileNums($submission) == 1){
if ($this->submissionService->getSubmissionFileCount($submission) == 1) {
return $this->submissionService->getSubmissionFileResponse($submission);
}

Expand Down
4 changes: 2 additions & 2 deletions webapp/src/Service/SubmissionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -785,14 +785,14 @@ public function getSubmissionFileResponse(Submission $submission): StreamedRespo
return new StreamedResponse(function () use ($sourceCode) {
echo $sourceCode;
}, 200, [
'Content-Type' => 'application/octet-stream',
'Content-Type' => 'text/plain',
'Content-Disposition' => 'attachment; filename="' . $filename . '"',
'Content-Length' => strlen($sourceCode),
]);
}


public function getSubmissionFileNums(Submission $submission): int
public function getSubmissionFileCount(Submission $submission): int
{
$files = $submission->getFiles();
return count($files);
Expand Down

0 comments on commit c691776

Please sign in to comment.