Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
acid-block
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
acid-block
Commits
df1a7f0c
Commit
df1a7f0c
authored
Oct 16, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8 from cpennington/count-acid-children-only
Count only acid-children in javascript child count tests.
parents
3d1e4246
805ef6bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
acid/acid.py
+2
-2
acid/static/js/acid_parent.js
+4
-1
No files found.
acid/acid.py
View file @
df1a7f0c
...
@@ -119,7 +119,7 @@ class AcidBlock(XBlock):
...
@@ -119,7 +119,7 @@ class AcidBlock(XBlock):
# Retrieve the field named for the scope (whose value is a dictionary)
# Retrieve the field named for the scope (whose value is a dictionary)
# and add an entry for this block's usage_id, set to `new_value`.
# and add an entry for this block's usage_id, set to `new_value`.
getattr
(
self
,
scope
)[
str
(
self
.
scope_ids
.
usage_id
)]
=
new_value
getattr
(
self
,
scope
)[
unicode
(
self
.
scope_ids
.
usage_id
)]
=
new_value
query
=
'QUERY={}&SCOPE={}'
.
format
(
new_value
,
scope
)
query
=
'QUERY={}&SCOPE={}'
.
format
(
new_value
,
scope
)
suffix
=
'SUFFIX{}'
.
format
(
new_value
)
suffix
=
'SUFFIX{}'
.
format
(
new_value
)
...
@@ -188,7 +188,7 @@ class AcidBlock(XBlock):
...
@@ -188,7 +188,7 @@ class AcidBlock(XBlock):
if
'QUERY'
not
in
request
.
GET
:
if
'QUERY'
not
in
request
.
GET
:
return
FailureResponse
(
"QUERY is missing from query parameters"
)
return
FailureResponse
(
"QUERY is missing from query parameters"
)
stored_value
=
getattr
(
self
,
scope
)
.
get
(
str
(
self
.
scope_ids
.
usage_id
))
stored_value
=
getattr
(
self
,
scope
)
.
get
(
unicode
(
self
.
scope_ids
.
usage_id
))
query_value
=
int
(
request
.
GET
[
'QUERY'
])
query_value
=
int
(
request
.
GET
[
'QUERY'
])
if
stored_value
!=
query_value
:
if
stored_value
!=
query_value
:
...
...
acid/static/js/acid_parent.js
View file @
df1a7f0c
...
@@ -11,7 +11,10 @@ function AcidParentBlock(runtime, element) {
...
@@ -11,7 +11,10 @@ function AcidParentBlock(runtime, element) {
}
}
function
childTests
()
{
function
childTests
()
{
if
(
acidData
(
'acid-child-count'
)
===
runtime
.
children
(
element
).
length
)
{
var
acidChildCount
=
runtime
.
children
(
element
).
filter
(
function
(
child
)
{
return
child
.
type
==
"acid"
;
}).
length
;
if
(
acidData
(
'acid-child-count'
)
==
acidChildCount
)
{
mark
(
'success'
,
'.child-counts-match'
);
mark
(
'success'
,
'.child-counts-match'
);
}
}
...
...
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