Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-activetable
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
xblock-activetable
Commits
dbe54692
Commit
dbe54692
authored
Oct 20, 2015
by
Sven Marnach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accessibility improvements.
parent
04b9e98a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
activetable/static/css/activetable.css
+10
-1
activetable/static/js/src/activetable.js
+9
-2
activetable/templates/html/activetable.html
+2
-2
No files found.
activetable/static/css/activetable.css
View file @
dbe54692
...
@@ -81,15 +81,24 @@
...
@@ -81,15 +81,24 @@
padding
:
6px
10px
0
;
padding
:
6px
10px
0
;
color
:
#009fe6
;
color
:
#009fe6
;
cursor
:
pointer
;
cursor
:
pointer
;
line-height
:
2em
;
box-shadow
:
none
;
text-shadow
:
none
;
background
:
none
;
border
:
none
;
outline
:
none
;
}
}
.activetable_block
#activetable-help-button
:hover
{
.activetable_block
#activetable-help-button
:hover
{
color
:
#bd9730
;
color
:
#bd9730
;
}
}
.activetable_block
.status
{
.activetable_block
.status
{
margin
:
1.5em
0
0.5em
;
display
:
inline-block
;
display
:
inline-block
;
margin
:
1.5em
0
0.5em
!important
;
width
:
20px
;
width
:
20px
;
height
:
20px
;
height
:
20px
;
text-indent
:
100%
;
white-space
:
nowrap
;
overflow
:
hidden
;
background
:
url("/static/images/unanswered-icon.png")
center
no-repeat
;
background
:
url("/static/images/unanswered-icon.png")
center
no-repeat
;
}
}
.activetable_block
.status.correct
{
.activetable_block
.status.correct
{
...
...
activetable/static/js/src/activetable.js
View file @
dbe54692
...
@@ -8,9 +8,11 @@ function ActiveTableXBlock(runtime, element, init_args) {
...
@@ -8,9 +8,11 @@ function ActiveTableXBlock(runtime, element, init_args) {
var
$status_message
=
$
(
'.status-message'
,
element
);
var
$status_message
=
$
(
'.status-message'
,
element
);
if
(
num_total
==
num_correct
)
{
if
(
num_total
==
num_correct
)
{
$status
.
removeClass
(
'incorrect'
).
addClass
(
'correct'
);
$status
.
removeClass
(
'incorrect'
).
addClass
(
'correct'
);
$status
.
text
(
'correct'
);
$status_message
.
text
(
'Great job!'
);
$status_message
.
text
(
'Great job!'
);
}
else
{
}
else
{
$status
.
removeClass
(
'correct'
).
addClass
(
'incorrect'
);
$status
.
removeClass
(
'correct'
).
addClass
(
'incorrect'
);
$status
.
text
(
'incorrect'
);
$status_message
.
text
(
$status_message
.
text
(
'You have '
+
num_correct
+
' out of '
+
num_total
+
' cells correct.'
'You have '
+
num_correct
+
' out of '
+
num_total
+
' cells correct.'
);
);
...
@@ -22,8 +24,13 @@ function ActiveTableXBlock(runtime, element, init_args) {
...
@@ -22,8 +24,13 @@ function ActiveTableXBlock(runtime, element, init_args) {
$
.
each
(
correct_dict
,
function
(
cell_id
,
correct
)
{
$
.
each
(
correct_dict
,
function
(
cell_id
,
correct
)
{
var
$cell
=
$
(
'#'
+
cell_id
,
element
);
var
$cell
=
$
(
'#'
+
cell_id
,
element
);
$cell
.
removeClass
(
'right-answer wrong-answer unchecked'
);
$cell
.
removeClass
(
'right-answer wrong-answer unchecked'
);
if
(
correct
)
$cell
.
addClass
(
'right-answer'
)
if
(
correct
)
{
else
$cell
.
addClass
(
'wrong-answer'
);
$cell
.
addClass
(
'right-answer'
);
$cell
.
prop
(
'title'
,
'correct'
);
}
else
{
$cell
.
addClass
(
'wrong-answer'
);
$cell
.
prop
(
'title'
,
'incorrect'
);
}
num_total
+=
1
;
num_total
+=
1
;
num_correct
+=
correct
;
num_correct
+=
correct
;
});
});
...
...
activetable/templates/html/activetable.html
View file @
dbe54692
<div
class=
"activetable_block"
>
<div
class=
"activetable_block"
>
{% if help_text %}
{% if help_text %}
<div
class=
"activetable-help"
style=
"width: {{ total_width }}px;"
>
<div
class=
"activetable-help"
style=
"width: {{ total_width }}px;"
>
<
a
id=
"activetable-help-button"
>
+help
</a
>
<
button
id=
"activetable-help-button"
>
+help
</button
>
<p
id=
"activetable-help-text"
>
{{ help_text }}
</p>
<p
id=
"activetable-help-text"
>
{{ help_text }}
</p>
</div>
</div>
{% endif %}
{% endif %}
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
{% else %}
{% else %}
<p>
This component isn't configured properly and can't be displayed.
</p>
<p>
This component isn't configured properly and can't be displayed.
</p>
{% endif %}
{% endif %}
<
div
class=
"status"
></div
>
<
p
class=
"status"
>
unanswered
</p
>
<div
class=
"status-message"
></div>
<div
class=
"status-message"
></div>
<div
class=
"action"
>
<div
class=
"action"
>
<button
class=
"check"
><span
class=
"check-label"
>
Check
</span><span
class=
"sr"
>
your answer
</span></button>
<button
class=
"check"
><span
class=
"check-label"
>
Check
</span><span
class=
"sr"
>
your answer
</span></button>
...
...
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