Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DoneXBlock
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
DoneXBlock
Commits
e1d854be
Commit
e1d854be
authored
May 28, 2014
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initializing repo
parent
78a3f7cb
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
44 additions
and
45 deletions
+44
-45
README.md
+5
-7
config.yaml
+7
-8
done/__init__.py
+2
-0
done/done.py
+10
-10
done/static/css/done.css
+4
-3
done/static/html/done.html
+1
-1
done/static/js/src/done.js
+0
-0
setup.py
+7
-6
template/__init__.py
+0
-2
xmaker.py
+8
-8
No files found.
README.md
View file @
e1d854be
Templat
eXBlock
Don
eXBlock
==============
==============
This is a simple template for an XBlock. It will play audio files as
Lets a student mark they've finished an activity
an HTML5 audio element. If unavailable, it will fall back to an embed
element.
Usage:
FutureLearn uses this kind of thing to great effect. Students can
read text, watch videos, etc., and mark when their done. Honor
<template src="http://server.tld/static/song.mp3" />
code grading, and convenient progress indication.
config.yaml
View file @
e1d854be
...
@@ -2,16 +2,16 @@
...
@@ -2,16 +2,16 @@
#
#
# Step 1: Come up with a short name for your XBlock. For example, if
# Step 1: Come up with a short name for your XBlock. For example, if
# your XBlock plays audio files, 'audio' is a good name.
# your XBlock plays audio files, 'audio' is a good name.
short-name
:
audio
short-name
:
done
# Step 2: Create a repository on github for your XBlock. In the above
# Step 2: Create a repository on github for your XBlock. In the above
# case, I strongly recommend the short name, followed by 'XBlock,' in
# case, I strongly recommend the short name, followed by 'XBlock,' in
# camelcase. Do not initialize this repo. We'll do it for you
# camelcase. Do not initialize this repo. We'll do it for you
github
:
git@github.com:pmitros/
Audio
XBlock.git
github
:
git@github.com:pmitros/
Done
XBlock.git
# Step 3: Give a short description of this XBlock
# Step 3: Give a short description of this XBlock
description
:
Plays an audio file as an embed element
description
:
Lets a student mark they've finished an activity
# Step 4: Give a multiline description. Keep the 2 line indent, please.
# Step 4: Give a multiline description. Keep the 2 line indent, please.
overview
:
|
overview
:
|
This XBlock plays an audio file as an HTML5 audio element. If
FutureLearn uses this kind of thing to great effect. Students can
the audio element is not present, it will fall back to an
read text, watch videos, etc., and mark when their done. Honor
embed element.
code grading, and convenient progress indication.
# Once you're done, hit save, and watch the magic happen!
# Once you're done, hit save, and watch the magic happen!
\ No newline at end of file
done/__init__.py
0 → 100644
View file @
e1d854be
from
.done
import
DoneXBlock
\ No newline at end of file
template/templat
e.py
→
done/don
e.py
View file @
e1d854be
...
@@ -7,7 +7,7 @@ from xblock.fields import Scope, Integer, String
...
@@ -7,7 +7,7 @@ from xblock.fields import Scope, Integer, String
from
xblock.fragment
import
Fragment
from
xblock.fragment
import
Fragment
class
Templat
eXBlock
(
XBlock
):
class
Don
eXBlock
(
XBlock
):
"""
"""
This XBlock will play an MP3 file as an HTML5 audio element.
This XBlock will play an MP3 file as an HTML5 audio element.
"""
"""
...
@@ -27,16 +27,16 @@ class TemplateXBlock(XBlock):
...
@@ -27,16 +27,16 @@ class TemplateXBlock(XBlock):
# TO-DO: change this view to display your data your own way.
# TO-DO: change this view to display your data your own way.
def
student_view
(
self
,
context
=
None
):
def
student_view
(
self
,
context
=
None
):
"""
"""
The primary view of the
Templat
eXBlock, shown to students
The primary view of the
Don
eXBlock, shown to students
when viewing courses.
when viewing courses.
"""
"""
html
=
self
.
resource_string
(
"static/html/
templat
e.html"
)
html
=
self
.
resource_string
(
"static/html/
don
e.html"
)
print
self
.
src
print
self
.
src
print
html
.
format
print
html
.
format
frag
=
Fragment
(
html
.
format
(
src
=
self
.
src
))
frag
=
Fragment
(
html
.
format
(
src
=
self
.
src
))
frag
.
add_css
(
self
.
resource_string
(
"static/css/
templat
e.css"
))
frag
.
add_css
(
self
.
resource_string
(
"static/css/
don
e.css"
))
frag
.
add_javascript
(
self
.
resource_string
(
"static/js/src/
templat
e.js"
))
frag
.
add_javascript
(
self
.
resource_string
(
"static/js/src/
don
e.js"
))
frag
.
initialize_js
(
'
Templat
eXBlock'
)
frag
.
initialize_js
(
'
Don
eXBlock'
)
print
self
.
xml_text_content
()
print
self
.
xml_text_content
()
return
frag
return
frag
...
@@ -46,11 +46,11 @@ class TemplateXBlock(XBlock):
...
@@ -46,11 +46,11 @@ class TemplateXBlock(XBlock):
def
workbench_scenarios
():
def
workbench_scenarios
():
"""A canned scenario for display in the workbench."""
"""A canned scenario for display in the workbench."""
return
[
return
[
(
"
Templat
eXBlock"
,
(
"
Don
eXBlock"
,
"""<vertical_demo>
"""<vertical_demo>
<
template src="http://localhost/Ikea.mp3"> </templat
e>
<
done src="http://localhost/Ikea.mp3"> </don
e>
<
template src="http://localhost/skull.mp3"> </templat
e>
<
done src="http://localhost/skull.mp3"> </don
e>
<
template src="http://localhost/monkey.mp3"> </templat
e>
<
done src="http://localhost/monkey.mp3"> </don
e>
</vertical_demo>
</vertical_demo>
"""
),
"""
),
]
]
template/static/css/templat
e.css
→
done/static/css/don
e.css
View file @
e1d854be
/* CSS for
Templat
eXBlock */
/* CSS for
Don
eXBlock */
.
templat
e_block
.count
{
.
don
e_block
.count
{
font-weight
:
bold
;
font-weight
:
bold
;
}
}
.
templat
e_block
p
{
.
don
e_block
p
{
cursor
:
pointer
;
cursor
:
pointer
;
}
}
\ No newline at end of file
template/static/html/templat
e.html
→
done/static/html/don
e.html
View file @
e1d854be
<div
class=
"
templat
e_block"
>
<div
class=
"
don
e_block"
>
<audio
controls
preload
>
<audio
controls
preload
>
<source
src=
"{src}"
>
<source
src=
"{src}"
>
<embed
height=
"50"
width=
"100"
src=
"{src}"
>
<embed
height=
"50"
width=
"100"
src=
"{src}"
>
...
...
template/static/js/src/templat
e.js
→
done/static/js/src/don
e.js
View file @
e1d854be
File moved
setup.py
View file @
e1d854be
"""Setup for
templat
e XBlock."""
"""Setup for
don
e XBlock."""
import
os
import
os
from
setuptools
import
setup
from
setuptools
import
setup
...
@@ -15,19 +15,19 @@ def package_data(pkg, root):
...
@@ -15,19 +15,19 @@ def package_data(pkg, root):
setup
(
setup
(
name
=
'
templat
e-xblock'
,
name
=
'
don
e-xblock'
,
version
=
'0.1'
,
version
=
'0.1'
,
description
=
'
templat
e XBlock'
,
# TODO: write a better description.
description
=
'
don
e XBlock'
,
# TODO: write a better description.
packages
=
[
packages
=
[
'
templat
e'
,
'
don
e'
,
],
],
install_requires
=
[
install_requires
=
[
'XBlock'
,
'XBlock'
,
],
],
entry_points
=
{
entry_points
=
{
'xblock.v1'
:
[
'xblock.v1'
:
[
'
template = template:Templat
eXBlock'
,
'
done = done:Don
eXBlock'
,
]
]
},
},
package_data
=
package_data
(
"
templat
e"
,
"static"
),
package_data
=
package_data
(
"
don
e"
,
"static"
),
)
)
\ No newline at end of file
template/__init__.py
deleted
100644 → 0
View file @
78a3f7cb
from
.template
import
TemplateXBlock
\ No newline at end of file
xmaker.py
View file @
e1d854be
...
@@ -3,14 +3,14 @@ import yaml
...
@@ -3,14 +3,14 @@ import yaml
import
os
import
os
commands
=
'''
commands
=
'''
git mv ./
template/template.py ./templat
e/{shortname}.py
git mv ./
done/done.py ./don
e/{shortname}.py
git mv ./
template/static/html/template.html ./templat
e/static/html/{shortname}.html
git mv ./
done/static/html/done.html ./don
e/static/html/{shortname}.html
git mv ./
template/static/css/template.css ./templat
e/static/css/{shortname}.css
git mv ./
done/static/css/done.css ./don
e/static/css/{shortname}.css
git mv ./
template/static/js/src/template.js ./templat
e/static/js/src/{shortname}.js
git mv ./
done/static/js/src/done.js ./don
e/static/js/src/{shortname}.js
git mv
templat
e {shortname}
git mv
don
e {shortname}
find . -type f | grep -v git | xargs sed -i 's/
templat
e/{shortname}/g'
find . -type f | grep -v git | xargs sed -i 's/
don
e/{shortname}/g'
find . -type f | grep -v git | xargs sed -i 's/
Templat
e/{Shortname}/g'
find . -type f | grep -v git | xargs sed -i 's/
Don
e/{Shortname}/g'
git remote rm origin
git remote rm origin
git remote add origin {github}
git remote add origin {github}
...
...
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