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
ce7280bd
Commit
ce7280bd
authored
Feb 12, 2013
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added short style. Fixing minor bugs.
parent
2d32b847
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
26 deletions
+67
-26
common/lib/xmodule/xmodule/css/poll/display.scss
+44
-10
common/lib/xmodule/xmodule/js/src/conditional/display.coffee
+8
-2
common/lib/xmodule/xmodule/js/src/poll/poll_main.js
+15
-14
No files found.
common/lib/xmodule/xmodule/css/poll/display.scss
View file @
ce7280bd
...
@@ -17,6 +17,7 @@ section.poll_question {
...
@@ -17,6 +17,7 @@ section.poll_question {
margin-top
:
0
;
margin-top
:
0
;
margin-bottom
:
15px
;
margin-bottom
:
15px
;
color
:
#fe57a1
;
color
:
#fe57a1
;
font-size
:
1
.9em
;
&
.problem-header
{
&
.problem-header
{
section
.staff
{
section
.staff
{
...
@@ -40,10 +41,21 @@ section.poll_question {
...
@@ -40,10 +41,21 @@ section.poll_question {
.poll_answer
{
.poll_answer
{
margin-bottom
:
20px
;
margin-bottom
:
20px
;
&
.short
{
clear
:
both
;
}
.question
{
.question
{
height
:
auto
;
height
:
auto
;
clear
:
both
;
clear
:
both
;
min-height
:
60px
;
min-height
:
30px
;
&
.short
{
clear
:
none
;
width
:
30%
;
display
:
inline
;
float
:
left
;
}
.button
{
.button
{
-webkit-appearance
:
none
;
-webkit-appearance
:
none
;
...
@@ -102,8 +114,8 @@ section.poll_question {
...
@@ -102,8 +114,8 @@ section.poll_question {
vertical-align
:
top
;
vertical-align
:
top
;
white-space
:
pre-line
;
white-space
:
pre-line
;
width
:
60
px
;
width
:
25
px
;
height
:
60
px
;
height
:
25
px
;
word-spacing
:
0px
;
word-spacing
:
0px
;
writing-mode
:
lr-tb
;
writing-mode
:
lr-tb
;
...
@@ -126,10 +138,14 @@ section.poll_question {
...
@@ -126,10 +138,14 @@ section.poll_question {
float
:
left
;
float
:
left
;
width
:
80%
;
width
:
80%
;
text-align
:
left
;
text-align
:
left
;
min-height
:
6
0px
;
min-height
:
3
0px
;
margin-left
:
20px
;
margin-left
:
20px
;
height
:
auto
;
height
:
auto
;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
&
.short
{
width
:
100px
;
}
}
}
}
}
...
@@ -138,18 +154,35 @@ section.poll_question {
...
@@ -138,18 +154,35 @@ section.poll_question {
margin-top
:
20px
;
margin-top
:
20px
;
clear
:
both
;
clear
:
both
;
&
.short
{
margin-top
:
0
;
clear
:
none
;
display
:
inline
;
float
:
right
;
width
:
70%
;
}
.bar
{
.bar
{
width
:
8
5%
;
width
:
7
5%
;
height
:
28px
;
height
:
28px
;
border
:
1px
solid
black
;
border
:
1px
solid
black
;
display
:
inline
;
display
:
inline
;
float
:
left
;
float
:
left
;
margin-right
:
10px
;
margin-right
:
10px
;
&
.short
{
height
:
20px
;
margin-top
:
3px
;
}
.percent
{
.percent
{
background-color
:
gray
;
background-color
:
gray
;
width
:
30
0px
;
width
:
0px
;
height
:
28px
;
height
:
28px
;
&
.short
{
height
:
20px
;
}
}
}
}
}
...
@@ -159,14 +192,15 @@ section.poll_question {
...
@@ -159,14 +192,15 @@ section.poll_question {
float
:
right
;
float
:
right
;
height
:
28px
;
height
:
28px
;
text-align
:
right
;
text-align
:
right
;
&
.short
{
width
:
120px
;
height
:
auto
;
}
}
}
}
}
}
}
.poll_answer
{
}
.poll_answer.answered
{
.poll_answer.answered
{
-webkit-box-shadow
:
rgb
(
97
,
184
,
225
)
0px
1px
0px
0px
inset
;
-webkit-box-shadow
:
rgb
(
97
,
184
,
225
)
0px
1px
0px
0px
inset
;
background-color
:
rgb
(
29
,
157
,
217
);
background-color
:
rgb
(
29
,
157
,
217
);
...
...
common/lib/xmodule/xmodule/js/src/conditional/display.coffee
View file @
ce7280bd
...
@@ -13,13 +13,19 @@ class @Conditional
...
@@ -13,13 +13,19 @@ class @Conditional
@
passed
=
null
@
passed
=
null
@
url
=
@
el
.
data
(
'url'
)
@
url
=
@
el
.
data
(
'url'
)
@
render
()
@
render
(
element
)
render
:
()
->
render
:
(
element
)
->
$
.
postWithPrefix
"
#{
@
url
}
/conditional_get"
,
(
response
)
=>
$
.
postWithPrefix
"
#{
@
url
}
/conditional_get"
,
(
response
)
=>
if
(((
response
.
passed
is
true
)
&&
(
@
passed
is
false
))
||
(
@
passed
is
null
))
if
(((
response
.
passed
is
true
)
&&
(
@
passed
is
false
))
||
(
@
passed
is
null
))
@
el
.
data
'passed'
,
response
.
passed
@
el
.
data
'passed'
,
response
.
passed
@
el
.
html
''
@
el
.
html
''
@
el
.
append
(
i
)
for
i
in
response
.
html
@
el
.
append
(
i
)
for
i
in
response
.
html
if
@
el
.
html
().
length
<
5
$
(
element
).
hide
()
else
$
(
element
).
show
()
XModule
.
loadModules
@
el
XModule
.
loadModules
@
el
common/lib/xmodule/xmodule/js/src/poll/poll_main.js
View file @
ce7280bd
...
@@ -114,6 +114,13 @@ PollMain.prototype = {
...
@@ -114,6 +114,13 @@ PollMain.prototype = {
this
.
questionAnswered
=
false
;
this
.
questionAnswered
=
false
;
this
.
answersObj
=
{};
this
.
answersObj
=
{};
this
.
shortVersion
=
true
;
$
.
each
(
this
.
jsonConfig
.
answers
,
function
(
index
,
value
)
{
if
(
value
.
length
>=
18
)
{
_this
.
shortVersion
=
false
;
}
});
$
.
each
(
this
.
jsonConfig
.
answers
,
function
(
index
,
value
)
{
$
.
each
(
this
.
jsonConfig
.
answers
,
function
(
index
,
value
)
{
var
answer
;
var
answer
;
...
@@ -146,6 +153,14 @@ PollMain.prototype = {
...
@@ -146,6 +153,14 @@ PollMain.prototype = {
answer
.
textEl
.
html
(
value
);
answer
.
textEl
.
html
(
value
);
if
(
_this
.
shortVersion
===
true
)
{
$
.
each
(
answer
,
function
(
index
,
value
)
{
if
(
value
instanceof
jQuery
)
{
value
.
addClass
(
'short'
);
}
});
}
answer
.
el
.
appendTo
(
_this
.
questionEl
);
answer
.
el
.
appendTo
(
_this
.
questionEl
);
answer
.
buttonEl
.
on
(
'click'
,
function
()
{
answer
.
buttonEl
.
on
(
'click'
,
function
()
{
...
@@ -156,20 +171,6 @@ PollMain.prototype = {
...
@@ -156,20 +171,6 @@ PollMain.prototype = {
answer
.
buttonEl
.
addClass
(
'answered'
);
answer
.
buttonEl
.
addClass
(
'answered'
);
_this
.
questionAnswered
=
true
;
_this
.
questionAnswered
=
true
;
}
}
/*
answerEl = $('<li class="poll_answer">' + value + '</li>');
answerEl.on('click', function () {
_this.submitAnswer(index, answerEl);
});
if (index === _this.jsonConfig.poll_answer) {
answerEl.addClass('answered');
_this.questionAnswered = true;
}
answerEl.appendTo(_this.questionEl);
*/
});
});
this
.
graphAnswerEl
=
$
(
'<div class="graph_answer"></div>'
);
this
.
graphAnswerEl
=
$
(
'<div class="graph_answer"></div>'
);
...
...
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