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
f9c20767
Commit
f9c20767
authored
5 years ago
by
Ruben Young On
Browse files
Options
Downloads
Patches
Plain Diff
Feedback options now automatically have the label of their associated checkbox if they have one
parent
bde31337
No related branches found
No related tags found
1 merge request
!17
Add pregrading
Pipeline
#17943
passed
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
zesje/api/mult_choice.py
+2
-2
2 additions, 2 deletions
zesje/api/mult_choice.py
zesje/pregrader.py
+1
-18
1 addition, 18 deletions
zesje/pregrader.py
with
3 additions
and
20 deletions
zesje/api/mult_choice.py
+
2
−
2
View file @
f9c20767
...
...
@@ -64,8 +64,8 @@ class MultipleChoice(Resource):
mc_type
=
'
mcq_widget
'
if
not
id
:
# Insert new empty feedback option that links to the same problem
new_feedback_option
=
FeedbackOption
(
problem_id
=
problem_id
,
text
=
''
)
# Insert new empty feedback option that links to the same problem
, with the label as name
new_feedback_option
=
FeedbackOption
(
problem_id
=
problem_id
,
text
=
label
)
db
.
session
.
add
(
new_feedback_option
)
db
.
session
.
commit
()
...
...
This diff is collapsed.
Click to expand it.
zesje/pregrader.py
+
1
−
18
View file @
f9c20767
# 3 - resolution / dpi to convert points to inches to pixels
# 4 - get corner marker keypoints per page
# 5 - optional? determine blank pdf corner markers vs submission corner markers
# 6 - transform submission image
# 7 - determine checkbox locations
# 8 - get box location and check if it is filled
# 8.5 - check if feedback option exists
# 9 - connect to feedback option
# coupled feedback cannot be deleted
import
cv2
import
numpy
as
np
from
zesje.database
import
db
,
Solution
,
ProblemWidget
from
zesje.database
import
db
,
Solution
from
zesje.images
import
guess_dpi
,
get_box
,
fix_corner_markers
...
...
@@ -44,11 +32,6 @@ def add_feedback_to_solution(exam, page, page_img, corner_keypoints):
if
box_is_filled
(
box
,
page_img
,
top_left_point
):
feedback
=
mc_option
.
feedback
if
mc_option
.
label
:
feedback
.
text
=
mc_option
.
label
db
.
session
.
commit
()
sol
.
feedback
.
append
(
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