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
2d5c37b2
Commit
2d5c37b2
authored
Feb 28, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track renders of split_test children
[LMS-2098]
parent
d1019336
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
common/lib/xmodule/xmodule/public/js/split_test_student.js
+5
-0
common/lib/xmodule/xmodule/split_test_module.py
+19
-2
lms/templates/split_test_student_view.html
+3
-0
No files found.
common/lib/xmodule/xmodule/public/js/split_test_student.js
0 → 100644
View file @
2d5c37b2
/* Javascript for the Acid XBlock. */
function
SplitTestStudentView
(
runtime
,
element
)
{
$
.
post
(
runtime
.
handlerUrl
(
element
,
'log_child_render'
));
return
{};
}
common/lib/xmodule/xmodule/split_test_module.py
View file @
2d5c37b2
...
...
@@ -3,6 +3,7 @@ Module for running content split tests
"""
import
logging
from
webob
import
Response
from
xmodule.progress
import
Progress
from
xmodule.seq_module
import
SequenceDescriptor
...
...
@@ -50,7 +51,8 @@ class SplitTestModule(SplitTestFields, XModule):
- There is more dark magic in this code than I'd like. The whole varying-children +
grading interaction is a tangle between super and subclasses of descriptors and
modules.
"""
"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
SplitTestModule
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
...
...
@@ -146,7 +148,21 @@ class SplitTestModule(SplitTestFields, XModule):
if
self
.
system
.
user_is_staff
:
return
self
.
_staff_view
(
context
)
else
:
return
self
.
child
.
render
(
'student_view'
,
context
)
child_fragment
=
self
.
child
.
render
(
'student_view'
,
context
)
fragment
=
Fragment
(
self
.
system
.
render_template
(
'split_test_student_view.html'
,
{
'child_content'
:
child_fragment
.
content
,
'child_id'
:
self
.
child
.
scope_ids
.
usage_id
,
}))
fragment
.
add_frag_resources
(
child_fragment
)
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/js/split_test_student.js'
))
fragment
.
initialize_js
(
'SplitTestStudentView'
)
return
fragment
@XBlock.handler
def
log_child_render
(
self
,
request
,
suffix
=
''
):
# TODO: use publish instead, when publish is wired to the tracking logs
self
.
system
.
track_function
(
'split-test-child-render'
,
{
'child-id'
:
self
.
child
.
scope_ids
.
usage_id
})
return
Response
()
def
get_icon_class
(
self
):
return
self
.
child
.
get_icon_class
()
if
self
.
child
else
'other'
...
...
@@ -167,6 +183,7 @@ class SplitTestDescriptor(SplitTestFields, SequenceDescriptor):
filename_extension
=
"xml"
child_descriptor
=
module_attr
(
'child_descriptor'
)
log_child_render
=
module_attr
(
'log_child_render'
)
def
definition_to_xml
(
self
,
resource_fs
):
...
...
lms/templates/split_test_student_view.html
0 → 100644
View file @
2d5c37b2
<div
class=
'split-test-view'
data-child-id=
'${child_id}'
>
${child_content}
</div>
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