diff --git a/site/.performance_warning_ignore.json b/site/.performance_warning_ignore.json index bf38263b9e8..96e6c494928 100644 --- a/site/.performance_warning_ignore.json +++ b/site/.performance_warning_ignore.json @@ -22,6 +22,7 @@ "/courses///gradeable//grading/graded_gradeable", "/courses///gradeable//grading/status", "/courses///gradeable//update", + "/courses///gradeable//download_zip", "/courses///forum", "/courses///forum/threads/new", "/courses///forum/threads/[0-9]+", diff --git a/site/app/controllers/MiscController.php b/site/app/controllers/MiscController.php index 6f814b5dbf3..6c01314b660 100644 --- a/site/app/controllers/MiscController.php +++ b/site/app/controllers/MiscController.php @@ -15,7 +15,6 @@ use app\libraries\response\JsonResponse; use app\views\MiscView; use Symfony\Component\Routing\Annotation\Route; -use app\models\User; class MiscController extends AbstractController { const GENERIC_NO_ACCESS_MSG = 'You do not have access to this file'; @@ -413,12 +412,7 @@ public function downloadSubmissionZip($gradeable_id, $submitter_id, $version, $i // TODO: Zip file anonymization is currently done based on access level (students==peers) // When single/double blind grading is merged, this will need to be updated. - if ($this->core->getUser()->getGroup() === User::GROUP_STUDENT) { - $zip_file_name = $gradeable_id . "_" . $anon_id . "_v" . $version . ".zip"; - } - else { - $zip_file_name = $gradeable_id . "_" . $submitter_id . "_v" . $version . ".zip"; - } + $zip_file_name = $gradeable_id . "_" . $anon_id . "_v" . $version . ".zip"; // create a new zipstream object $zip_stream = new \ZipStream\ZipStream( diff --git a/site/app/templates/grading/electronic/SubmissionPanel.twig b/site/app/templates/grading/electronic/SubmissionPanel.twig index 60f1d41cfdd..4b8b98c71e0 100644 --- a/site/app/templates/grading/electronic/SubmissionPanel.twig +++ b/site/app/templates/grading/electronic/SubmissionPanel.twig @@ -36,7 +36,8 @@ $('#' + currentCodeStyleRadio).prop('checked', true); }); - + + diff --git a/site/cypress/e2e/Cypress-TAGrading/zip_file_download.spec.js b/site/cypress/e2e/Cypress-TAGrading/zip_file_download.spec.js new file mode 100644 index 00000000000..dd94b1e761d --- /dev/null +++ b/site/cypress/e2e/Cypress-TAGrading/zip_file_download.spec.js @@ -0,0 +1,14 @@ +import path from 'path'; +describe('download zip file', () => { + const downloadsFolder = Cypress.config('downloadsFolder'); + it('downloading and verifying the file', () => { + cy.login(); + cy.visit(['sample', 'gradeable', 'grading_homework', 'grading', 'grade?who_id=hG1b13ljpDjKu32&sort=id&direction=ASC']); + cy.get('body').type('{A}'); + cy.get('body').type('{O}'); // Solution/Notes + cy.get('[data-testid="download-zip-file"]').should('contain', 'Download Zip File'); + cy.get('[data-testid="download-zip-file"]').click(); + const filename = path.join(downloadsFolder, 'grading_homework_hG1b13ljpDjKu32_v1.zip'); + cy.readFile(filename); + }); +});