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

Core Structure for supporting multiple XBlocks #2

Merged
merged 25 commits into from
Oct 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
fix: xblock path
  • Loading branch information
irtazaakram committed Jul 24, 2024
commit 26207d4b31bc298ff8196aee85f704a6ef3c59b3
4 changes: 2 additions & 2 deletions utils/create_xblock.sh
Original file line number Diff line number Diff line change
@@ -115,7 +115,7 @@ class $xblock_class(XBlock):
"""
if context:
pass # TO-DO: do something based on the context.
html = self.resource_string("static/html/$xblock_name.html")
html = self.resource_string("templates/$xblock_name.html")
frag = Fragment(html.format(self=self))
frag.add_css(self.resource_string("static/css/$xblock_name.css"))

@@ -150,7 +150,7 @@ EOL
# Add content to templates/xblock_name.html
cat > "$html_file" <<EOL
<div class="$xblock_name">

Congratulations XBlock is running.
</div>
EOL


Unchanged files with check annotations Beta

Create primary view of the PollXBlock, shown to students when viewing courses.
"""
if context:
pass # TO-DO: do something based on the context.

Check warning on line 35 in xblocks_contrib/poll/poll.py

Codecov / codecov/patch

xblocks_contrib/poll/poll.py#L35

Added line #L35 was not covered by tests
html = self.resource_string("static/html/poll.html")
frag = Fragment(html.format(self=self))
frag.add_css(self.resource_string("static/css/poll.css"))
Increments data. An example handler.
"""
if suffix:
pass # TO-DO: Use the suffix when storing data.

Check warning on line 51 in xblocks_contrib/poll/poll.py

Codecov / codecov/patch

xblocks_contrib/poll/poll.py#L51

Added line #L51 was not covered by tests
# Just to show data coming in...
assert data["hello"] == "world"

Check warning on line 53 in xblocks_contrib/poll/poll.py

Codecov / codecov/patch

xblocks_contrib/poll/poll.py#L53

Added line #L53 was not covered by tests
self.count += 1
return {"count": self.count}

Check warning on line 56 in xblocks_contrib/poll/poll.py

Codecov / codecov/patch

xblocks_contrib/poll/poll.py#L55-L56

Added lines #L55 - L56 were not covered by tests
# TO-DO: change this to create the scenarios you'd like to see in the
# workbench while developing your XBlock.
@staticmethod
def workbench_scenarios():
"""Create canned scenario for display in the workbench."""
return [

Check warning on line 63 in xblocks_contrib/poll/poll.py

Codecov / codecov/patch

xblocks_contrib/poll/poll.py#L63

Added line #L63 was not covered by tests
(
"PollXBlock",
"""<poll_xblock/>