Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
7a96faf9
Commit
7a96faf9
authored
May 13, 2014
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3585 from dragonfi/master
Fix #3347: "Run Code" reloads page in Matlab Problem
parents
eadf3b59
8430be3d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
20 deletions
+45
-20
AUTHORS
+1
-0
common/lib/capa/capa/templates/matlabinput.html
+24
-20
lms/static/sass/base/_animations.scss
+20
-0
No files found.
AUTHORS
View file @
7a96faf9
...
...
@@ -143,3 +143,4 @@ Jonas Jelten <jelten@in.tum.de>
Christine Lytwynec <clytwynec@edx.org>
John Cox <johncox@google.com>
Ben Weeks <benweeks@mit.edu>
David Bodor <david.gabor.bodor@gmail.com>
common/lib/capa/capa/templates/matlabinput.html
View file @
7a96faf9
...
...
@@ -39,7 +39,7 @@
<div
class=
"external-grader-message"
aria-live=
"polite"
>
${msg|n}
</div>
<div
class=
"external-grader-message"
aria-live=
"polite"
>
<div
class=
"external-grader-message
ungraded-matlab-result
"
aria-live=
"polite"
>
${queue_msg|n}
</div>
...
...
@@ -55,13 +55,11 @@
if
(
$
(
parent_elt
).
find
(
'.capa_alert'
).
length
)
{
$
(
parent_elt
).
find
(
'.capa_alert'
).
remove
();
}
var
alert_elem
=
"<div>"
+
msg
+
"</div>"
;
alert_elem
=
$
(
alert_elem
).
addClass
(
'capa_alert
'
);
var
alert_elem
=
$
(
"<div>"
+
msg
+
"</div>"
)
;
alert_elem
.
addClass
(
'capa_alert'
).
addClass
(
'is-fading-in
'
);
$
(
parent_elt
).
find
(
'.action'
).
after
(
alert_elem
);
$
(
parent_elt
).
find
(
'.capa_alert'
).
css
({
opacity
:
0
}).
animate
({
opacity
:
1
},
700
);
}
// hook up the plot button
var
plot
=
function
(
event
)
{
var
problem_elt
=
$
(
event
.
target
).
closest
(
'.problems-wrapper'
);
...
...
@@ -72,7 +70,7 @@
// since there could be multiple codemirror instances on the page,
// save all of them.
$
(
'.CodeMirror'
).
each
(
function
(
i
,
el
){
el
.
CodeMirror
.
save
();
el
.
CodeMirror
.
save
();
});
var
input
=
$
(
"#input_${id}"
);
...
...
@@ -81,33 +79,39 @@
answer
=
input
.
serialize
();
// setup callback for after we send information to plot
// a chain of callbacks, each querying the server on success of the previous one
var
get_callback
=
function
(
response
)
{
var
new_result_elem
=
$
(
response
.
html
).
find
(
".ungraded-matlab-result"
);
new_result_elem
.
addClass
(
"is-fading-in"
);
result_elem
=
$
(
problem_elt
).
find
(
".ungraded-matlab-result"
);
result_elem
.
replaceWith
(
new_result_elem
);
console
.
log
(
response
.
html
);
}
var
plot_callback
=
function
(
response
)
{
if
(
response
.
success
)
{
window
.
location
.
reload
();
}
else
{
$
.
postWithPrefix
(
url
+
"/problem_get"
,
get_callback
);
}
else
{
gentle_alert
(
problem_elt
,
response
.
message
);
}
}
var
save_callback
=
function
(
response
)
{
if
(
response
.
success
)
{
// send information to the problem's plot functionality
Problem
.
inputAjax
(
url
,
input_id
,
'plot'
,
{
'submission'
:
submission
},
plot_callback
);
}
else
{
gentle_alert
(
problem_elt
,
response
.
message
);
}
if
(
response
.
success
)
{
// send information to the problem's plot functionality
Problem
.
inputAjax
(
url
,
input_id
,
'plot'
,
{
'submission'
:
submission
},
plot_callback
);
}
else
{
gentle_alert
(
problem_elt
,
response
.
message
);
}
}
// save the answer
$
.
postWithPrefix
(
url
+
'/problem_save'
,
answer
,
save_callback
);
}
$
(
'#plot_${id}'
).
click
(
plot
);
});
</script>
</section>
lms/static/sass/base/_animations.scss
View file @
7a96faf9
...
...
@@ -241,3 +241,23 @@
@-webkit-keyframes
video-appear
{
@include
video-appear-keyframes
;
}
@-moz-keyframes
video-appear
{
@include
video-appear-keyframes
;
}
@keyframes
video-appear
{
@include
video-appear-keyframes
;
}
// quick fade-in animation to get user attention
//************************************************************************//
.is-fading-in
{
@include
animation
(
fade-in-animation
0
.8s
);
}
@mixin
fade-in-keyframes
{
0
%
{
opacity
:
0
.0
;
}
100
%
{
opacity
:
1
.0
;
}
}
@-webkit-keyframes
fade-in-animation
{
@include
fade-in-keyframes
;
}
@-moz-keyframes
fade-in-animation
{
@include
fade-in-keyframes
;
}
@keyframes
fade-in-animation
{
@include
fade-in-keyframes
;
}
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