Comments (27)
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 studentListI 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.
- 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_DISTANCEWhat 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.
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.
right now yes. hope we dont have other failed cases
from cnweb30-backend.
@nghiatm341 I think 1. can be solved all from front end side. Please ignore it and working on others
from cnweb30-backend.
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.
I think just update it with the latest value then
from cnweb30-backend.
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.
- 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.
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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
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.
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.
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.
@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.
@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.
LGTM!
from cnweb30-backend.
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.
just found out that note
and isValid
params are in body of PUT /quizRecord @nghiatm341
from cnweb30-backend.
@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.
@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.
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)
- Should we add update quizzes feature? HOT 3
- Notification
- Quiz record collect IP HOT 1
- Unused API HOT 2
- Class API HOT 4
- quizRecoeds bug HOT 8
- Next-auth HOT 9
- validate quizRecords HOT 2
- Change live server to new DNS HOT 5
- New Object: User (teacher) HOT 2
- get Quiz by iD and get quizRecord by ID should be public
- get Class return failed with error HOT 2
- remove users capability? HOT 9
- New Class HOT 1
- New Quiz HOT 1
- Class Dashboard HOT 3
- quiz formLink can be empty HOT 1
- sort quizzes in class object by startDate HOT 4
- PUT quizRecord successfully but still return 422 error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cnweb30-backend.