Skip to content
Snippets Groups Projects
Commit b02ec70d authored by HerrWaechter's avatar HerrWaechter
Browse files

Added textelement showing upload to tutor aswell

parent 7506eccb
No related branches found
No related tags found
No related merge requests found
......@@ -136,6 +136,12 @@
.box {
min-width: 285px;
}
#Uploaded {
display: none;
padding: 0.5rem 1rem;
border: 1px solid #ddd;
border-radius: 20px;
}
</style>
</head>
<body>
......@@ -160,16 +166,21 @@
/>
<div class="box">
Points:
<div class="boxinput">
<div class="boxinput" id="points">
<input
type="number"
id="kommazahl"
name="kommazahl"
step="0.01"
step="0.5"
min="0"
/>
</div>
</div>
<button class="box">Submit</button>
<button class="box" id="submitButton">Submit</button>
<div class = "navbar" id="Uploaded" >
Upload Assignments:
</div>
</div>
<div class="divider"></div>
......@@ -198,6 +209,8 @@
// Datei-Auswahl
const uploadButton = document.getElementById("uploadButton");
const fileInput = document.getElementById("fileInput");
const uploadedFile = document.getElementById("Uploaded");
uploadedFile.innerHTML = "Uploaded Assignments: ";
uploadButton.addEventListener("click", () => {
fileInput.click(); // Öffnet das Dateiauswahlfenster
......@@ -205,6 +218,8 @@
fileInput.addEventListener("change", (event) => {
const files = event.target.files; // Ausgewählte Dateien
uploadedFile.style.display = "block";
uploadedFile.innerHTML += `<br> ${files[0].name}`;
if (files.length > 0) {
// Überprüfung im JavaScript (optional)
const allowedExtensions = [
......@@ -231,6 +246,14 @@
}
});
submitButton.addEventListener("click", () => {
uploadedFile.innerHTML = "Uploaded Assignments: ";
uploadedFile.style.display = "none";
const point = document.getElementById("kommazahl");
alert("Correction submitted of " + point.value + " successfully!");
point.value = "0";
});
// Download-Funktion
const downloadButton =
document.getElementById("downloadButton");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment