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
ff619d9b
Commit
ff619d9b
authored
Nov 16, 2016
by
Toby Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to dedicated student/author views.
parent
da664ce7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
17 deletions
+15
-17
common/lib/xmodule/xmodule/word_cloud_module.py
+15
-12
lms/templates/word_cloud.html
+0
-5
No files found.
common/lib/xmodule/xmodule/word_cloud_module.py
View file @
ff619d9b
...
@@ -15,6 +15,7 @@ from xmodule.editing_module import MetadataOnlyEditingDescriptor
...
@@ -15,6 +15,7 @@ from xmodule.editing_module import MetadataOnlyEditingDescriptor
from
xmodule.x_module
import
XModule
from
xmodule.x_module
import
XModule
from
xblock.fields
import
Scope
,
Dict
,
Boolean
,
List
,
Integer
,
String
from
xblock.fields
import
Scope
,
Dict
,
Boolean
,
List
,
Integer
,
String
from
xblock.fragment
import
Fragment
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -233,19 +234,14 @@ class WordCloudModule(WordCloudFields, XModule):
...
@@ -233,19 +234,14 @@ class WordCloudModule(WordCloudFields, XModule):
'error'
:
'Unknown Command!'
'error'
:
'Unknown Command!'
})
})
def
get_html
(
self
):
def
student_view
(
self
,
context
):
"""
"""
Template rendering.
Template rendering.
"""
"""
js_includes
=
[
fragment
=
Fragment
()
self
.
runtime
.
local_resource_url
(
self
,
'public/js/d3.min.js'
),
self
.
runtime
.
local_resource_url
(
self
,
'public/js/d3.layout.cloud.js'
),
self
.
runtime
.
local_resource_url
(
self
,
'public/js/word_cloud.js'
),
self
.
runtime
.
local_resource_url
(
self
,
'public/js/word_cloud_main.js'
),
]
context
=
{
fragment
.
add_content
(
self
.
system
.
render_template
(
'word_cloud.html'
,
{
'ajax_url'
:
self
.
system
.
ajax_url
,
'ajax_url'
:
self
.
system
.
ajax_url
,
'display_name'
:
self
.
display_name
,
'display_name'
:
self
.
display_name
,
'instructions'
:
self
.
instructions
,
'instructions'
:
self
.
instructions
,
...
@@ -253,10 +249,17 @@ class WordCloudModule(WordCloudFields, XModule):
...
@@ -253,10 +249,17 @@ class WordCloudModule(WordCloudFields, XModule):
'element_id'
:
self
.
location
.
html_id
(),
'element_id'
:
self
.
location
.
html_id
(),
'num_inputs'
:
self
.
num_inputs
,
'num_inputs'
:
self
.
num_inputs
,
'submitted'
:
self
.
submitted
,
'submitted'
:
self
.
submitted
,
'js_includes'
:
js_includes
,
}))
}
self
.
content
=
self
.
system
.
render_template
(
'word_cloud.html'
,
context
)
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/js/d3.min.js'
))
return
self
.
content
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/js/d3.layout.cloud.js'
))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/js/word_cloud.js'
))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/js/word_cloud_main.js'
))
return
fragment
def
author_view
(
self
,
context
):
return
self
.
student_view
(
context
)
class
WordCloudDescriptor
(
WordCloudFields
,
MetadataOnlyEditingDescriptor
,
EmptyDataRawDescriptor
):
class
WordCloudDescriptor
(
WordCloudFields
,
MetadataOnlyEditingDescriptor
,
EmptyDataRawDescriptor
):
...
...
lms/templates/word_cloud.html
View file @
ff619d9b
...
@@ -6,11 +6,6 @@
...
@@ -6,11 +6,6 @@
class=
"${element_class}"
class=
"${element_class}"
data-ajax-url=
"${ajax_url}"
data-ajax-url=
"${ajax_url}"
>
>
% for js_include in js_includes:
<script
src=
"${js_include}"
></script>
% endfor
% if display_name:
% if display_name:
<h3
class=
"hd hd-3"
id=
"word_cloud_${element_id}_heading"
>
${display_name}
</h3>
<h3
class=
"hd hd-3"
id=
"word_cloud_${element_id}_heading"
>
${display_name}
</h3>
% endif
% endif
...
...
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