reading handwritten input to identify a student - python-tesseract

I teach. I would like to solve the following problem:
Collect student tests and have an OCR read input from the test and detect which exam belongs to which student.
I've been using pytesseract pretty successfully to solve this problem. I give each student a paper with their student ID and when they turn in their test they put this paper on top. Then pytesseract is "pretty" good at reading the Student ID within an acceptable error that usually allows me to uniquely identify the student from a list of all student IDs.
I'm curious if there are better solutions out there for this? One hassle with my current solution is that I have to pass out this student ID page individually to each student. When there are many students this takes a while and bothers students while they're taking their test.
Is there something the student can write by hand (e.g., fill in bubbles, etc.) on the exam that an OCR can read to uniquely identify the student? Handwritten names don't seem to work, there's too much variation, and I need it to be very accurate.

Related

How to give sequential unique id to students in my database?

I am using Django and Django Rest Framework for the backend of my Student Management System. The database is going to be postgresql. I want to give a unique student number to each student that gets admission(let's call that STD_ID). I have searched around and all the answers suggest getting the highest value of the STD_ID column from the database and saving the new record by incrementing the highest value. That works fine but there is a problem.
The issue is let's say the last entered student has the STD_ID 100, now the next one will be 101 all good but what happens when I delete the student with STD_ID 100. Now the highest STD_ID will be 99 and the next student will be 100. It won't create a conflict in the table because it does not remember having STD_100 but in physical records, lets say student reports and all that which were issued to previous STD_ID 100 students will exist and the new student will also be issued reports and such in the same STD_ID.
So I guess you see the issue here. There are now two students with the same ID. One is no longer in the database but he used to be and one day it can cause problems.
What I want to do is have a way to assign STD_ID without this issue. One way I can think of is having a second table which stores the last student id issued so that the next student is saved with a unique id regardless of whether student has been deleted or not.
But, I am not sure how this system would handle multiple users. Let's say two users try to save a student record at the same time, they will get new unique numbers but for some reason one of the requests to save the record fails and now there is a gap in the STD_ID.
So, how is this handled in the industry because STD_ID does not seem like a big issue but just assume we are dealing with invoice numbers and a number is skipped in the sequence. Well, that would be a mess to sort out in internal records and auditors will get unnecessary suspicion.
Any guidance will be much appreciated.
PS. I am still learning all this on my own and this is I think my first question on StackOverflow. So, I apologise for any blunders or mistakes, any advice on asking questions and suggestions will be highly appreciated. Thank you

Which approach is better to search a keyword on nested array or normal arrays?

I have different tables School, Student, Course on my SQL database. I want to design a search algorithm which should make user to search by any of those table names (School, Student, Course) and bring only their name list very fast. But that search keyword can be anything - either school name, student name or course name.
School is model and has: name, location.
Student is model and has student number, name, schoolid, courseid.
Course is model and has course name, courseid.
School name, student name or course name can be search for in all data. And result should bring only that model.
For example if I search for (John = student name), it should bring me all students named John only with student model values (object). Or course name (mathematics) also can be another example and it should only bring its properties as object too.
I came up with 2 different approaches:
I can create nested object array like School -> Student -> Course (includes each other on each object) and name will be searched on these nested arrays. I think this is not good because in anyway all those big and large arrays will be visited (Doesn't matter we checked for school name or not).
Second one I think makes more sense. Instead of making them nested I can search that keyword on each table one by one. First school then student then course (If its school then will be much easier than nested one even).
If you have a better approach please share it with me.
Well, it's still unclear, where you want to "design your search algorithm" and get your result "objects"! Since it's a question asked with SQL tag, I'd say that you should simply do 3 simple select queries on all tables for each search term. Any joins would mix the schemas and you'll have to distinguish results afterwards.
You're probably talking about some oop language with a database connectivity interface which does the job of queries and converting results into objects. In this case you would simply combine the result of each separate query with the features of language to get your objects.

How to update same fields but different tables

Good Day!
First of all I am new to making database so I am really hoping the pros out there could enlighten me. I am currently working on a student grading database. Each student has 10 subjects (math, science, etc). Each subject has 4 grading periods.Now this is the case.
I am using MS Access 2013
Let's just take one subject: Mathematics. I have 5 tables:
1. student_profile
2. math_1st_grading
3. math_2nd_grading
4. math_3rd_grading
5. math_4th_grading
Each of the tables above contain a field: Student Name.
I have a form for the student_profile table. What i want to do is when i enter data into the Student Name using the form, the Student Name fields for all the math grading tables will be updated.
I was thinking of making an update query for each of the math tables and run them simultaneously using a macro. But I don't know how to do that. It's just an idea for me.
Ive also read ideas like making an "after update" even in the form but i don't know much about macros and expression builders.
Please help me with this. Maybe i do not really know much about normalizing my tables please give some solutions for this.
Your response is much appreciated. Thank you
This is a bad database design. Look at what entities you are talking about: students, subjects and grading periods. So it is very likely you need exactly these tables.
student (student_id, firstname, lastname, entrydate, ...)
subject (subject_id, name)
grading (grading_id, name)
Then you combine these in a table to get to each student's subjects and gradings:
student_subject (student_id, subject_id, grading_id, result)
So when a student's name changes you only have to update one record in your database. When a subject gets added, simply insert one more record into your subject table. And so on.
This is however just an example. With this design you would be able to let students have different subjects for instance. If this is not desired, another model might be better. But it should give you the idea. First think of the entities you are dealing with, then think about how they are related.

Is there an appropriate way to show correlation or causation from a SQL query?

I'm curious if there's any way that Microsoft Access or SQL Server can provide a function to show correlation or causation from a SQL Select statement and its results.
This is basically the use case scenario:
Let's say you have two tables, table studentCourseSurveys and table onlineCourseReviews. At the forefront these two tables are mostly unrelated but could be joined based on the course name, for example "ENG 101".
studentCourseSurveys is a table that is intended to hold data that students submit during
their in person course survey at the end of a semester. For example, in the last day of class students receive that form to fill out to rate the instructor based on things such as "exams were related to the actual lecture content", "instructor was on time and prepared", and then at the end they have their short answer opportunities to give additional comments.
onlineCourseReviews is a table that is used by an internal department that conducts content reviews on the online component of courses. For example, this department has individual instructional designers who are assigned different courses in Blackboard to review. They review content, delivery, course structure, and so on and so forth. The course is then given its comments, score, etc.
As already mentioned the tables would be most unrelated. But let's say someone wanted to show a correlation that the results of the online course reviews could somehow indicate that the quality of the overall course was better because of these online reviews, and that this was shown in the responses from the students based on their survey results.(basically, a course that got an online course review score of 10 has course surveys where a great majority of the students rated it as excellent, content was relevant, teacher was prepared, etc, to indicate that an improvement in the online course translated to improvements in the in-person class and overall class quality).
This almost seems like a unique job for a statistician but I'd like to know if it's possible to show this data based on a query in Access or SQL Server. I know that you could just easily join the two tables with a foreign key and then get the results of a survey and online course review in a single statement but that doesn't really say anything. I would think that to show ANY kind of relationship that you need to illustrate a trend over any given period of time.
Thank you.
I would suggest creating a query with three values - course name (e.g., ENG101), the student rating, and the online course rating. In SQL Server you can save the results as a .csv file. Do this, then open it in Excel and use the RSQ function , or R-Squared, to find the correlation coefficient between columns two and three. The closer R-squared is to 1, the closer the two match. 1 mean a perfect correlation. 0 means no relation at all and -1 means related but but in a polar opposite manner.

New to Object Oriented Design

I am new to object oriented design. I am looking forward to some tips on how to model the below mentioned requirement using objects.
Requirement: A program has many Students. A program logs in to the application. First page displays a table of all the Students belonging to the program (Table Columns - Id, First name, last name, age, sex, etc. ). The Id is a link. By clicking the Id, the individual student page is displayed. In this page, an individual student related activities can be done - for eg. edit address, change name, add comments etc.
My Solution: Two Classes
Program - Will model a single program, perform all activities related to it and encapsulate all program related db tables.
Student - Will model a single student and perform all activities related to it and encapsulate all student specific db tables.
So far, so good.
In order to fetch details of all students related to a program, from Program object I need to call a method called 'fetch_student_details'.
The Question is where should this method be written? Should it be a Student Class method or Program Class method.
If I write this method in program class, how will the Program class handle it?
(a) First identify the list of student_ids that belong to it and for each id, instantiate a Student Class and get the specific student related information from it. DB: Each instantiated student object will run a query to fetch its information. So 100 students, 100 queries.
OR
(b) Fetch the list of student ids related to the program and fetch the student information directly for all the students. Db: Single query to fetch all the needed information.
In this case, if you can, go for solution (b). Students and Programs, in fact, are two differet entities that can exist independently, and you don't break encapsulation.
With solution (a) you need to pollute Program's interface by adding a method for each possible information that you want to get from the Students.
As final suggestion, if you want to learn OO Design, start by reading the book "Design patterns - Elements of Reusable Object-Oriented Software" by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides (AKA "The gang of four").