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
bcbf65e2
Commit
bcbf65e2
authored
Jan 11, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code reformat, line length fix, change text names to variables
parent
8dbbb021
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
16 deletions
+16
-16
common/lib/xmodule/xmodule/combined_open_ended_module.py
+0
-0
common/lib/xmodule/xmodule/open_ended_module.py
+0
-0
common/lib/xmodule/xmodule/openendedchild.py
+10
-10
common/lib/xmodule/xmodule/self_assessment_module.py
+6
-6
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
bcbf65e2
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/open_ended_module.py
View file @
bcbf65e2
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/openendedchild.py
View file @
bcbf65e2
...
...
@@ -63,11 +63,11 @@ class OpenEndedChild():
DONE
=
'done'
#This is used to tell students where they are at in the module
HUMAN_NAMES
=
{
'initial'
:
'Started'
,
'assessing'
:
'Being scored'
,
'post_assessment'
:
'Scoring finished'
,
'done'
:
'Problem complete'
,
HUMAN_NAMES
=
{
'initial'
:
'Started'
,
'assessing'
:
'Being scored'
,
'post_assessment'
:
'Scoring finished'
,
'done'
:
'Problem complete'
,
}
def
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
static_data
,
...
...
@@ -84,7 +84,7 @@ class OpenEndedChild():
# Scores are on scale from 0 to max_score
self
.
history
=
instance_state
.
get
(
'history'
,
[])
self
.
state
=
instance_state
.
get
(
'state'
,
'initial'
)
self
.
state
=
instance_state
.
get
(
'state'
,
self
.
INITIAL
)
self
.
created
=
instance_state
.
get
(
'created'
,
"False"
)
...
...
@@ -171,7 +171,7 @@ class OpenEndedChild():
'state'
:
self
.
state
,
'max_score'
:
self
.
_max_score
,
'attempts'
:
self
.
attempts
,
'created'
:
"False"
,
'created'
:
"False"
,
}
return
json
.
dumps
(
state
)
...
...
@@ -244,8 +244,8 @@ class OpenEndedChild():
@param score: Numeric score.
@return: Boolean correct.
"""
correct
=
False
if
(
isinstance
(
score
,(
int
,
long
,
float
,
complex
))):
correct
=
False
if
(
isinstance
(
score
,
(
int
,
long
,
float
,
complex
))):
score_ratio
=
int
(
score
)
/
float
(
self
.
max_score
())
correct
=
(
score_ratio
>=
0.66
)
return
correct
...
...
@@ -255,7 +255,7 @@ class OpenEndedChild():
Checks to see if the last response in the module is correct.
@return: 'correct' if correct, otherwise 'incorrect'
"""
score
=
self
.
get_score
()[
'score'
]
score
=
self
.
get_score
()[
'score'
]
correctness
=
'correct'
if
self
.
is_submission_correct
(
score
)
else
'incorrect'
return
correctness
...
...
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
bcbf65e2
...
...
@@ -40,6 +40,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
</submitmessage>
</selfassessment>
"""
def
setup_response
(
self
,
system
,
location
,
definition
,
descriptor
):
"""
Sets up the module
...
...
@@ -76,7 +77,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
'initial_message'
:
self
.
get_message_html
(),
'state'
:
self
.
state
,
'allow_reset'
:
self
.
_allow_reset
(),
'child_type'
:
'selfassessment'
,
'child_type'
:
'selfassessment'
,
}
html
=
system
.
render_template
(
'self_assessment_prompt.html'
,
context
)
...
...
@@ -112,7 +113,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
})
return
json
.
dumps
(
d
,
cls
=
ComplexEncoder
)
def
get_rubric_html
(
self
,
system
):
def
get_rubric_html
(
self
,
system
):
"""
Return the appropriate version of the rubric, based on the state.
"""
...
...
@@ -121,7 +122,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
# we'll render it
context
=
{
'rubric'
:
self
.
rubric
,
'max_score'
:
self
.
_max_score
,
'max_score'
:
self
.
_max_score
,
}
if
self
.
state
==
self
.
ASSESSING
:
...
...
@@ -133,7 +134,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
return
system
.
render_template
(
'self_assessment_rubric.html'
,
context
)
def
get_hint_html
(
self
,
system
):
def
get_hint_html
(
self
,
system
):
"""
Return the appropriate version of the hint view, based on state.
"""
...
...
@@ -228,7 +229,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
self
.
record_latest_score
(
score
)
d
=
{
'success'
:
True
,}
d
=
{
'success'
:
True
,
}
if
score
==
self
.
max_score
():
self
.
change_state
(
self
.
DONE
)
...
...
@@ -264,7 +265,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
'allow_reset'
:
self
.
_allow_reset
()}
class
SelfAssessmentDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
"""
Module for adding self assessment questions to courses
...
...
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