Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds word cloud xblock extracting from edx-platform repo #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions xblocks_contrib/word_cloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
Init for the WordCloudBlock.
"""Word cloud is ungraded xblock used by students to generate and view word cloud.
"""

from .word_cloud import WordCloudBlock
19 changes: 19 additions & 0 deletions xblocks_contrib/word_cloud/static/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
This static directory is for files that should be included in your kit as plain
static files.

You can ask the runtime for a URL that will retrieve these files with:

url = self.runtime.local_resource_url(self, "static/js/lib.js")

The default implementation is very strict though, and will not serve files from
the static directory. It will serve files from a directory named "public".
Create a directory alongside this one named "public", and put files there.
Then you can get a url with code like this:

url = self.runtime.local_resource_url(self, "public/js/lib.js")

The sample code includes a function you can use to read the content of files
in the static directory, like this:

frag.add_javascript(self.resource_string("static/js/my_block.js"))

28 changes: 24 additions & 4 deletions xblocks_contrib/word_cloud/static/css/word_cloud.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
/* CSS for WordCloudBlock */

.word_cloud .count {
font-weight: bold;
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,600,700");

.input-cloud {
margin: calc((var(--baseline, 20px) / 4));
}

.result_cloud_section {
display: none;
width: 0;
height: 0;
}

.result_cloud_section.active {
display: block;
width: 100%;
height: auto;
margin-top: 1em;
}

.result_cloud_section.active h3 {
font-size: 100%;
}

.word_cloud p {
cursor: pointer;
.your_words {
font-size: 0.85em;
display: block;
}
Loading
Loading