SMILEConsortium / node-smile-server

3 stars 4 forks source link

Prevent duplicated data #2

Closed pinazo closed 11 years ago

pinazo commented 11 years ago

Make sure the server does not allow duplicated data such as questions and students.

pinazo commented 11 years ago

The server currently accepts duplicated questions. We should find a way to avoid this.

pinazo commented 11 years ago

I left the management of students to the issue #3.

pinazo commented 11 years ago

Technically speaking, I changed the server code to use a sha1 hash code created by the attributes Q, O1, O2, O3, O4 and A of a question, and to allow registering of only one question per hash code, even for different students. When trying to add a duplicated question, the server ignores it and logs a warning.

truedat101 commented 11 years ago

Do we need to send an error message back to the client application instead of silently ignoring the warning? An error 500? Or send back 200 with a response message containing the error condition?

pinazo commented 11 years ago

I am trying to not break current protocol until we define a new one. I would suggest to send back 406 with the error condition.

On Friday, April 19, 2013, truedat101 wrote:

Do we need to send an error message back to the client application instead of silently ignoring the warning? An error 500? Or send back 200 with a response message containing the error condition?

— Reply to this email directly or view it on GitHubhttps://github.com/SMILEConsortium/node-smile-server/issues/2#issuecomment-16628861 .


Juan Pinazo

truedat101 commented 11 years ago

Ok, good point. I'm going to hold this open until I verify on a large scale integration test. I'll run one at Marvell on Thursday. No action needed until then, unless I find an issue before then.

truedat101 commented 11 years ago

I'll close this. If we can reproduce the problem at one of the school pilot projects, we'll re-open.