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
c621fce1
Commit
c621fce1
authored
5 years ago
by
jtimotei
Browse files
Options
Downloads
Patches
Plain Diff
Tweak for improving checkbox location
parent
08aa8e0d
No related branches found
Branches containing commit
No related tags found
1 merge request
!15
Refactorings and compatibility fix
Pipeline
#17773
passed with warnings
5 years ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/views/Exam.jsx
+1
-1
1 addition, 1 deletion
client/views/Exam.jsx
client/views/ExamEditor.jsx
+2
-2
2 additions, 2 deletions
client/views/ExamEditor.jsx
zesje/pdf_generation.py
+3
-2
3 additions, 2 deletions
zesje/pdf_generation.py
with
6 additions
and
5 deletions
client/views/Exam.jsx
+
1
−
1
View file @
c621fce1
...
...
@@ -319,7 +319,7 @@ class Exams extends React.Component {
return
{
'
widget
'
:
{
'
x
'
:
{
$set
:
data
.
x
+
i
*
2
4
$set
:
data
.
x
+
i
*
2
3
},
'
y
'
:
{
// each mc option needs to be positioned next to the previous option and should not overlap it
...
...
This diff is collapsed.
Click to expand it.
client/views/ExamEditor.jsx
+
2
−
2
View file @
c621fce1
...
...
@@ -232,8 +232,8 @@ class ExamEditor extends React.Component {
widget
.
problem
.
mc_options
.
forEach
(
(
option
,
i
)
=>
{
let
newData
=
{
x
:
Math
.
round
(
data
.
x
)
+
i
*
2
4
+
6
,
y
:
Math
.
round
(
data
.
y
)
+
1
1
x
:
Math
.
round
(
data
.
x
)
+
i
*
2
3
+
7
,
y
:
Math
.
round
(
data
.
y
)
+
2
1
}
this
.
updateWidgetPositionDB
(
option
,
newData
)
})
...
...
This diff is collapsed.
Click to expand it.
zesje/pdf_generation.py
+
3
−
2
View file @
c621fce1
...
...
@@ -173,14 +173,15 @@ def generate_checkbox(canvas, x, y, label):
margin
=
5
# Margin between elements and sides
markboxsize
=
fontsize
-
2
# Size of checkboxes boxes
x_label
=
x
+
1
# location of the label
y_label
=
y
-
fontsize
# remove fontsize from the y label since we draw from the bottom left up
y_label
=
y
+
margin
# remove fontsize from the y label since we draw from the bottom left up
box_y
=
y
-
markboxsize
# check that there is a label to print
if
(
label
and
not
(
len
(
label
)
==
0
)):
canvas
.
setFont
(
'
Helvetica
'
,
fontsize
)
canvas
.
drawString
(
x_label
,
y_label
,
label
[
0
])
box_y
=
box_y
-
margin
-
fontsize
#
box_y = box_y - margin - fontsize
# canvas.lines([ (x, y, x +15, y), (x, y, x, y +15)])
canvas
.
rect
(
x
,
box_y
,
markboxsize
,
markboxsize
)
...
...
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