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
9a9ffb9b
Commit
9a9ffb9b
authored
5 years ago
by
jtimotei
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a issue when fetching cb locations from the database
parent
c621fce1
No related branches found
Branches containing commit
No related tags found
1 merge request
!15
Refactorings and compatibility fix
Pipeline
#17828
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
client/views/Exam.jsx
+10
-4
10 additions, 4 deletions
client/views/Exam.jsx
client/views/ExamEditor.jsx
+1
-1
1 addition, 1 deletion
client/views/ExamEditor.jsx
with
11 additions
and
5 deletions
client/views/Exam.jsx
+
10
−
4
View file @
9a9ffb9b
...
...
@@ -42,7 +42,11 @@ class Exams extends React.Component {
page
:
problem
.
page
,
name
:
problem
.
name
,
graded
:
problem
.
graded
,
mc_options
:
problem
.
mc_options
,
mc_options
:
problem
.
mc_options
.
map
((
option
)
=>
{
option
.
widget
.
x
-=
7
option
.
widget
.
y
-=
21
return
option
}),
isMCQ
:
problem
.
mc_options
&&
problem
.
mc_options
.
length
!==
0
// is the problem a mc question - used to display PanelMCQ
}
}
...
...
@@ -319,7 +323,7 @@ class Exams extends React.Component {
return
{
'
widget
'
:
{
'
x
'
:
{
$set
:
data
.
x
+
i
*
2
3
$set
:
data
.
x
+
i
*
2
4
},
'
y
'
:
{
// each mc option needs to be positioned next to the previous option and should not overlap it
...
...
@@ -359,8 +363,8 @@ class Exams extends React.Component {
'
feedback_id
'
:
null
,
'
widget
'
:
{
'
name
'
:
'
mc_option_
'
+
labels
[
index
],
'
x
'
:
xPos
+
6
,
'
y
'
:
yPos
+
1
1
,
'
x
'
:
xPos
+
7
,
'
y
'
:
yPos
+
2
1
,
'
type
'
:
'
mcq_widget
'
}
}
...
...
@@ -373,6 +377,8 @@ class Exams extends React.Component {
formData
.
append
(
'
label
'
,
data
.
label
)
api
.
put
(
'
mult-choice/
'
,
formData
).
then
(
result
=>
{
data
.
id
=
result
.
mult_choice_id
data
.
widget
.
x
-=
7
data
.
widget
.
y
-=
21
this
.
createNewMCOWidget
(
problemWidget
,
data
)
this
.
generateAnswerBoxes
(
problemWidget
,
labels
,
index
+
1
,
xPos
+
24
,
yPos
)
}).
catch
(
err
=>
{
...
...
This diff is collapsed.
Click to expand it.
client/views/ExamEditor.jsx
+
1
−
1
View file @
9a9ffb9b
...
...
@@ -232,7 +232,7 @@ class ExamEditor extends React.Component {
widget
.
problem
.
mc_options
.
forEach
(
(
option
,
i
)
=>
{
let
newData
=
{
x
:
Math
.
round
(
data
.
x
)
+
i
*
2
3
+
7
,
x
:
Math
.
round
(
data
.
x
)
+
i
*
2
4
+
7
,
y
:
Math
.
round
(
data
.
y
)
+
21
}
this
.
updateWidgetPositionDB
(
option
,
newData
)
...
...
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