Exam Checking Application Architecture

Hi, There is a paper exams which answer sheets scanned with special scaner and it converts student’s data to text file like below. Everyline is indicating one student.

NAME01    SURNAME01 O00034  11AIAAEACC   CAAB  BEBD BBADDDBAD CD CC ACBDDBCDEBEBCADEBACABBEBECDCBCA18     1      40     40     4341   3      4      4      2      200    2.4    3.4    A C   B DE   D A      C      E B  EA  D   C  
NAME02    SURNAME02 000332  11AIABAEADEADBCDCCDADCCEDAECCBCDEDCECAECCECDCBACEBEBCAC DEBDABDCECACEAA9      2      23     10     52431  25     0.8    6      0.2    2000   12     12         E  C   B    B     C  A     B  EA  D   C
NAME03    SURNAME03 00009   11AIAAACADEADBCDC CB C EDAEC DCDEDEA AED ECDBAACBB BCA  DAADABCCECAAEAA18     2      23     10     51342  50     0.8    6      0.2    2000   2.4    3.4        E  C     D  B     C      E B  EA  D   C  
NAME04    SURNAME04 00060   11AIABAEADBADBBDACCADBCEDAEECDCBEDCACBBC ECDEAACBC BCD   ADDAAD EC EE A6      2      23     10     52341  25     0.8    6      0.2    2000   34     34     A   E  C   B   A      C   B    B  EA  D   C  

I have the correct answer’s for this exam. I will check the correct and the student’s answers.
But the problem is: How can I store this information in my database. Initially, I am thinking to create my models like this.

class Exam(models.Model):
    name = models.CharField(max_length=255)
    branch = models.ForeignKey(Branch, on_delete=models.CASCADE)
    status = models.BooleanField(default=False)


class ExamAnswer(models.Model):
    exam = models.ForeignKey(Exam, on_delete=models.CASCADE)
    block = models.IntegerField()
    answer_json = models.TextField()


class StudentAnswer(models.Model):
    student_id = models.ForeignKey(Student, on_delete=models.CASCADE)
    exam_id = models.ForeignKey(Exam, on_delete=models.CASCADE)
    student_answer_json = models.TextField()
    result_json = models.TextField()
    order = models.IntegerField()
    score = models.IntegerField()

If my approach is correct (I don’t think so :slight_smile: ) then how can I able to get statistical data. For example in exam 1, how many students get correct for 1. question and etc…

I’m assuming that each line (starting with NAMExx) is all on one line. (Note, if you want to keep the formatting so they don’t wrap, enclose the text between lines consisting of three backtick - ` characters:

(The line above this is ```)
NAME01 SURNAME01 O00034 11AIAAEACC CAAB BEBD BBADDDBAD CD CC ACBDDBCDEBEBCADEBACABBEBECDCBCA18 1 40 40 4341 3 4 4 2 200 2.4 3.4 A C B DE D A C E B EA D C
NAME02 SURNAME02 0003327411AIABAEADEADBCDCCDADCCEDAECCBCDEDCECAECCECDCBACEBEBCAC DEBDABDCECACEAA9 2 23 10 52431 25 0.8 6 0.2 2000 12 12 E C B B C A B EA D C
(The line after this is ```)

Do you have a specific breakdown / description of exactly how these lines are formatted? The columns don’t appear to line up in a column-style format, and there doesn’t appear to be a consistent delimiter between fields. (It doesn’t appear like you can use spaces because there are embedded spaces within the list of answers.)

Thanks for suggestion, I updated the post, Yes currently there is not any delimeter, but in the future I will be added it, My main question is how to store it in database to use more speedy in the future to get statistical data.

“Speed” for statistical data is a highly nebulous term. It’s going to be so highly dependent upon a number of different factors that there really isn’t a single answer that will satisfy all possible needs.

My recommendation at this point would be to move forward with what you have, and create some test scenarios where you’re performing the desired calculations over the size of the data you expect to be using. I’m going to guess that at the volumes you’ll likely encounter, no specific implementation is going to be so significantly better than another that you’ll need to change. (Or, to put it another way, unless you’re talking about thousands of test results - and more likely tens of thousands, I don’t think you’re going to notice a difference.)

hi, OK I will be going in this way, We will see. After some scenarios, I decided.