chamilo-lms icon indicating copy to clipboard operation
chamilo-lms copied to clipboard

Student Publication : Can lose file extension when renaming file

Open baelmyhu opened this issue 9 years ago • 3 comments

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

baelmyhu avatar Jun 13 '17 13:06 baelmyhu

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 avatar Jul 11 '17 09:07 jderriks

@jderriks feel free to submit that as a new feature request. That's a legitimate good idea.

ywarnier avatar Dec 04 '17 15:12 ywarnier

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.

ywarnier avatar Dec 04 '17 16:12 ywarnier