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
81702c53
Commit
81702c53
authored
Apr 09, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18 from aboudreault/fa4-compatibility
Added font awesome 4 compatibility
parents
5da686d1
38439b7e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
mentoring/public/js/answer.js
+5
-3
mentoring/public/js/questionnaire.js
+15
-9
No files found.
mentoring/public/js/answer.js
View file @
81702c53
...
@@ -14,12 +14,14 @@ function AnswerBlock(runtime, element) {
...
@@ -14,12 +14,14 @@ function AnswerBlock(runtime, element) {
var
checkmark
=
$
(
'.answer-checkmark'
,
element
);
var
checkmark
=
$
(
'.answer-checkmark'
,
element
);
$
(
element
).
find
(
'.message'
).
text
((
result
||
{}).
error
||
''
);
$
(
element
).
find
(
'.message'
).
text
((
result
||
{}).
error
||
''
);
checkmark
.
removeClass
(
'checkmark-incorrect icon-exclamation checkmark-correct icon-ok'
);
checkmark
.
removeClass
(
'checkmark-incorrect icon-exclamation fa-exclamation checkmark-correct icon-ok fa-check'
);
if
(
result
.
completed
)
{
if
(
result
.
completed
)
{
checkmark
.
addClass
(
'checkmark-correct icon-ok'
);
checkmark
.
addClass
(
'checkmark-correct icon-ok
fa-check
'
);
}
}
else
{
else
{
checkmark
.
addClass
(
'checkmark-incorrect icon-exclamation'
);
checkmark
.
addClass
(
'checkmark-incorrect icon-exclamation
fa-exclamation
'
);
}
}
},
},
...
...
mentoring/public/js/questionnaire.js
View file @
81702c53
...
@@ -49,12 +49,14 @@ function MCQBlock(runtime, element) {
...
@@ -49,12 +49,14 @@ function MCQBlock(runtime, element) {
choiceTipsDOM
=
$
(
'.choice-tips'
,
choiceDOM
),
choiceTipsDOM
=
$
(
'.choice-tips'
,
choiceDOM
),
choiceTipsCloseDOM
;
choiceTipsCloseDOM
;
choiceResultDOM
.
removeClass
(
'checkmark-incorrect icon-exclamation checkmark-correct icon-ok'
);
choiceResultDOM
.
removeClass
(
'checkmark-incorrect icon-exclamation fa-exclamation checkmark-correct icon-ok fa-check'
);
if
(
result
.
completed
&&
choiceInputDOM
.
val
()
===
result
.
submission
)
{
if
(
result
.
completed
&&
choiceInputDOM
.
val
()
===
result
.
submission
)
{
choiceResultDOM
.
addClass
(
'checkmark-correct icon-ok'
);
choiceResultDOM
.
addClass
(
'checkmark-correct icon-ok
fa-check
'
);
}
}
else
if
(
choiceInputDOM
.
val
()
===
result
.
submission
||
_
.
isNull
(
result
.
submission
))
{
else
if
(
choiceInputDOM
.
val
()
===
result
.
submission
||
_
.
isNull
(
result
.
submission
))
{
choiceResultDOM
.
addClass
(
'checkmark-incorrect icon-exclamation'
);
choiceResultDOM
.
addClass
(
'checkmark-incorrect icon-exclamation
fa-exclamation
'
);
}
}
var
tips
=
_
.
find
(
result
.
tips
,
function
(
obj
)
{
var
tips
=
_
.
find
(
result
.
tips
,
function
(
obj
)
{
...
@@ -102,7 +104,9 @@ function MRQBlock(runtime, element) {
...
@@ -102,7 +104,9 @@ function MRQBlock(runtime, element) {
// hide answers
// hide answers
var
choiceInputDOM
=
$
(
'.choice input'
,
element
),
var
choiceInputDOM
=
$
(
'.choice input'
,
element
),
choiceResultDOM
=
$
(
'.choice-answer'
,
choiceInputDOM
.
closest
(
'.choice'
));
choiceResultDOM
=
$
(
'.choice-answer'
,
choiceInputDOM
.
closest
(
'.choice'
));
choiceResultDOM
.
removeClass
(
'checkmark-incorrect icon-exclamation checkmark-correct icon-ok'
);
choiceResultDOM
.
removeClass
(
'checkmark-incorrect icon-exclamation fa-exclamation checkmark-correct icon-ok fa-check'
);
var
checkedCheckboxes
=
$
(
'input[type=checkbox]:checked'
,
element
),
var
checkedCheckboxes
=
$
(
'input[type=checkbox]:checked'
,
element
),
checkedValues
=
[];
checkedValues
=
[];
...
@@ -136,13 +140,15 @@ function MRQBlock(runtime, element) {
...
@@ -136,13 +140,15 @@ function MRQBlock(runtime, element) {
answer
:
choice
.
completed
?
choiceInputDOM
.
attr
(
'checked'
)
:
!
choiceInputDOM
.
attr
(
'checked'
)
answer
:
choice
.
completed
?
choiceInputDOM
.
attr
(
'checked'
)
:
!
choiceInputDOM
.
attr
(
'checked'
)
});
});
choiceResultDOM
.
removeClass
(
'checkmark-incorrect icon-exclamation checkmark-correct icon-ok'
);
choiceResultDOM
.
removeClass
(
'checkmark-incorrect icon-exclamation fa-exclamation checkmark-correct icon-ok fa-check'
);
/* show hint if checked or max_attempts is disabled */
/* show hint if checked or max_attempts is disabled */
if
(
result
.
completed
||
choiceInputDOM
.
prop
(
'checked'
)
||
options
.
max_attempts
<=
0
)
{
if
(
result
.
completed
||
choiceInputDOM
.
prop
(
'checked'
)
||
options
.
max_attempts
<=
0
)
{
if
(
choice
.
completed
)
{
if
(
choice
.
completed
)
{
choiceResultDOM
.
addClass
(
'checkmark-correct icon-ok'
);
choiceResultDOM
.
addClass
(
'checkmark-correct icon-ok
fa-check
'
);
}
else
if
(
!
choice
.
completed
)
{
}
else
if
(
!
choice
.
completed
)
{
choiceResultDOM
.
addClass
(
'checkmark-incorrect icon-exclamation'
);
choiceResultDOM
.
addClass
(
'checkmark-incorrect icon-exclamation
fa-exclamation
'
);
}
}
}
}
...
@@ -181,10 +187,10 @@ function MRQBlock(runtime, element) {
...
@@ -181,10 +187,10 @@ function MRQBlock(runtime, element) {
_
.
each
(
this
.
answers
,
function
(
answer
)
{
_
.
each
(
this
.
answers
,
function
(
answer
)
{
var
choiceResultDOM
=
$
(
'.choice-answer'
,
answer
.
input
.
closest
(
'.choice'
));
var
choiceResultDOM
=
$
(
'.choice-answer'
,
answer
.
input
.
closest
(
'.choice'
));
choiceResultDOM
.
removeClass
(
'checkmark-correct icon-ok'
);
choiceResultDOM
.
removeClass
(
'checkmark-correct icon-ok
fa-check
'
);
if
(
answers_displayed
)
{
if
(
answers_displayed
)
{
if
(
answer
.
answer
)
if
(
answer
.
answer
)
choiceResultDOM
.
addClass
(
'checkmark-correct icon-ok'
);
choiceResultDOM
.
addClass
(
'checkmark-correct icon-ok
fa-check
'
);
showAnswerButton
.
text
(
'Hide Answer(s)'
);
showAnswerButton
.
text
(
'Hide Answer(s)'
);
}
}
else
{
else
{
...
...
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