Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-drag-and-drop-v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
xblock-drag-and-drop-v2
Commits
e8272f89
Commit
e8272f89
authored
Jul 14, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5 from FiloSottile/feedback
Feedback restyle and popup
parents
cdf97796
79964e78
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
23 deletions
+61
-23
drag_and_drop_v2/public/css/drag_and_drop.css
+40
-5
drag_and_drop_v2/public/js/drag_and_drop.js
+9
-11
drag_and_drop_v2/templates/html/drag_and_drop.html
+12
-7
No files found.
drag_and_drop_v2/public/css/drag_and_drop.css
View file @
e8272f89
...
@@ -32,6 +32,14 @@
...
@@ -32,6 +32,14 @@
clear
:
both
;
clear
:
both
;
}
}
.xblock--drag-and-drop
.title1
{
color
:
rgb
(
85
,
85
,
85
);
text-transform
:
uppercase
;
font-weight
:
bold
;
font-style
:
normal
;
margin
:
10px
0
;
}
/** Draggable Items **/
/** Draggable Items **/
.xblock--drag-and-drop
.drag-container
.items
{
.xblock--drag-and-drop
.drag-container
.items
{
...
@@ -133,12 +141,39 @@
...
@@ -133,12 +141,39 @@
}
}
/*** FEEDBACK ***/
/*** FEEDBACK ***/
.xblock--drag-and-drop
.feedback
p
{
.xblock--drag-and-drop
.feedback
{
line-height
:
1.5em
;
margin-top
:
20px
;
font-weight
:
bold
;
border-top
:
solid
1px
rgb
(
189
,
189
,
189
)
;
margin-bottom
:
1.41575em
;
padding-top
:
20px
;
}
}
.
no-close
.ui-dialog-titlebar-close
{
.
xblock--drag-and-drop
.popup
{
display
:
none
;
display
:
none
;
position
:
absolute
;
top
:
20px
;
right
:
20px
;
background
:
none
repeat
scroll
0
0
#66A5B5
;
opacity
:
0.9
;
padding
:
10px
;
width
:
300px
;
z-index
:
100
;
}
.xblock--drag-and-drop
.popup
.popup-content
{
color
:
#fff
;
font-family
:
arial
;
font-size
:
14px
;
}
.xblock--drag-and-drop
.popup
.close
{
cursor
:
pointer
;
position
:
absolute
;
top
:
5px
;
right
:
3px
;
width
:
18px
;
height
:
21px
;
font-family
:
FontAwesome
;
font-style
:
normal
;
text-align
:
center
;
color
:
#fff
;
}
}
drag_and_drop_v2/public/js/drag_and_drop.js
View file @
e8272f89
...
@@ -6,6 +6,7 @@ function DragAndDropBlock(runtime, element) {
...
@@ -6,6 +6,7 @@ function DragAndDropBlock(runtime, element) {
$ul
:
$
(
'.xblock--drag-and-drop .items'
,
element
),
$ul
:
$
(
'.xblock--drag-and-drop .items'
,
element
),
$target
:
$
(
'.xblock--drag-and-drop .target-img'
,
element
),
$target
:
$
(
'.xblock--drag-and-drop .target-img'
,
element
),
$feedback
:
$
(
'.xblock--drag-and-drop .feedback .message'
,
element
),
$feedback
:
$
(
'.xblock--drag-and-drop .feedback .message'
,
element
),
$popup
:
$
(
'.xblock--drag-and-drop .popup'
,
element
),
// Cannot set until items added to DOM
// Cannot set until items added to DOM
$items
:
{},
// $('.xblock--drag-and-drop .items .option'),
$items
:
{},
// $('.xblock--drag-and-drop .items .option'),
...
@@ -82,6 +83,10 @@ function DragAndDropBlock(runtime, element) {
...
@@ -82,6 +83,10 @@ function DragAndDropBlock(runtime, element) {
$dropzone
.
on
(
'drop'
,
clk
.
drop
.
success
);
$dropzone
.
on
(
'drop'
,
clk
.
drop
.
success
);
$dropzone
.
on
(
'dropover'
,
clk
.
drop
.
hover
);
$dropzone
.
on
(
'dropover'
,
clk
.
drop
.
hover
);
$
(
".close"
,
_fn
.
$popup
).
on
(
'click'
,
function
()
{
_fn
.
$popup
.
hide
();
});
},
},
drag
:
{
drag
:
{
start
:
function
(
event
,
ui
)
{
start
:
function
(
event
,
ui
)
{
...
@@ -207,23 +212,16 @@ function DragAndDropBlock(runtime, element) {
...
@@ -207,23 +212,16 @@ function DragAndDropBlock(runtime, element) {
feedback
:
{
feedback
:
{
// Update DOM with feedback
// Update DOM with feedback
set
:
function
(
str
)
{
set
:
function
(
str
)
{
if
(
$
.
trim
(
str
)
===
''
)
_fn
.
$feedback
.
parent
().
hide
();
else
_fn
.
$feedback
.
parent
().
show
();
return
_fn
.
$feedback
.
html
(
str
);
return
_fn
.
$feedback
.
html
(
str
);
},
},
// Show a feedback popup
// Show a feedback popup
popup
:
function
(
str
,
boo
)
{
popup
:
function
(
str
,
boo
)
{
if
(
str
===
undefined
||
str
===
''
)
return
;
if
(
str
===
undefined
||
str
===
''
)
return
;
return
$
(
"<div>"
).
attr
(
'title'
,
boo
?
'Correct'
:
'Incorrect'
)
_fn
.
$popup
.
find
(
".popup-content"
).
text
(
str
);
.
text
(
str
)
return
_fn
.
$popup
.
show
();
.
dialog
({
dialogClass
:
"no-close"
,
modal
:
true
,
buttons
:
{
Ok
:
function
()
{
$
(
this
).
dialog
(
"close"
);
}
}
});
}
}
},
},
...
...
drag_and_drop_v2/templates/html/drag_and_drop.html
View file @
e8272f89
...
@@ -8,16 +8,16 @@
...
@@ -8,16 +8,16 @@
<div
class=
"problem-progress"
>
{{ max_score_string }}
</div>
<div
class=
"problem-progress"
>
{{ max_score_string }}
</div>
<section
class=
"problem"
role=
"application"
>
<section
class=
"problem"
role=
"application"
>
<p>
<div
class=
"title1"
>
Question
</div>
{{ question_text }}
<p>
{{ question_text }}
</p>
</p>
</section>
<section
class=
"feedback"
>
<p
class=
"message"
></p>
</section>
</section>
<section
class=
"drag-container"
>
<section
class=
"drag-container"
>
<div
class=
"popup"
>
<div
class=
"close icon-remove-sign fa-times-circle"
></div>
<p
class=
"popup-content"
></p>
</div>
<ul
class=
"items"
></ul>
<ul
class=
"items"
></ul>
<div
class=
"target"
>
<div
class=
"target"
>
...
@@ -26,4 +26,9 @@
...
@@ -26,4 +26,9 @@
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</section>
</section>
<section
class=
"feedback"
>
<div
class=
"title1"
>
Feedback
</div>
<p
class=
"message"
></p>
</section>
</section>
</section>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment