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
e620ce76
Commit
e620ce76
authored
Jan 27, 2017
by
Tim Krones
Committed by
GitHub
Jan 27, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #139 from open-craft/fix-long-choices
Fix display of MCQ/MRQ choices with long text.
parents
52045c04
4d10298c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
26 deletions
+45
-26
problem_builder/public/css/questionnaire.css
+13
-3
problem_builder/public/js/questionnaire.js
+3
-1
problem_builder/templates/html/mcqblock.html
+8
-6
problem_builder/templates/html/mrqblock.html
+8
-5
problem_builder/templates/html/ratingblock.html
+13
-11
No files found.
problem_builder/public/css/questionnaire.css
View file @
e620ce76
...
@@ -2,19 +2,23 @@
...
@@ -2,19 +2,23 @@
display
:
table
;
display
:
table
;
position
:
relative
;
position
:
relative
;
width
:
100%
;
width
:
100%
;
border-spacing
:
0
6
px
;
border-spacing
:
0
2
px
;
padding-top
:
10px
;
padding-top
:
10px
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.mentoring
.questionnaire
.choice-result
{
.mentoring
.questionnaire
.choice-result
{
display
:
inline-block
;
display
:
table-cell
;
width
:
34px
;
width
:
34px
;
vertical-align
:
top
;
vertical-align
:
top
;
cursor
:
pointer
;
cursor
:
pointer
;
float
:
none
;
float
:
none
;
}
}
.mentoring
div
[
data-block-type
=
pb-mrq
]
.questionnaire
.choice-result
{
display
:
inline-block
;
}
.mentoring
.questionnaire
.choice
{
.mentoring
.questionnaire
.choice
{
overflow-y
:
hidden
;
overflow-y
:
hidden
;
display
:
table-row
;
display
:
table-row
;
...
@@ -78,7 +82,13 @@
...
@@ -78,7 +82,13 @@
}
}
.mentoring
.choices-list
.choice-selector
{
.mentoring
.choices-list
.choice-selector
{
display
:
inline-block
;
display
:
table-cell
;
}
.mentoring
.choices-list
.choice-label-text
{
display
:
table-cell
;
padding-left
:
0.4em
;
padding-right
:
0.4em
;
}
}
.mentoring
.choice-tips-container
,
.mentoring
.choice-tips-container
,
...
...
problem_builder/public/js/questionnaire.js
View file @
e620ce76
...
@@ -221,7 +221,9 @@ function MRQBlock(runtime, element) {
...
@@ -221,7 +221,9 @@ function MRQBlock(runtime, element) {
display_message
(
result
.
message
,
messageView
,
options
.
checkmark
);
display_message
(
result
.
message
,
messageView
,
options
.
checkmark
);
}
}
$
.
each
(
result
.
choices
,
function
(
index
,
choice
)
{
// If user has never submitted an answer for this MRQ, `result` will be empty.
// So we need to fall back on an empty list for `result.choices` to avoid errors in the next step:
$
.
each
(
result
.
choices
||
[],
function
(
index
,
choice
)
{
var
choiceInputDOM
=
$
(
'.choice input[value='
+
choice
.
value
+
']'
,
element
);
var
choiceInputDOM
=
$
(
'.choice input[value='
+
choice
.
value
+
']'
,
element
);
var
choiceDOM
=
choiceInputDOM
.
closest
(
'.choice'
);
var
choiceDOM
=
choiceInputDOM
.
closest
(
'.choice'
);
var
choiceResultDOM
=
$
(
'.choice-result'
,
choiceDOM
);
var
choiceResultDOM
=
$
(
'.choice-result'
,
choiceDOM
);
...
...
problem_builder/templates/html/mcqblock.html
View file @
e620ce76
...
@@ -8,15 +8,17 @@
...
@@ -8,15 +8,17 @@
{% for choice in custom_choices %}
{% for choice in custom_choices %}
<div
class=
"choice"
aria-live=
"polite"
aria-atomic=
"true"
>
<div
class=
"choice"
aria-live=
"polite"
aria-atomic=
"true"
>
<label
class=
"choice-label"
<label
class=
"choice-label"
aria-describedby=
"feedback_{{ self.html_id }} choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
>
aria-describedby=
"feedback_{{ self.html_id }} choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
>
<div
class=
"choice-result fa icon-2x"
aria-label=
""
<span
class=
"choice-result fa icon-2x"
data-label_correct=
"{% trans "
Correct
"
%}"
data-label_incorrect=
"{% trans "
Incorrect
"
%}"
></div>
aria-label=
""
<div
class=
"choice-selector"
>
data-label_correct=
"{% trans "
Correct
"
%}"
data-label_incorrect=
"{% trans "
Incorrect
"
%}"
></span>
<span
class=
"choice-selector"
>
<input
type=
"radio"
name=
"{{ self.name }}"
value=
"{{ choice.value }}"
<input
type=
"radio"
name=
"{{ self.name }}"
value=
"{{ choice.value }}"
{%
if
self
.
student_choice =
=
choice
.
value
and
not
hide_prev_answer
%}
checked
{%
endif
%}
{%
if
self
.
student_choice =
=
choice
.
value
and
not
hide_prev_answer
%}
checked
{%
endif
%}
/>
/>
</
div
>
</
span
>
{{ choice.content|safe }}
<span
class=
"choice-label-text"
>
{{ choice.content|safe }}
</span>
</label>
</label>
<div
class=
"choice-tips-container"
>
<div
class=
"choice-tips-container"
>
<div
class=
"choice-tips"
id=
"choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
></div>
<div
class=
"choice-tips"
id=
"choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
></div>
...
...
problem_builder/templates/html/mrqblock.html
View file @
e620ce76
...
@@ -8,17 +8,20 @@
...
@@ -8,17 +8,20 @@
<div
class=
"choices-list"
>
<div
class=
"choices-list"
>
{% for choice in custom_choices %}
{% for choice in custom_choices %}
<div
class=
"choice"
aria-live=
"polite"
aria-atomic=
"true"
>
<div
class=
"choice"
aria-live=
"polite"
aria-atomic=
"true"
>
<div
class=
"choice-result fa icon-2x"
id=
"result_{{ self.html_id }}-{{ forloop.counter }}"
aria-label=
""
<div
class=
"choice-result fa icon-2x"
data-label_correct=
"{% trans "
Correct
"
%}"
data-label_incorrect=
"{% trans "
Incorrect
"
%}"
></div>
id=
"result_{{ self.html_id }}-{{ forloop.counter }}"
aria-label=
""
data-label_correct=
"{% trans "
Correct
"
%}"
data-label_incorrect=
"{% trans "
Incorrect
"
%}"
></div>
<label
class=
"choice-label"
aria-describedby=
"feedback_{{ self.html_id }}
<label
class=
"choice-label"
aria-describedby=
"feedback_{{ self.html_id }}
result_{{ self.html_id }}-{{ forloop.counter }}
result_{{ self.html_id }}-{{ forloop.counter }}
choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
>
choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
>
<
div
class=
"choice-selector"
>
<
span
class=
"choice-selector"
>
<input
type=
"checkbox"
name=
"{{ self.name }}"
value=
"{{ choice.value }}"
<input
type=
"checkbox"
name=
"{{ self.name }}"
value=
"{{ choice.value }}"
{%
if
choice
.
value
in
self
.
student_choices
and
not
hide_prev_answer
%}
checked
{%
endif
%}
{%
if
choice
.
value
in
self
.
student_choices
and
not
hide_prev_answer
%}
checked
{%
endif
%}
/>
/>
</
div
>
</
span
>
{{ choice.content|safe }}
<span
class=
"choice-label-text"
>
{{ choice.content|safe }}
</span>
</label>
</label>
<div
class=
"choice-tips-container"
>
<div
class=
"choice-tips-container"
>
<div
class=
"choice-tips"
id=
"choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
></div>
<div
class=
"choice-tips"
id=
"choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
></div>
...
...
problem_builder/templates/html/ratingblock.html
View file @
e620ce76
...
@@ -8,17 +8,19 @@
...
@@ -8,17 +8,19 @@
{% for i in '12345' %}
{% for i in '12345' %}
<div
class=
"choice"
aria-live=
"polite"
aria-atomic=
"true"
>
<div
class=
"choice"
aria-live=
"polite"
aria-atomic=
"true"
>
<label
class=
"choice-label"
<label
class=
"choice-label"
aria-describedby=
"feedback_{{ self.html_id }} choice_tips_{{ self.html_id }}-{{ i }}"
>
aria-describedby=
"feedback_{{ self.html_id }} choice_tips_{{ self.html_id }}-{{ i }}"
>
<
div
class=
"choice-result fa icon-2x"
aria-label=
""
<
span
class=
"choice-result fa icon-2x"
aria-label=
""
data-label_correct=
"{% trans "
Correct
"
%}"
data-label_incorrect=
"{% trans "
Incorrect
"
%}"
></div
>
data-label_correct=
"{% trans "
Correct
"
%}"
data-label_incorrect=
"{% trans "
Incorrect
"
%}"
></span
>
<
div
class=
"choice-selector"
>
<
span
class=
"choice-selector"
>
<input
type=
"radio"
name=
"{{ self.name }}"
value=
"{{i}}"
<input
type=
"radio"
name=
"{{ self.name }}"
value=
"{{i}}"
{%
if
self
.
student_choice =
=
i
and
not
hide_prev_answer
%}
checked
{%
else
%}
data-student-choice=
'{{self.student_choice}}'
{%
endif
%}
{%
if
self
.
student_choice =
=
i
and
not
hide_prev_answer
%}
checked
{%
else
%}
data-student-choice=
'{{self.student_choice}}'
{%
endif
%}
/>
/>
</span>
<span
class=
"choice-label-text"
>
{{i}}
{{i}}
{% if i == '1' %} - {{ self.low|safe }}{% endif %}
{% if i == '1' %} - {{ self.low|safe }}{% endif %}
{% if i == '5' %} - {{ self.high|safe }}{% endif %}
{% if i == '5' %} - {{ self.high|safe }}{% endif %}
</
div
>
</
span
>
</label>
</label>
<div
class=
"choice-tips-container"
>
<div
class=
"choice-tips-container"
>
<div
class=
"choice-tips"
id=
"choice_tips_{{ self.html_id }}-{{ i }}"
></div>
<div
class=
"choice-tips"
id=
"choice_tips_{{ self.html_id }}-{{ i }}"
></div>
...
@@ -29,15 +31,15 @@
...
@@ -29,15 +31,15 @@
{% for choice in custom_choices %}
{% for choice in custom_choices %}
<div
class=
"choice"
aria-live=
"polite"
aria-atomic=
"true"
>
<div
class=
"choice"
aria-live=
"polite"
aria-atomic=
"true"
>
<label
class=
"choice-label"
<label
class=
"choice-label"
aria-describedby=
"feedback_{{ self.html_id }} choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
>
aria-describedby=
"feedback_{{ self.html_id }} choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
>
<
div
class=
"choice-result fa icon-2x"
aria-label=
""
<
span
class=
"choice-result fa icon-2x"
aria-label=
""
data-label_correct=
"{% trans "
Correct
"
%}"
data-label_incorrect=
"{% trans "
Incorrect
"
%}"
></div
>
data-label_correct=
"{% trans "
Correct
"
%}"
data-label_incorrect=
"{% trans "
Incorrect
"
%}"
></span
>
<
div
class=
"choice-selector"
>
<
span
class=
"choice-selector"
>
<input
type=
"radio"
name=
"{{ self.name }}"
value=
"{{ choice.value }}"
<input
type=
"radio"
name=
"{{ self.name }}"
value=
"{{ choice.value }}"
{%
if
self
.
student_choice =
=
choice
.
value
and
not
hide_prev_answer
%}
checked
{%
else
%}
data-student-choice=
'{{self.student_choice}}'
{%
endif
%}
{%
if
self
.
student_choice =
=
choice
.
value
and
not
hide_prev_answer
%}
checked
{%
else
%}
data-student-choice=
'{{self.student_choice}}'
{%
endif
%}
/>
/>
</
div
>
</
span
>
{{ choice.content|safe }}
<span
class=
"choice-label-text"
>
{{ choice.content|safe }}
</span>
</label>
</label>
<div
class=
"choice-tips-container"
>
<div
class=
"choice-tips-container"
>
<div
class=
"choice-tips"
id=
"choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
></div>
<div
class=
"choice-tips"
id=
"choice_tips_{{ self.html_id }}-{{ forloop.counter }}"
></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