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
95664d4a
Commit
95664d4a
authored
Aug 26, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17 from dragonfi/hide-reset-button
Fix some issues
parents
23564e28
83971e2f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
drag_and_drop_v2/drag_and_drop_v2.py
+3
-2
drag_and_drop_v2/public/css/drag_and_drop.css
+1
-0
drag_and_drop_v2/public/js/drag_and_drop.js
+2
-0
No files found.
drag_and_drop_v2/drag_and_drop_v2.py
View file @
95664d4a
...
@@ -179,9 +179,10 @@ class DragAndDropBlock(XBlock):
...
@@ -179,9 +179,10 @@ class DragAndDropBlock(XBlock):
if
self
.
_is_finished
():
if
self
.
_is_finished
():
final_feedback
=
self
.
data
[
'feedback'
][
'finish'
]
final_feedback
=
self
.
data
[
'feedback'
][
'finish'
]
#
only publish the grade onc
e
#
don't publish the grade if the student has already completed the exercis
e
if
not
self
.
completed
:
if
not
self
.
completed
:
self
.
completed
=
True
if
self
.
_is_finished
():
self
.
completed
=
True
try
:
try
:
self
.
runtime
.
publish
(
self
,
'grade'
,
{
self
.
runtime
.
publish
(
self
,
'grade'
,
{
'value'
:
len
(
self
.
item_state
)
/
float
(
tot_items
)
*
self
.
weight
,
'value'
:
len
(
self
.
item_state
)
/
float
(
tot_items
)
*
self
.
weight
,
...
...
drag_and_drop_v2/public/css/drag_and_drop.css
View file @
95664d4a
...
@@ -185,4 +185,5 @@
...
@@ -185,4 +185,5 @@
float
:
right
;
float
:
right
;
color
:
#3384CA
;
color
:
#3384CA
;
margin-top
:
3px
;
margin-top
:
3px
;
display
:
none
;
}
}
drag_and_drop_v2/public/js/drag_and_drop.js
View file @
95664d4a
...
@@ -78,6 +78,7 @@ function DragAndDropBlock(runtime, element) {
...
@@ -78,6 +78,7 @@ function DragAndDropBlock(runtime, element) {
finish
:
function
(
final_feedback
)
{
finish
:
function
(
final_feedback
)
{
// Disable any decoy items
// Disable any decoy items
_fn
.
$items
.
draggable
(
'disable'
);
_fn
.
$items
.
draggable
(
'disable'
);
_fn
.
$reset_button
.
show
();
// Show final feedback
// Show final feedback
if
(
final_feedback
)
_fn
.
feedback
.
set
(
final_feedback
);
if
(
final_feedback
)
_fn
.
feedback
.
set
(
final_feedback
);
...
@@ -89,6 +90,7 @@ function DragAndDropBlock(runtime, element) {
...
@@ -89,6 +90,7 @@ function DragAndDropBlock(runtime, element) {
_fn
.
clickHandlers
.
drag
.
reset
(
$
(
element
));
_fn
.
clickHandlers
.
drag
.
reset
(
$
(
element
));
});
});
_fn
.
$popup
.
hide
();
_fn
.
$popup
.
hide
();
_fn
.
$reset_button
.
hide
();
_fn
.
feedback
.
set
(
_fn
.
data
.
feedback
.
start
);
_fn
.
feedback
.
set
(
_fn
.
data
.
feedback
.
start
);
},
},
...
...
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