Student Publication : Can lose file extension when renaming file
Current behavior / Resultado actual / Résultat actuel
When uploading a file my_work.png in the student publication tool, user can rename it my_work and lose file extension.
Expected behavior / Resultado esperado / Résultat attendu
Prevent student to modify file extension
Steps to reproduce / Pasos para reproducir / Étapes pour reproduire
Upload a student publication, rename it without the file extension
Chamilo Version / Versión de Chamilo / Version de Chamilo
1.11.4
Extensions are part of the filename. Let the users decide if they want to remove or change it. We don't live in the MSDOS era. However, I would love it if I could enforce "PDF ONLY" (or other formats) as a requirement for handing in student work so students are not able to submit anything else. A check should be done if the file content is really pdf or png or gif because the extension is just.. part of the filename :-)
@jderriks feel free to submit that as a new feature request. That's a legitimate good idea.
Although I agree with you @jderriks on the fact that extensions are part of the filename, most of our users are relatively uneducated and I think @baelmyhu hits the good nail here adding a bit of JS that will avoid users messing up with the extension and then teachers not understanding why it's not opening in the normal viewer. Let's make it a bit less error-prone for the final user! I have fixed a little typo and introduced a new language variable in your PR, @baelmyhu.