Udayraj123 / OMRChecker

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

[Enhancement] Extra steps and error messages in schema validation #65

Open Udayraj123 opened 1 year ago

Udayraj123 commented 1 year ago

This extends https://github.com/Udayraj123/OMRChecker/issues/43

  1. All labels in all of the QBlocks should be covered in either Singles or concatenations (tally the qNo labels to exist in either of them).
  2. Also none of the labels in qBlocks should overlap (show warning in this case)
  3. User friendly messages: suggestion to convert key into camelCase (in which case validation error should mention that).

Originally posted by @Udayraj123 in https://github.com/Udayraj123/OMRChecker/issues/60#issuecomment-1267295262

SpyzzVVarun commented 1 year ago

We can close the previous issue and update this one.

SpyzzVVarun commented 1 year ago

In #43 we added a json schema, which is basically a blueprint for the input template.json file, that validates the template file and we wrote a function that validates the template using python jsonschema library. Both the schema and the error messages need a lot of improvement and that is where this issue comes in.

  1. Talking about improvements in the validation schema, we have to write the constraints in much more detail. By constraint I mean for eg: the dimensions key should only take in an array of 2 integers, so if the number of integers don't match, it should give a proper error message. So, detailed constraints have to be included in the schema.

  2. Regarding the error messages, currently we only print the key where the error takes place (key comes from schema and not the input template which is a problem) and we print a default error message which is not sufficient currently. So we need to improve the error messages, add a warning/error info/level and also find a way to get the key with the error from the input template.json instead of the schema (for cases of spelling mistake or case mistake in the keys).

Udayraj123 commented 1 year ago

Well detailed breakdown 👍 you(and others) can raise PRs in small mergeable/deliverable chunks as we discussed yesterday.

Reiterating that discussion here as well for reference -

I'll share a concept I shared with one of you recently.

This comes from Agile development practiced in the industry.

image

Each small ball is a small change that is eligible for merge.

Break the task down into as many parts as possible, as long as one meaningful PR for each of the parts exists. This helps in teams and communities to work independently and efficiently

Udayraj123 commented 1 year ago

@SpyzzVVarun adding few more criteria

Udayraj123 commented 1 year ago

This issue needs a bit more attention now. Bumping updated time with this comment.

Udayraj123 commented 1 year ago

@SpyzzVVarun are you available to work on this now?

Udayraj123 commented 1 year ago

Marking issue as easy since a few improvements have been merged in the evaluation + revamp PR https://github.com/Udayraj123/OMRChecker/pull/118

anaghninja432 commented 1 year ago

Sir i would like to contribute to this project. Please tell me how, I'm pretty new to Open Source.

Udayraj123 commented 1 year ago

@anaghninja432 Hello, if you're new to the project I suggest you to run the project locally on a new OMR sheet and submit a sample. Then in the process try to go through the code flow for your images. This task is around schema validation so you can experiment passing incorrect template jsons by thinking of common mistakes people can do. We need to provide accurate error messages to guide the user