Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
zesje
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Works on my machine
zesje
Commits
4560a99e
Commit
4560a99e
authored
5 years ago
by
Ruben Young On
Browse files
Options
Downloads
Patches
Plain Diff
Added barebones structure for pregrading
parent
70c90407
No related branches found
Branches containing commit
No related tags found
1 merge request
!17
Add pregrading
Pipeline
#17818
passed with warnings
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
zesje/pregrader.py
+8
-6
8 additions, 6 deletions
zesje/pregrader.py
zesje/scans.py
+1
-0
1 addition, 0 deletions
zesje/scans.py
with
9 additions
and
6 deletions
zesje/pregrader.py
+
8
−
6
View file @
4560a99e
...
...
@@ -9,9 +9,7 @@
# coupled feedback cannot be deleted
from
zesje.database
import
db
,
Exam
,
FeedbackOption
from
zesje.images
import
guess_dpi
from
zesje.database
import
db
,
Exam
def
pregrade
(
exam_token
,
image
):
...
...
@@ -21,6 +19,7 @@ def pregrade(exam_token, image):
exam
=
Exam
.
query
.
get
(
exam_token
=
exam_token
)
problems
=
exam
.
problems
mc_options
=
[
problem
.
mc_options
for
problem
in
problems
]
coords
=
[(
cb
.
x
,
cb
.
y
)
for
cb
in
mc_options
]
...
...
@@ -28,7 +27,7 @@ def pregrade(exam_token, image):
pass
def
add_feedback_to_solution
(
solution
):
def
add_feedback_to_solution
(
solution
,
image
):
problem
=
solution
.
problem
for
mc_option
in
problem
.
mc_options
:
...
...
@@ -36,11 +35,14 @@ def add_feedback_to_solution(solution):
# check width and so forth
# if box is filled
if
True
:
if
box_is_filled
(
box
,
image
):
solution
.
feedback
=
mc_option
.
feedback
db
.
session
.
commit
()
def
box_is_filled
(
box
,
image
):
pass
def
_locate_checkbox
():
pass
This diff is collapsed.
Click to expand it.
zesje/scans.py
+
1
−
0
View file @
4560a99e
...
...
@@ -241,6 +241,7 @@ def process_page(image_data, exam_config, output_dir=None, strict=False):
return
True
,
"
Testing, image not saved and database not updated.
"
update_database
(
image_path
,
barcode
)
# call our own function to pregrade
if
barcode
.
page
==
0
:
description
=
guess_student
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment