Kast-KIIT commited on
Commit
f31e7bc
·
verified ·
1 Parent(s): ba37db9

undefined - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +9 -1
index.html CHANGED
@@ -416,7 +416,15 @@ async function submitAssignment(){
416
 
417
  /* ---------- VERIFY / DECRYPT (Teacher) ---------- */
418
  async function verifyAssignment(){
419
- const file=assignmentFile.files[0];if(!file){alert('Please select a file');return;}
 
 
 
 
 
 
 
 
420
  const reader=new FileReader();
421
  reader.onload=async e=>{
422
  try{
 
416
 
417
  /* ---------- VERIFY / DECRYPT (Teacher) ---------- */
418
  async function verifyAssignment(){
419
+ const file=assignmentFile.files[0];
420
+ if(!file){alert('Please select a file');return;}
421
+
422
+ // locks obvious mistakes to enforce the extension
423
+ if (!file.name.toLowerCase().endsWith('.task')) {
424
+ showVerificationResult(false,
425
+ 'Wrong file type – please upload a ".task" assignment file.');
426
+ return;
427
+ }
428
  const reader=new FileReader();
429
  reader.onload=async e=>{
430
  try{