diff --git a/frontend/app/[locale]/components/SubmissionDetailsPage.tsx b/frontend/app/[locale]/components/SubmissionDetailsPage.tsx index 9c17b61e..8dcf278d 100644 --- a/frontend/app/[locale]/components/SubmissionDetailsPage.tsx +++ b/frontend/app/[locale]/components/SubmissionDetailsPage.tsx @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next"; import React, { useEffect, useState } from "react"; import { getProjectFromSubmission, getSubmission, Project, Submission } from "@lib/api"; -import { Button, Card, CardContent, Grid, LinearProgress, ThemeProvider, Divider, Typography } from "@mui/material"; +import { Button, Card, CardContent, Grid, LinearProgress, ThemeProvider, Divider, Typography, Paper } from "@mui/material"; import ProjectReturnButton from "@app/[locale]/components/ProjectReturnButton"; import { baseTheme } from "@styles/theme"; import CheckIcon from "@mui/icons-material/Check"; @@ -95,7 +95,6 @@ const SubmissionDetailsPage: React.FC = ({ locale, s {`(${t("timestamp")}: ${formatDate(submission?.timestamp ?? "")})`} -
{submission?.output_simple_test ? ( {t("simple_tests_ok")} @@ -105,20 +104,58 @@ const SubmissionDetailsPage: React.FC = ({ locale, s {t("simple_tests_failed")} )} -
-
- {submission?.eval_result ? ( - - {t("advanced_tests_ok")} - - ):( - - {t("advanced_tests_failed")} - - )} -
+ { + !submission?.output_simple_test ? ( + <> + + + {submission?.feedback_simple_test?.["0"].length > 0 ? ( + <> + + {t("feedback_simple_test_0")} + + {submission?.feedback_simple_test["0"].map((feedback, index) => ( + + {feedback} + + ))} + + ) : null} + + {submission?.feedback_simple_test?.["2"].length > 0 ? ( + <> + + {t("feedback_simple_test_2")} + + {submission?.feedback_simple_test["2"].map((feedback, index) => ( + + {feedback} + + ))} + + ) : null} + + ) : null + } + + {submission?.eval_result ? ( + + {t("advanced_tests_ok")} + + ):( + + {t("advanced_tests_failed")} + + )} + { + submission?.eval_output ? ( + + {submission?.eval_output} + + ) : null + } + - @@ -129,48 +166,27 @@ const SubmissionDetailsPage: React.FC = ({ locale, s variant="contained" color="primary" startIcon={} - href={`${backend_url}/submissions/${submission_id}/download`} + href={`${backend_url}/submissions_${submission_id}`} download size="small" > {t("download_file")} + + {t("artifacts")} + + - { - !submission?.output_simple_test ? ( - <> - - - {submission?.feedback_simple_test?.["0"].length > 0 ? ( - <> - - {t("feedback_simple_test_0")} - - {submission?.feedback_simple_test["0"].map((feedback, index) => ( - - {feedback} - - ))} - - ) : null} - - {submission?.feedback_simple_test?.["2"].length > 0 ? ( - <> - - {t("feedback_simple_test_2")} - - {submission?.feedback_simple_test["2"].map((feedback, index) => ( - - {feedback} - - ))} - - ) : null} - - ) : null - } - diff --git a/frontend/locales/en/common.json b/frontend/locales/en/common.json index b105428c..9324ad53 100644 --- a/frontend/locales/en/common.json +++ b/frontend/locales/en/common.json @@ -101,7 +101,7 @@ "visibility": "Visibility", "year": "Year", "archive_course": "Archive course", - "download_file": "Download", + "download_file": "Download files", "denied": "Denied", "show_more": "Show more", "show_less": "Show less", @@ -159,5 +159,7 @@ "simple_tests_failed": "File structure tests: Failed", "advanced_tests_failed": "Advanced tests: Failed", "simple_tests_ok": "File structure tests: OK", - "advanced_tests_ok": "Advanced tests: OK" + "advanced_tests_ok": "Advanced tests: OK", + "download_artifacts": "Download artifacts", + "artifacts": "Artifacts" } \ No newline at end of file diff --git a/frontend/locales/nl/common.json b/frontend/locales/nl/common.json index f53cc816..8ead7b5b 100644 --- a/frontend/locales/nl/common.json +++ b/frontend/locales/nl/common.json @@ -99,7 +99,7 @@ "view_co_teachers": "Bekijk mede-docenten", "view_students": "Bekijk studenten", "visibility": "Zichtbaarheid", - "download_file": "Download", + "download_file": "Download bestanden", "denied": "Geweigerd", "show_more": "Toon meer", "show_less": "Toon minder", @@ -163,5 +163,7 @@ "simple_tests_failed": "Bestandsstructuur tests: Gefaald", "advanced_tests_failed": "Geadvanceerde tests: Gefaald", "simple_tests_ok": "Bestandsstructuur: OK", - "advanced_tests_ok": "Geadvanceerde tests: OK" + "advanced_tests_ok": "Geadvanceerde tests: OK", + "download_artifacts": "Download artefacten", + "artifacts": "Artefacten" } \ No newline at end of file