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
e78b2cbe
Commit
e78b2cbe
authored
5 years ago
by
Ruben Young On
Browse files
Options
Downloads
Patches
Plain Diff
Added pregrade function
parent
5af39a9a
No related branches found
Branches containing commit
No related tags found
1 merge request
!17
Add pregrading
Pipeline
#17840
failed
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zesje/pregrader.py
+6
-6
6 additions, 6 deletions
zesje/pregrader.py
with
6 additions
and
6 deletions
zesje/pregrader.py
+
6
−
6
View file @
e78b2cbe
...
...
@@ -27,20 +27,20 @@ def pregrade(exam_token, image):
pass
def
add_feedback_to_solution
(
image
,
barcode
):
def
add_feedback_to_solution
(
page_img
,
barcode
):
exam
=
Exam
.
query
.
filter
(
Exam
.
token
==
barcode
.
token
).
first
()
sub
=
Submission
.
query
.
filter
(
Submission
.
copy_number
==
barcode
.
copy
,
Submission
.
exam_id
==
exam
.
id
).
one_or_none
()
for
solution
in
sub
.
solutions
:
problem
=
solution
.
problem
problems
=
exam
.
problems
problem
s_on_page
=
list
(
filter
(
lambda
p
:
p
.
widget
.
page
==
barcode
.
page
,
problem
s
))
for
problem
in
problems_on_page
:
for
mc_option
in
problem
.
mc_options
:
box
=
(
mc_option
.
x
,
mc_option
.
y
)
# check width and so forth
if
box_is_filled
(
box
,
image
):
solution
.
feedback
=
mc_option
.
feedback
if
box_is_filled
(
box
,
page_img
):
problem
.
solution
.
feedback
=
mc_option
.
feedback
db
.
session
.
commit
()
...
...
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