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
7cf1bb93
Commit
7cf1bb93
authored
Nov 23, 2013
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds tip formatting & display of instructor advice text
parent
93a7b061
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
mentoring/quizz.py
+12
-3
static/html/tip.html
+4
-0
static/js/quizz.js
+3
-3
No files found.
mentoring/quizz.py
View file @
7cf1bb93
...
...
@@ -86,14 +86,23 @@ class QuizzBlock(XBlock):
return
fragment
def
submit
(
self
,
submission
):
# TODO
log
.
info
(
u'Received quizz submission:
%
s'
,
submission
)
log
.
info
(
u'submission:
%
s'
,
submission
)
# TODO
completed
=
bool
(
submission
)
show_tip
=
completed
if
show_tip
:
formatted_tip
=
render_template
(
'static/html/tip.html'
,
{
'self'
:
self
,
})
else
:
formatted_tip
=
''
return
{
'submission'
:
submission
,
'completed'
:
completed
,
'tip'
:
'submission: {}, completed: {}'
.
format
(
submission
,
completed
)
'tip'
:
formatted_tip
,
}
#self.student_input = submission[0]['value']
...
...
static/html/tip.html
0 → 100644
View file @
7cf1bb93
<div
class=
"quizz-tip"
>
<h3>
{{ self.question }}
</h2>
<p>
{{ self.tip }}
</p>
</div>
static/js/quizz.js
View file @
7cf1bb93
...
...
@@ -11,10 +11,10 @@ function QuizzBlock(runtime, element) {
},
handleSubmit
:
function
(
result
)
{
var
tips_dom
=
$
(
element
).
parent
().
find
(
'.quizz-tips'
),
tip_
text
=
(
result
||
{}).
tip
||
''
;
tip_
html
=
(
result
||
{}).
tip
||
''
;
if
(
tip_
text
)
{
tips_dom
.
append
(
'<div class="quizz_tip">'
+
tip_text
+
'</div>'
);
if
(
tip_
html
)
{
tips_dom
.
append
(
tip_html
);
}
}
}
...
...
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