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
3ca91095
Commit
3ca91095
authored
Apr 07, 2014
by
Alan Boudreault
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added checkmark for mentoring answer block
parent
6758d19b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
15 deletions
+35
-15
mentoring/public/css/answer.css
+5
-0
mentoring/public/css/mentoring.css
+8
-0
mentoring/public/css/questionnaire.css
+3
-6
mentoring/public/js/answer.js
+9
-0
mentoring/public/js/questionnaire.js
+9
-9
mentoring/templates/html/answer_editable.html
+1
-0
No files found.
mentoring/public/css/answer.css
View file @
3ca91095
.mentoring
.answer.editable
{
.mentoring
.answer.editable
{
height
:
250px
;
height
:
250px
;
width
:
100%
;
width
:
100%
;
margin-bottom
:
10px
;
}
.mentoring
.answer-checkmark
{
display
:
inline-block
;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
}
}
...
...
mentoring/public/css/mentoring.css
View file @
3ca91095
...
@@ -57,3 +57,11 @@
...
@@ -57,3 +57,11 @@
font-style
:
italic
;
font-style
:
italic
;
webkit-font-smoothing
:
antialiased
;
webkit-font-smoothing
:
antialiased
;
}
}
.mentoring
.checkmark-correct
{
color
:
#006600
;
}
.mentoring
.checkmark-incorrect
{
color
:
#ff0000
;
}
mentoring/public/css/questionnaire.css
View file @
3ca91095
...
@@ -21,17 +21,14 @@
...
@@ -21,17 +21,14 @@
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.mentoring
.questionnaire
.choice-result.correct
,
.mentoring
.questionnaire
.choice-result.checkmark-correct
,
.mentoring
.questionnaire
.choice-answer.correct
{
.mentoring
.questionnaire
.choice-answer.checkmark-correct
{
cursor
:
pointer
;
color
:
#006600
;
position
:
relative
;
position
:
relative
;
top
:
-3px
;
top
:
-3px
;
}
}
.mentoring
.questionnaire
.choice-result.incorrect
{
.mentoring
.questionnaire
.choice-result.
checkmark-
incorrect
{
text-align
:
center
;
text-align
:
center
;
color
:
#ff0000
;
}
}
.mentoring
.questionnaire
.choice-tips
,
.mentoring
.questionnaire
.choice-tips
,
...
...
mentoring/public/js/answer.js
View file @
3ca91095
...
@@ -11,7 +11,16 @@ function AnswerBlock(runtime, element) {
...
@@ -11,7 +11,16 @@ function AnswerBlock(runtime, element) {
},
},
handleSubmit
:
function
(
result
)
{
handleSubmit
:
function
(
result
)
{
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'
);
if
(
result
.
completed
)
{
checkmark
.
addClass
(
'checkmark-correct icon-ok'
);
}
else
{
checkmark
.
addClass
(
'checkmark-incorrect icon-exclamation'
);
}
},
},
// Returns `true` if the child is valid, else `false`
// Returns `true` if the child is valid, else `false`
...
...
mentoring/public/js/questionnaire.js
View file @
3ca91095
...
@@ -49,12 +49,12 @@ function MCQBlock(runtime, element) {
...
@@ -49,12 +49,12 @@ function MCQBlock(runtime, element) {
choiceTipsDOM
=
$
(
'.choice-tips'
,
choiceDOM
),
choiceTipsDOM
=
$
(
'.choice-tips'
,
choiceDOM
),
choiceTipsCloseDOM
;
choiceTipsCloseDOM
;
choiceResultDOM
.
removeClass
(
'
incorrect icon-exclamation
correct icon-ok'
);
choiceResultDOM
.
removeClass
(
'
checkmark-incorrect icon-exclamation checkmark-
correct icon-ok'
);
if
(
result
.
completed
&&
choiceInputDOM
.
val
()
===
result
.
submission
)
{
if
(
result
.
completed
&&
choiceInputDOM
.
val
()
===
result
.
submission
)
{
choiceResultDOM
.
addClass
(
'correct icon-ok'
);
choiceResultDOM
.
addClass
(
'c
heckmark-c
orrect icon-ok'
);
}
}
else
if
(
choiceInputDOM
.
val
()
===
result
.
submission
||
_
.
isNull
(
result
.
submission
))
{
else
if
(
choiceInputDOM
.
val
()
===
result
.
submission
||
_
.
isNull
(
result
.
submission
))
{
choiceResultDOM
.
addClass
(
'incorrect icon-exclamation'
);
choiceResultDOM
.
addClass
(
'
checkmark-
incorrect icon-exclamation'
);
}
}
var
tips
=
_
.
find
(
result
.
tips
,
function
(
obj
)
{
var
tips
=
_
.
find
(
result
.
tips
,
function
(
obj
)
{
...
@@ -102,7 +102,7 @@ function MRQBlock(runtime, element) {
...
@@ -102,7 +102,7 @@ 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
(
'
incorrect icon-exclamation
correct icon-ok'
);
choiceResultDOM
.
removeClass
(
'
checkmark-incorrect icon-exclamation checkmark-
correct icon-ok'
);
var
checkedCheckboxes
=
$
(
'input[type=checkbox]:checked'
,
element
),
var
checkedCheckboxes
=
$
(
'input[type=checkbox]:checked'
,
element
),
checkedValues
=
[];
checkedValues
=
[];
...
@@ -136,13 +136,13 @@ function MRQBlock(runtime, element) {
...
@@ -136,13 +136,13 @@ function MRQBlock(runtime, element) {
answer
:
choice
.
completed
?
choiceInputDOM
.
attr
(
'checked'
)
:
!
choiceInputDOM
.
attr
(
'checked'
)
answer
:
choice
.
completed
?
choiceInputDOM
.
attr
(
'checked'
)
:
!
choiceInputDOM
.
attr
(
'checked'
)
});
});
choiceResultDOM
.
removeClass
(
'
incorrect icon-exclamation
correct icon-ok'
);
choiceResultDOM
.
removeClass
(
'
checkmark-incorrect icon-exclamation checkmark-
correct icon-ok'
);
/* 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
(
'correct icon-ok'
);
choiceResultDOM
.
addClass
(
'c
heckmark-c
orrect icon-ok'
);
}
else
if
(
!
choice
.
completed
)
{
}
else
if
(
!
choice
.
completed
)
{
choiceResultDOM
.
addClass
(
'incorrect icon-exclamation'
);
choiceResultDOM
.
addClass
(
'
checkmark-
incorrect icon-exclamation'
);
}
}
}
}
...
@@ -181,10 +181,10 @@ function MRQBlock(runtime, element) {
...
@@ -181,10 +181,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
(
'correct icon-ok'
);
choiceResultDOM
.
removeClass
(
'c
heckmark-c
orrect icon-ok'
);
if
(
answers_displayed
)
{
if
(
answers_displayed
)
{
if
(
answer
.
answer
)
if
(
answer
.
answer
)
choiceResultDOM
.
addClass
(
'correct icon-ok'
);
choiceResultDOM
.
addClass
(
'c
heckmark-c
orrect icon-ok'
);
showAnswerButton
.
text
(
'Hide Answer(s)'
);
showAnswerButton
.
text
(
'Hide Answer(s)'
);
}
}
else
{
else
{
...
...
mentoring/templates/html/answer_editable.html
View file @
3ca91095
...
@@ -2,3 +2,4 @@
...
@@ -2,3 +2,4 @@
class=
"answer editable"
cols=
"50"
rows=
"10"
name=
"input"
class=
"answer editable"
cols=
"50"
rows=
"10"
name=
"input"
data-min_characters=
"{{ self.min_characters }}"
data-min_characters=
"{{ self.min_characters }}"
>
{{ self.student_input }}
</textarea>
>
{{ self.student_input }}
</textarea>
<span
class=
"answer-checkmark icon-2x"
></span>
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