Udayraj123 / OMRChecker

Evaluate OMR sheets fast and accurately using a scanner 🖨 or your phone 🤳.
MIT License
752 stars 311 forks source link

Difficulty creating a template.json compliant [Request access to a sample1 Docx #155

Closed SHALLSHADOWS closed 11 months ago

SHALLSHADOWS commented 1 year ago

Would it be possible to have access to the sample as a Docx file from the ORM of sample 1? I tried to create my own sample but the configuration of the template.Json looks tedious and all the bubble areas are difficult to locate by the solution. So I decided to move more towards this sample that I am asking for which comes a little closer to my objectives SampleIlookFor MySample

SHALLSHADOWS commented 1 year ago

Results_05PM.csv image2 This is the result I get when I process the page

Udayraj123 commented 12 months ago

@SHALLSHADOWS you can share your current template.json as well, it looks like the last question is not coming in the next row. Are you making use of the field gaps?

edit: about the request for a docx file - the template was not created using any docx tool afaik. OMRChecker so far is not concerned about any method being used to create the OMR sheets

SHALLSHADOWS commented 11 months ago

Hi, thank you for your assistance with my concern. Since the last time, I've made progress in solving my issue related to analyzing questionnaires. However, I'm currently facing a challenge in understanding how to utilize the 'fieldType' labeled 'QTYPE_INT' in my JSON template. My goal is to enable users to select three numbers, each ranging from 0 to 9, to facilitate the analysis of combinations of these three numbers. Could you please provide some guidance on how to proceed with this situation? Below is my 'template.json' file and my new sample image16 template.json

SHALLSHADOWS commented 11 months ago

image16

SHALLSHADOWS commented 11 months ago

Hello, I've made progress on my issue. I've managed to achieve what I wanted, except that the result I have from the analysis is duplicated for the Vehicle_ID_Number and Controller_ID_Number like this:

Success: {'Vehicle_ID_Number': '112227733', 'Controller_ID_Number': '11332244', 'q6': '', 'q9': 'A', 'q7': '', 'q1': 'A', 'q4': 'B', 'q14': 'B', 'q5': '', 'q2': 'A', 'q13': 'A', 'q10': 'B', 'q3': 'B', 'q11': 'A', 'q15': 'A', 'q12': 'B', 'q8': 'A'} Attached is my template.json image17 template.json

Udayraj123 commented 11 months ago

@SHALLSHADOWS have you done any modifications in the code? Can you share the diff of the same if any?

As the template you provided has QTYPE_MCQ2 which is not supported by default

Udayraj123 commented 11 months ago

You can debug this using the --setLayout option, the direction is 'vertical' by default for QTYPE_INT

python3 main.py -i inputs/shallshadows --setLayout  
image

You need horizontal direction for the integer type questions -

      "direction": "horizontal",
      "bubbleValues": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
image

Also the preProcessor seems missing in your attached template(for cropping omr_marker). You can refer to the wiki section for more documentation on this: https://github.com/Udayraj123/OMRChecker/wiki/About-Templates

Response for your image from older comment -

 {'Vehicule_ID_Number': '0112', 'Controller_ID_Number': '1122', 'q11': 'yes', 'q15': 'yes', 'q5': 'no', 'q1': 'yes', 'q14':              
                    'no', 'q9': 'yes', 'q13': 'yes', 'q6': 'yes', 'q10': 'no', 'q4': 'no', 'q2': 'yes', 'q8': 'yes', 'q3': 'no', 'q7': 'no',                
                    'q12': 'no'}  
Udayraj123 commented 11 months ago

Here's the template I used

{
  "pageDimensions": [560, 700],
  "bubbleDimensions": [17, 17],
  "customLabels": {
    "Vehicule_ID_Number": ["Vehicule_ID_Number1..4"],
    "Controller_ID_Number": ["Controller_ID_Number1..4"]
  },
  "fieldBlocks": {
    "Vehicule_ID_Number": {
      "direction": "horizontal",
      "bubbleValues": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
      "bubbleDimensions": [13, 13],
      "origin": [43, 141],
      "bubblesGap": 24,
      "labelsGap": 18,
      "fieldLabels": ["Vehicule_ID_Number1..4"]
    },

    "Controller_ID_Number": {
      "direction": "horizontal",
      "bubbleValues": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
      "bubbleDimensions": [13, 13],
      "origin": [290, 141],
      "bubblesGap": 24,
      "labelsGap": 18,
      "fieldLabels": ["Controller_ID_Number1..4"]
    },
    "MCQ_Block_2": {
      "bubbleValues": ["yes", "no"],
      "direction": "horizontal",
      "origin": [373, 242],
      "bubblesGap": 32,
      "labelsGap": 23.5,
      "fieldLabels": ["q1..15"]
    }
  }
}
SHALLSHADOWS commented 11 months ago

Hi, thank you very much for the support you provided. Thanks to the help and the elements you provided, I managed to close my solution. Regarding the fact that the template doesn't support QTYPE_MCQ2 by default, yes, I did indeed modify the code to enable it, as you can see in the image below. Also, thank you for notifying me about the preProcessor; I was planning to address it after resolving the analysis issue. Thanks for everything. Screenshot 2023-10-15 221531

Udayraj123 commented 11 months ago

@SHALLSHADOWS Glad that it worked well for you 👍 Feel free to leave a feedback in the Discord group's #introductions channel: https://discord.gg/qFv2Vqf