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
ff029120
Commit
ff029120
authored
Sep 10, 2014
by
dragonfi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add question header and question to answer block
parent
ea841fb8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
4 deletions
+27
-4
mentoring/answer.py
+15
-0
mentoring/templates/html/answer_editable.html
+2
-0
mentoring/templates/html/answer_read_only.html
+2
-0
mentoring/templates/xml/mentoring_assessment.xml
+4
-2
mentoring/templates/xml/mentoring_default.xml
+4
-2
No files found.
mentoring/answer.py
View file @
ff029120
...
...
@@ -53,9 +53,24 @@ class AnswerBlock(LightChild):
default
=
None
,
scope
=
Scope
.
content
)
min_characters
=
Integer
(
help
=
"Minimum number of characters allowed for the answer"
,
default
=
0
,
scope
=
Scope
.
content
)
question
=
String
(
help
=
"Question to ask the student"
,
scope
=
Scope
.
content
,
default
=
""
)
weight
=
Float
(
help
=
"Defines the maximum total grade of the light child block."
,
default
=
1
,
scope
=
Scope
.
content
,
enforce_type
=
True
)
@classmethod
def
init_block_from_node
(
cls
,
block
,
node
,
attr
):
block
.
light_children
=
[]
for
child_id
,
xml_child
in
enumerate
(
node
):
if
xml_child
.
tag
==
'question'
:
block
.
question
=
xml_child
.
text
else
:
cls
.
add_node_as_child
(
block
,
xml_child
,
child_id
)
for
name
,
value
in
attr
:
setattr
(
block
,
name
,
value
)
return
block
@lazy
def
student_input
(
self
):
"""
...
...
mentoring/templates/html/answer_editable.html
View file @
ff029120
<div
class=
"xblock-answer"
data-completed=
"{{ self.completed }}"
>
<h3
class=
"question-title"
>
QUESTION {{ self.index }}
</h3>
<p>
{{ self.question }}
</p>
<textarea
class=
"answer editable"
cols=
"50"
rows=
"10"
name=
"input"
data-min_characters=
"{{ self.min_characters }}"
...
...
mentoring/templates/html/answer_read_only.html
View file @
ff029120
<div
class=
"xblock-answer"
data-completed=
"{{ self.completed }}"
>
<h3
class=
"question-title"
>
QUESTION {{ self.index }}
</h3>
<p>
{{ self.question }}
</p>
<blockquote
class=
"answer read_only"
>
{{ self.student_input|linebreaksbr }}
</blockquote>
...
...
mentoring/templates/xml/mentoring_assessment.xml
View file @
ff029120
...
...
@@ -5,10 +5,12 @@
</shared-header>
<html>
<p>
What is your goal?
</p>
<p>
Please answer the questions below.
</p>
</html>
<answer
name=
"goal"
/>
<answer
name=
"goal"
>
<question>
What is your goal?
</question>
</answer>
<mcq
name=
"mcq_1_1"
type=
"choices"
>
<question>
Do you like this MCQ?
</question>
...
...
mentoring/templates/xml/mentoring_default.xml
View file @
ff029120
<mentoring
url_name=
"{{ url_name }}"
display_name=
"Nav tooltip title"
weight=
"1"
mode=
"standard"
>
<title>
Default Title
</title>
<html>
<p>
What is your goal?
</p>
<p>
Please answer the questions below.
</p>
</html>
<answer
name=
"goal"
/>
<answer
name=
"goal"
>
<question>
What is your goal?
</question>
</answer>
<mcq
name=
"mcq_1_1"
type=
"choices"
>
<question>
Do you like this MCQ?
</question>
...
...
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