Currently uploaded papers are named course_code_exam_semester_year.pdf and stored in /iqps/uploaded/. This prevents multiple people from uploading the same paper. This also means that if someone uploads an incorrect paper or low quality paper, a different person cannot upload a better paper or correctly tagged paper.
Instead, each new upload can be saved under /iqps/uploaded/unapproved/id.pdf
Once approved, it can be moved to /iqps/uploaded/approved/course_code_exam_semester_year.pdf
The frontend can warn uploader that a paper has already been uploaded (and maybe show preview) and allow them to choose to still upload if they believe their version is better.
Addendum: Currently uploaded qp details are parsed directly from the filename in the coursecode_name_year_exam_semester.pdf format. This will have to be changed for two reasons:
a. The papers are to be saved under id.pdf in the new flow.
b. Invalid characters or dangerous characters (/) could be sent and could lead to the system crashing or saving in a different folder/overwriting etc.
It would be best to send this data in a separate json.
course_code_exam_semester_year.pdf
and stored in/iqps/uploaded/
. This prevents multiple people from uploading the same paper. This also means that if someone uploads an incorrect paper or low quality paper, a different person cannot upload a better paper or correctly tagged paper./iqps/uploaded/unapproved/id.pdf
/iqps/uploaded/approved/course_code_exam_semester_year.pdf
coursecode_name_year_exam_semester.pdf
format. This will have to be changed for two reasons: a. The papers are to be saved underid.pdf
in the new flow. b. Invalid characters or dangerous characters (/
) could be sent and could lead to the system crashing or saving in a different folder/overwriting etc. It would be best to send this data in a separate json.