Check if a file exists if so don't overwrite it

Thank you all again for your excellent advice. I have a lot to look into! I think time looks very promising.

Previously, I used php mail to send an email to myself with each student’s answers. I did the rest with Python.

Recently, I learned how to use rsync and ssh, so now php writes the answers to the host. I just collect each student’s answers from the webhost.

With all this talk about “race” I’m imagining this situation: my boss asks me to set an exam for 1000 new students, to level them into grades A, B or C. They do this exam on their phones. The webpage opens at 10 am and closes at 11 am. So, at 5 minutes to 11, most of the students send their answers.

How would you deal with this situation?

Currently, we use a paper multi-choice exam and I mark them with Formreturn, an excellent program written in Java.

If that’s a one-way task, you could stick with your file solution. And as long as you could differ between students, you have enough unique keys when using the students’ ids in combination with a timestamp. But as a long-term developer i would still stick to a database, i know how projects grow. At least i would use a database when it comes to any relational data.

I get it: learn sql

I made a start this morning!

That’s still easy and shouldn’t cause an issue. But, my perspective is different too. A company I architected a new system for had 6m users a week. My current company is a very well known entity in a specific industry and my current project is designed to scale vertically and horizontally when it hit the market.

1,000 seems high, but not really.

1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service