diff --git a/client/views/Exam.jsx b/client/views/Exam.jsx index cd6b27dcaec8209259e2023c9cba49e550dff15a..a603661ae3a3c645b7780a34608bff957e29c934 100644 --- a/client/views/Exam.jsx +++ b/client/views/Exam.jsx @@ -319,7 +319,7 @@ class Exams extends React.Component { return { 'widget': { 'x': { - $set: data.x + i * 24 + $set: data.x + i * 23 }, 'y': { // each mc option needs to be positioned next to the previous option and should not overlap it diff --git a/client/views/ExamEditor.jsx b/client/views/ExamEditor.jsx index 79311a01948c39b8a83bf207b3b161475c55e99c..11c69600d6b1344b950a69beecf3ab517014dfe9 100644 --- a/client/views/ExamEditor.jsx +++ b/client/views/ExamEditor.jsx @@ -232,8 +232,8 @@ class ExamEditor extends React.Component { widget.problem.mc_options.forEach( (option, i) => { let newData = { - x: Math.round(data.x) + i * 24 + 6, - y: Math.round(data.y) + 11 + x: Math.round(data.x) + i * 23 + 7, + y: Math.round(data.y) + 21 } this.updateWidgetPositionDB(option, newData) }) diff --git a/zesje/pdf_generation.py b/zesje/pdf_generation.py index 1d6b91f346243052ac3cdf6b0c7aa7c3fe1f0319..ed4e5b2b0123d10bbc54016f114ff1b9316afa19 100644 --- a/zesje/pdf_generation.py +++ b/zesje/pdf_generation.py @@ -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)