-
Notifications
You must be signed in to change notification settings - Fork 103
feat: Add code-based attendance option #1770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tiger, great work so far. This is an excellent new attendance addition. Please see my comments, and also use pre-commit and get CI to pass.
I think a useful thing to add would be a checkbox to enable or disable the code. The teacher could enable the code and allow students to check-in, but then after everyone has done that, the teacher can disable the code and anyone who hasn't used the code yet can't do so after that. This is so that the teacher can keep an eye on who is using the code and when. This could replace the 2:25-3:05 restriction, actually.
Also, in my issue I also mentioned an option for scanning a QR code or going to a link for taking attendance. If you could add that too, that would be great. I think that makes a lot of sense for going together with entering a code, and I think that they will have very similar logic flows. But that's up to you, and I won't make it a requirement - the work you've done here is more than enough.
Thanks for your feedback Alan! I'll make a feature where the teacher can choose whether to manually enable/disable the code or let it run automatically based on times from the calendar (if they don't want to have to toggle it themselves). Also, I'll add the times from the calendar to the EighthBlock objects to record their start/end and make them more versatile (right now EighthBlock only stores date and letter - like A or B - which is why initially I hardcoded the code enable/disable times). Your teacher-end pop up feature is a great idea. I'll try to put both the QR and character code in the pop-up together. Thanks again, |
Wonderful, thanks Tiger. Note that for the blocks, I meant the existing schedule ion/intranet/apps/schedule/models.py Line 28 in 1339292
|
6fa1d3e
to
5d36031
Compare
4e734b8
to
8b47907
Compare
Hi Alan, I implemented the following features in the 2nd and 3rd commits:
Some other things:
Can you please review the new commits? (I've left them separate to keep it clear what's new, I can squash them together if needed.) Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work Tiger. This is looking great! I left a few small comments. I have not yet, but I or someone else will soon actually run and test out the code.
Oh and for the commits, could you squash the code and block times ones together? The code and QR ones can stay as separate ones. And also make sure to run pre-commit to get CI to pass. |
be20532
to
bea5ce8
Compare
Hi Alan, The QR code is now frontend-generated. Also, I made some minor changes (pulling the frontend rendering part of student_attendance_view into a new function to reduce function complexity, pulling the random_code function out of EighthSch..Activtiy to fix some errors in Codacy, etc.) Tiger |
Hi Aarush, I did a bunch of fixes, mainly re-writing the process of passing the attendance-marking result, and adding a new attendance_marked boolean field to eighthsignup to record whether the student has done attendance so the student can see that (I couldn't use the was_absent field since it defaults to false and I didn't want to change that in case it affects something else), as well as some other things (like variable names and the javascript event listener). Thanks for your feedback! |
7d2da23
to
99fadc2
Compare
Hi Aarush,
(Also, I can squash all the commits together at the end if necessary.) Tiger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Tiger! The UI is starting to look really good now. I like what you did with the QR code. Good thinking on reworking the DayType model; I think what you're trying to do right now would work perfect on a block-by-block basis instead. Keep in mind that by calculating the eighth window for each block individually instead of the day as a whole, the enter code box should only appear for the block that is open to the user right now.
Speaking of which, the QR code feature works great! The popup looks good now too. However, could you clarify instructions - where is the "attendance page"?? I'm still having trouble finding the page using just the UI - maybe I'm just being dumb, but I don't get a button anywhere to "Enter Attendance Code" except for glance? Could you send screenshots of where they are. I don't think it's rendering since I Ctrl + F the whole HTML and still couldn't find it.
For entering the actual attendance code, can you move it out of the glance-looking page and into its own page (and each block has a separate page) where everything is bigger. The 6 digit code thing works great when typing + backspacing, but can you make the boxes perfect squares? If it looks weird you can use a different font in the boxes themselves to make it look better. Also, even though attendance through a specific URL with the code works (such as the one provided by the QR code), trying to enter it manually and hitting submit just does reloads the page and does nothing. I noticed this only happens for A block (works for B block). I also noticed that when I type in the 6 boxes for B block, the cursor doesn't automatically move to the next box - but you probably won't need to worry about this as I want you to move each block to its own attendance code page.
Other than that, this is looking really good! Sorry for all these nitpicks about how it looks and such, but since this will probably be a widely used feature I want to make sure it looks and works well for the user
Hi Aarush, Some clarifications/questions I have: Tiger |
8284c85
to
e3992b6
Compare
Hi Aarush,
I tested and didn't find any bugs, though if you find one please let me know! |
Closes #1612
Proposed changes
Added a new method of attendance. For each EighthScheduledActivity, a random 6-character code 0-9 & A-Z is generated. This is displayed to the teacher (and eighth admins). Teachers can share the code to students at the activity, who can then input the code on a new eighth/student_attendance page which marks them as present if the code is correct (and shows a message as such).
This also sets the attendance_taken on a sch. activity to True (as it would be odd otherwise).
Note: Migration is required (new attendance_code attribute for EightScheduledActivity object).
Attendance will only be marked if the code is given during the block (2:25 - 3:05 for A blocks, 3:15 - 4:00 for B blocks, anytime for other kinds of blocks). Otherwise, the student will get an error message.
Students may access the attendance page through buttons which will appear on the eighth/glance (location.html) and eight/signup (signup.html) pages from 2:25 to 4:00.
This attendance method coexists with already-existing methods (so the last change is the one which has effect).
(All above times in PM).
Brief description of rationale
This method (credits to Alan Zhu for the idea) will let students mark themselves present if they are at an activity (and thus receive the code from the teacher). This makes it more convenient for the teacher to take attendance, as all they need to do is show the code to the students at the activity.