Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
37ad2741
Commit
37ad2741
authored
Nov 02, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python code to add in hint box and persist
parent
61aefcbd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
common/lib/xmodule/xmodule/self_assessment_module.py
+9
-3
No files found.
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
37ad2741
...
...
@@ -92,6 +92,7 @@ class SelfAssessmentModule(XModule):
self
.
correctness
=
"incorrect"
self
.
done
=
False
self
.
max_attempts
=
self
.
metadata
.
get
(
'attempts'
,
None
)
self
.
hint
=
""
#Pull variables from instance state if available
if
self
.
max_attempts
is
not
None
:
...
...
@@ -112,6 +113,9 @@ class SelfAssessmentModule(XModule):
if
instance_state
is
not
None
and
'done'
in
instance_state
:
self
.
done
=
instance_state
[
'done'
]
if
instance_state
is
not
None
and
'hint'
in
instance_state
:
self
.
hint
=
instance_state
[
'hint'
]
if
instance_state
is
not
None
and
'correct_map'
in
instance_state
:
if
'self_assess'
in
instance_state
[
'correct_map'
]:
self
.
score
=
instance_state
[
'correct_map'
][
'self_assess'
][
'npoints'
]
...
...
@@ -227,9 +231,10 @@ class SelfAssessmentModule(XModule):
'''
#Extract correctness from ajax and assign points
log
.
debug
(
get
.
keys
())
log
.
debug
(
get
)
self
.
correctness
=
get
.
keys
()[
0
]
.
lower
()
self
.
hint
=
get
[
get
.
keys
()[
1
]]
self
.
correctness
=
get
[
get
.
keys
()[
0
]]
.
lower
()
log
.
debug
(
self
.
hint
)
log
.
debug
(
self
.
correctness
)
points
=
0
if
self
.
correctness
==
"correct"
:
points
=
1
...
...
@@ -241,6 +246,7 @@ class SelfAssessmentModule(XModule):
event_info
=
dict
()
event_info
[
'state'
]
=
{
'seed'
:
1
,
'student_answers'
:
self
.
answer
,
'hint'
:
self
.
hint
,
'correct_map'
:
{
'self_assess'
:
{
'correctness'
:
self
.
correctness
,
'npoints'
:
points
,
'msg'
:
""
,
...
...
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