Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
080187fa
Commit
080187fa
authored
Mar 10, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MRQ: Add skinning of feedback popups next to each response
parent
9b9b2aa1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
9 deletions
+63
-9
mentoring/public/css/questionnaire.css
+33
-0
mentoring/public/img/close.png
+0
-0
mentoring/public/js/questionnaire.js
+25
-7
mentoring/questionnaire.py
+2
-0
mentoring/templates/html/tip_choice_group.html
+3
-2
No files found.
mentoring/public/css/questionnaire.css
View file @
080187fa
...
...
@@ -27,6 +27,39 @@
cursor
:
pointer
;
}
.mentoring
.choices
.choices
.choice-tips
{
display
:
none
;
background-color
:
#0384ce
;
color
:
#fff
;
padding
:
20px
;
position
:
absolute
;
width
:
600px
;
margin
:
10px
0
;
}
.mentoring
.choices
.choices
.choice-tips
.title
{
font-weight
:
bold
;
margin-bottom
:
10px
;
}
.mentoring
.choices
.choices
.choice-tips
.tip-choice-group
{
position
:
relative
;
}
.mentoring
.choices
.choices
.choice-tips
.tip-choice-group
.close
{
background-image
:
url({{ close_icon_url }})
;
cursor
:
pointer
;
position
:
absolute
;
top
:
0
;
right
:
0
;
width
:
18px
;
height
:
19px
;
}
.mentoring
.choices
.choices
.choice-tips
p
{
color
:
#fff
;
}
.mentoring
.rating
.choices
.choice
{
margin-right
:
10px
;
}
...
...
mentoring/public/img/close.png
0 → 100644
View file @
080187fa
1.7 KB
mentoring/public/js/questionnaire.js
View file @
080187fa
...
...
@@ -37,18 +37,36 @@ function MRQBlock(runtime, element) {
handleSubmit
:
function
(
result
)
{
$
.
each
(
result
.
choices
,
function
(
index
,
choice
)
{
var
choice_input_dom
=
$
(
'.choice input[value='
+
choice
.
value
+
']'
,
element
),
choice_dom
=
choice_input_dom
.
closest
(
'.choice'
),
choice_result_dom
=
$
(
'.choice-result'
,
choice_dom
),
choice_tips_dom
=
$
(
'.choice-tips'
,
choice_dom
);
var
choiceInputDOM
=
$
(
'.choice input[value='
+
choice
.
value
+
']'
,
element
),
choiceDOM
=
choiceInputDOM
.
closest
(
'.choice'
),
choiceResultDOM
=
$
(
'.choice-result'
,
choiceDOM
),
choiceTipsDOM
=
$
(
'.choice-tips'
,
choiceDOM
),
choiceTipsCloseDOM
,
clearPopupEvents
;
clearPopupEvents
=
function
()
{
$
(
'.choice-tips'
,
element
).
hide
();
$
(
'.choice-tips .close'
).
off
(
'click'
);
};
if
(
choice
.
completed
)
{
choice
_result_dom
.
removeClass
(
'incorrect'
).
addClass
(
'correct'
);
choice
ResultDOM
.
removeClass
(
'incorrect'
).
addClass
(
'correct'
);
}
else
{
choice
_result_dom
.
removeClass
(
'correct'
).
addClass
(
'incorrect'
);
choice
ResultDOM
.
removeClass
(
'correct'
).
addClass
(
'incorrect'
);
}
choice_tips_dom
.
html
(
choice
.
tips
);
choiceTipsDOM
.
html
(
choice
.
tips
);
choiceTipsCloseDOM
=
$
(
'.close'
,
choiceTipsDOM
);
choiceResultDOM
.
off
(
'click'
).
on
(
'click'
,
function
()
{
clearPopupEvents
();
choiceTipsDOM
.
show
();
choiceTipsCloseDOM
.
on
(
'click'
,
function
()
{
clearPopupEvents
();
choiceTipsDOM
.
hide
();
});
});
});
}
};
...
...
mentoring/questionnaire.py
View file @
080187fa
...
...
@@ -86,6 +86,8 @@ class QuestionnaireAbstractBlock(LightChild):
'public/img/correct-icon.png'
),
'incorrect_icon_url'
:
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/img/incorrect-icon.png'
),
'close_icon_url'
:
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/img/close.png'
),
}))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/js/questionnaire.js'
))
...
...
mentoring/templates/html/tip_choice_group.html
View file @
080187fa
<div
class=
"tip-choice-group"
>
<strong>
<div
class=
"close"
></div>
<div
class=
"title"
>
{% if completed %}
Correct! You have made the right choice.
{% else %}
This is not the right choice.
{% endif %}
</
strong
>
</
div
>
{% for tip_fragment in tips_fragments %}
{{ tip_fragment.body_html|safe }}
{% endfor %}
...
...
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