Giter Club home page Giter Club logo

Comments (27)

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024 1

@MasterPi-2124

first one: Yes thats what I meaned, just like a studentList, IPList will make it easier to check if IP is in the list or not
With GET quizRecords/quizID, I think we can both check IP and studentID in that, same method. So an additional IPList is not necessary anymore if I still need to query studentID in studentList

I mean, it may not be necessary, but it can help the front with data handling. I can add both IPList and studentIdList if it helps

maybe just let me handle with studentList for simply

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024 1

@MasterPi-2124

  1. The student location is too far

A record can also contain empty studentId and studentName, but IP is the failed IP
note param now is FAIL_DISTANCE

What do you mean failed IP? Do you mean that in the case of wrong location, that front will send a record that have empty studentId, empty studentName, the failed IP? The location is not stored so I do not think the back can check location to fix the note. How can I tell if the input is FAIL_DISTANCE? Is it that if studentId and studentName both empty the back will consider that FAIL_DISTANCE?

oh sorry did not notice that. I think this case with empty student ID and name is the only case, so you can detect when empty info -> return FAILED_DISTANCE

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024 1

@MasterPi-2124

It will lead to the other problem. What if teacher creates quiz when he is home? so maybe encoding is the only way to this

That's why I also want to update the theoretically stored location when the teacher click on show link/QR code

ahh it makes sense now. But I already working on encoding stuff so I will get back to you later with that. right now I encoded 4 times lol

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024 1

right now yes. hope we dont have other failed cases

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024 1

@nghiatm341 I think 1. can be solved all from front end side. Please ignore it and working on others

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024 1

I think it would be too much work to do to add sha hash in a quiz or the record. Right now Im also using AES encryption to validate the string, but it's for the short term only. But for demo purpose, I think we can temporarily pause it and focus on other things too @nghiatm341

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024 1

I think just update it with the latest value then

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024

3., actually I don't think encoding is a good idea. for example, if we use base64, people still can decode it lol

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124

  1. Students submitted more than once

In GET /quizRecords/{quizId}, it could be great if we have IPList array containing all IP addresses that have submitted the quiz

The IP addresses already shows within the studentList in quizRecord. Did you mean you want to compile all of those IP addresses to put them in a IPList array so you can check them easier?

Check student ID and return if the ID is in the records

What do you need with this request? Do you want an API to check? Do you need the studentId in quizRecord (already there)? Do you want a studentId list array like I said above

In the note param, change the value to FAIL_EXISTED instead of the default uninformative a note
OK

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024

first one: Yes thats what I meaned, just like a studentList, IPList will make it easier to check if IP is in the list or not

With GET quizRecords/quizID, I think we can both check IP and studentID in that, same method. So an additional IPList is not necessary anymore if I still need to query studentID in studentList

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124

  1. The student location is too far

A record can also contain empty studentId and studentName, but IP is the failed IP
note param now is FAIL_DISTANCE

What do you mean failed IP? Do you mean that in the case of wrong location, that front will send a record that have empty studentId, empty studentName, the failed IP? The location is not stored so I do not think the back can check location to fix the note.
How can I tell if the input is FAIL_DISTANCE? Is it that if studentId and studentName both empty the back will consider that FAIL_DISTANCE?

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124

first one: Yes thats what I meaned, just like a studentList, IPList will make it easier to check if IP is in the list or not

With GET quizRecords/quizID, I think we can both check IP and studentID in that, same method. So an additional IPList is not necessary anymore if I still need to query studentID in studentList

I mean, it may not be necessary, but it can help the front with data handling. I can add both IPList and studentIdList if it helps

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124

  1. Incorrect teacher's location

Because we can't add that location in the process of creating the quiz (possible but I don't like that), we will need to convert path {quizID}?lat=12.12312&lon=32.4343 to some encoded strings so that students can not decode and change lat and lon

Can you put that location info in the body instead of the params? It will make the cheating harder
Or you do not like that?

some other ways in backend?

Hmm, not so sure. Maybe the back can receive the location from the student from PUT quizRecord, but because teacher location is not stored (and the front handle the location from that start) so it might be really hard to compare. The back might need an out-of-the-box solution

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124

  1. Expired quiz
    Only apply to the case when a student is working on the quiz and press Submit button after the quiz is expired. The response should return an error and still save the record with note is FAIL_EXPIRED

Sure, I can check this

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124

  1. Submission amount > total students
    Rarely but also need to check that. How should we handle this?

I could pull the number of student from class (from quiz), count the number of submission the put them as 2 properties in quizRecord when you GET it
What do you think?

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024

@MasterPi-2124

  1. Incorrect teacher's location

Because we can't add that location in the process of creating the quiz (possible but I don't like that), we will need to convert path {quizID}?lat=12.12312&lon=32.4343 to some encoded strings so that students can not decode and change lat and lon

Can you put that location info in the body instead of the params? It will make the cheating harder Or you do not like that?

I have thought about that at first. but we only provide students the URL, so we can only encode it, or store it in backend side. right now I am doing multiple encodes so maybe it's harder lmao.

some other ways in backend?

Hmm, not so sure. Maybe the back can receive the location from the student from PUT quizRecord, but because teacher location is not stored (and the front handle the location from that start) so it might be really hard to compare. The back might need an out-of-the-box solution

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124

I have thought about that at first. but we only provide students the URL, so we can only encode it, or store it in backend side. right now I am doing multiple encodes so maybe it's harder lmao.

How about this?
The location will be stored inside the quiz. The location will be updated when the quiz is created and when the user click on show link/QR. I'll change the model to store location and add an API to change location. Front just need to call this API both those time I mentioned.
quizRecord will also stored student location. That way I can handle the location comparison.

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024

@MasterPi-2124

I have thought about that at first. but we only provide students the URL, so we can only encode it, or store it in backend side. right now I am doing multiple encodes so maybe it's harder lmao.

How about this? The location will be stored inside the quiz. The location will be updated when the quiz is created and when the user click on show link/QR. I'll change the model to store location and add an API to change location. Front just need to call this API both those time I mentioned. quizRecord will also stored student location. That way I can handle the location comparison.

It will lead to the other problem. What if teacher creates quiz when he is home? so maybe encoding is the only way to this

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124

It will lead to the other problem. What if teacher creates quiz when he is home? so maybe encoding is the only way to this

That's why I also want to update the theoretically stored location when the teacher click on show link/QR code

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124
So the back will stored quizRecord no matter what, it just assign the isValid and note depend on what data it received. Right?

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124
I will now tally the tasks for this issue. Correct me if i'm wrong

  • Store and validate quizRecord no matter what:

  • If IP and/or studentId existed => note = FAIL_EXISTED

  • If both studentId and studentName are empty => note = FAIL_DISTANCE

  • If passed the endTime => note = FAIL_EXPIRED

  • submission count

  • GET quizRecord will now return number of submission from records and student count from class (names pending)

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024

LGTM!

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024

@MasterPi-2124

I have thought about that at first. but we only provide students the URL, so we can only encode it, or store it in backend side. right now I am doing multiple encodes so maybe it's harder lmao.

How about this? The location will be stored inside the quiz. The location will be updated when the quiz is created and when the user click on show link/QR. I'll change the model to store location and add an API to change location. Front just need to call this API both those time I mentioned. quizRecord will also stored student location. That way I can handle the location comparison.

look like I have to store teacher's location in the backend side. there is no way to ensure that teacher's location is still valid with no checking.

Actually we can also have a fancy solution:

When the teacher opens the modal, it will collect the location and combine it with quizID into a string, and then calculate the SHA256 hash of that generated string. the hash will be included in the quiz object in the server side. When a student change location in the query param, it will generate a different string with a different SHA256 hash, which is of course, invalid.

Is that complicated and how do u think? @nghiatm341

from cnweb30-backend.

MasterPi-2124 avatar MasterPi-2124 commented on July 22, 2024

just found out that note and isValid params are in body of PUT /quizRecord @nghiatm341

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124
The fancy solution you mention before, I could easily add a property to store that SHA256 string in either quiz or record.
Which one would you prefer?

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124
Also, in the event that a student input violate multiple faults. Should I add all of the notes in the note like "FAIL_EXISTED FAIL_DISTANCE FAIL_EXPIRED" or how many does not matter, as long as there is a violation, just choose one and that's enough?

from cnweb30-backend.

nghiatm341 avatar nghiatm341 commented on July 22, 2024

@MasterPi-2124

Also, in the event that a student input violate multiple faults. Should I add all of the notes in the note like "FAIL_EXISTED FAIL_DISTANCE FAIL_EXPIRED" or how many does not matter, as long as there is a violation, just choose one and that's enough?

from cnweb30-backend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.