Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
7533a112
Commit
7533a112
authored
Aug 22, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some quick cleanup on Javascript and tests.
parent
e29f446d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
27 additions
and
24 deletions
+27
-24
openassessment/xblock/static/js/openassessment-lms.min.js
+0
-0
openassessment/xblock/static/js/openassessment-studio.min.js
+0
-0
openassessment/xblock/static/js/spec/oa_server.js
+0
-2
openassessment/xblock/static/js/src/lms/oa_peer.js
+0
-3
openassessment/xblock/static/js/src/lms/oa_response.js
+1
-3
openassessment/xblock/static/js/src/oa_server.js
+11
-12
openassessment/xblock/static/js/src/oa_shared.js
+12
-0
openassessment/xblock/test/data/student_training_mixin.json
+1
-1
openassessment/xblock/test/test_student_training.py
+2
-3
No files found.
openassessment/xblock/static/js/openassessment-lms.min.js
View file @
7533a112
This diff is collapsed.
Click to expand it.
openassessment/xblock/static/js/openassessment-studio.min.js
View file @
7533a112
This diff is collapsed.
Click to expand it.
openassessment/xblock/static/js/spec/oa_server.js
View file @
7533a112
...
...
@@ -243,7 +243,6 @@ describe("OpenAssessment.Server", function() {
assessments
:
ASSESSMENTS
,
editorAssessmentsOrder
:
EDITOR_ASSESSMENTS_ORDER
,
imageSubmissionEnabled
:
true
,
latexEnabled
:
false
,
leaderboardNum
:
15
});
expect
(
$
.
ajax
).
toHaveBeenCalledWith
({
...
...
@@ -259,7 +258,6 @@ describe("OpenAssessment.Server", function() {
assessments
:
ASSESSMENTS
,
editor_assessments_order
:
EDITOR_ASSESSMENTS_ORDER
,
allow_file_upload
:
true
,
latexEnabled
:
false
,
leaderboard_show
:
15
})
});
...
...
openassessment/xblock/static/js/src/lms/oa_peer.js
View file @
7533a112
...
...
@@ -52,9 +52,6 @@ OpenAssessment.PeerView.prototype = {
// Load the HTML and install event handlers
$
(
'#openassessment__peer-assessment'
,
view
.
element
).
replaceWith
(
html
);
view
.
installHandlers
(
true
);
if
(
MathJax
!=
undefined
&&
MathJax
!=
null
)
{
MathJax
.
Hub
.
Typeset
(
$
(
'#openassessment__peer-assessment'
,
view
.
element
)[
0
]);
}
}
).
fail
(
function
(
errMsg
)
{
view
.
baseView
.
showLoadError
(
'peer-assessment'
);
...
...
openassessment/xblock/static/js/src/lms/oa_response.js
View file @
7533a112
...
...
@@ -101,9 +101,7 @@ OpenAssessment.ResponseView.prototype = {
// Render in mathjax
sel
.
find
(
'#submission__preview__item'
).
show
();
if
(
MathJax
!==
undefined
&&
MathJax
!==
null
)
{
MathJax
.
Hub
.
Queue
([
'Typeset'
,
MathJax
.
Hub
,
preview_container
[
0
]]);
}
MathJax
.
Hub
.
Queue
([
'Typeset'
,
MathJax
.
Hub
,
preview_container
[
0
]]);
}
);
...
...
openassessment/xblock/static/js/src/oa_server.js
View file @
7533a112
...
...
@@ -64,9 +64,7 @@ if (typeof OpenAssessment.Server == "undefined" || !OpenAssessment.Server) {
dataType
:
"html"
}).
done
(
function
(
data
)
{
defer
.
resolveWith
(
this
,
[
data
]);
if
(
window
.
MathJax
)
{
that
.
renderLatex
();
}
that
.
renderLatex
(
data
);
}).
fail
(
function
(
data
)
{
defer
.
rejectWith
(
this
,
[
gettext
(
'This section could not be loaded.'
)]);
});
...
...
@@ -75,17 +73,16 @@ if (typeof OpenAssessment.Server == "undefined" || !OpenAssessment.Server) {
/**
Render Latex for all new DOM elements with class 'allow--latex'.
Once rendered, remove the class so that a single element does
not get rendered multiple times.
Args:
element: The element to modify.
**/
renderLatex
:
function
()
{
var
i
,
latex_elems
=
$
(
'.allow--latex'
);
if
(
latex_elems
&&
latex_elems
.
length
!==
0
)
{
for
(
i
=
0
;
i
<
latex_elems
.
length
;
i
++
)
{
MathJax
.
Hub
.
Queue
([
'Typeset'
,
MathJax
.
Hub
,
latex_elems
[
i
]]);
renderLatex
:
function
(
element
)
{
$
(
'.allow--latex'
,
element
).
each
(
function
()
{
MathJax
.
Hub
.
Queue
([
'Typeset'
,
MathJax
.
Hub
,
this
]);
}
}
latex_elems
.
removeClass
(
'allow--latex'
);
);
},
/**
...
...
@@ -104,6 +101,7 @@ if (typeof OpenAssessment.Server == "undefined" || !OpenAssessment.Server) {
)
**/
renderContinuedPeer
:
function
()
{
var
view
=
this
;
var
url
=
this
.
url
(
'render_peer_assessment'
);
return
$
.
Deferred
(
function
(
defer
)
{
$
.
ajax
({
...
...
@@ -113,6 +111,7 @@ if (typeof OpenAssessment.Server == "undefined" || !OpenAssessment.Server) {
data
:
{
continue_grading
:
true
}
}).
done
(
function
(
data
)
{
defer
.
resolveWith
(
this
,
[
data
]);
view
.
renderLatex
(
data
);
}).
fail
(
function
(
data
)
{
defer
.
rejectWith
(
this
,
[
gettext
(
'This section could not be loaded.'
)]);
});
...
...
openassessment/xblock/static/js/src/oa_shared.js
View file @
7533a112
...
...
@@ -36,4 +36,15 @@ if (typeof window.Logger === 'undefined') {
window
.
Logger
=
{
log
:
function
(
event_type
,
data
,
kwargs
)
{}
};
}
// Stub MathJax is the runtime doesn't provide it
if
(
typeof
window
.
MathJax
===
'undefined'
)
{
window
.
MathJax
=
{
Hub
:
{
Typeset
:
function
(
data
){},
Queue
:
function
(
list
){}
}
};
}
\ No newline at end of file
openassessment/xblock/test/data/student_training_mixin.json
View file @
7533a112
...
...
@@ -6,7 +6,7 @@
"training_num_current"
:
1
,
"training_num_available"
:
2
,
"training_essay"
:
"This is my answer."
,
"allow_latex"
:
F
alse
,
"allow_latex"
:
f
alse
,
"training_rubric"
:
{
"criteria"
:
[
{
...
...
openassessment/xblock/test/test_student_training.py
View file @
7533a112
...
...
@@ -24,7 +24,6 @@ class StudentTrainingTest(XBlockHandlerTestCase):
'submission'
:
u'Thé őbjéćt őf édúćátíőń íś tő téáćh úś tő ĺővé ẃhát íś béáútífúĺ.'
}
def
assert_path_and_context
(
self
,
xblock
,
expected_path
,
expected_context
):
"""
Render the student training step and verify that the expected template
...
...
@@ -49,7 +48,7 @@ class StudentTrainingTest(XBlockHandlerTestCase):
else
:
self
.
assertEqual
(
context
[
key
],
expected_context
[
key
])
# Verify that we render without error
# Verify that we render without error
resp
=
self
.
request
(
xblock
,
'render_student_training'
,
json
.
dumps
({}))
self
.
assertGreater
(
len
(
resp
),
0
)
...
...
@@ -163,7 +162,7 @@ class StudentTrainingAssessTest(StudentTrainingTest):
# Expect that we were correct
self
.
assertTrue
(
resp
[
'success'
],
msg
=
resp
.
get
(
'msg'
))
self
.
assertFalse
(
resp
[
'corrections'
])
expected_context
=
{}
expected_context
=
{
"allow_latex"
:
False
}
expected_template
=
"openassessmentblock/student_training/student_training_complete.html"
self
.
assert_path_and_context
(
xblock
,
expected_template
,
expected_context
)
...
...
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