Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
e0d12bcb
Commit
e0d12bcb
authored
12 years ago
by
Vik Paruchuri
Browse files
Options
Downloads
Patches
Plain Diff
Add in some descriptions
parent
5858ec5e
No related branches found
Branches containing commit
Tags
release-2021-02-11-09.41
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/combined_open_ended_module.py
+56
-1
56 additions, 1 deletion
common/lib/xmodule/xmodule/combined_open_ended_module.py
with
56 additions
and
1 deletion
common/lib/xmodule/xmodule/combined_open_ended_module.py
+
56
−
1
View file @
e0d12bcb
...
...
@@ -33,7 +33,62 @@ MAX_ATTEMPTS = 1
MAX_SCORE
=
1
class
CombinedOpenEndedModule
(
XModule
):
pass
STATE_VERSION
=
1
# states
INITIAL
=
'
initial
'
ASSESSING
=
'
assessing
'
DONE
=
'
done
'
TASK_TYPES
=
[
"
self
"
,
"
ml
"
,
"
instructor
"
,
"
peer
"
]
js
=
{
'
coffee
'
:
[
resource_string
(
__name__
,
'
js/src/selfassessment/display.coffee
'
)]}
js_module_name
=
"
SelfAssessment
"
def
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
XModule
.
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
instance_state
,
shared_state
,
**
kwargs
)
"""
Definition file should have multiple task blocks:
Sample file:
<combinedopenended>
<task type=
"
self
"
>
<selfassessment>
</selfassessment>
</task>
</combinedopenended>
"""
# Load instance state
if
instance_state
is
not
None
:
instance_state
=
json
.
loads
(
instance_state
)
else
:
instance_state
=
{}
instance_state
=
self
.
convert_state_to_current_format
(
instance_state
)
# History is a list of tuples of (answer, score, hint), where hint may be
# None for any element, and score and hint can be None for the last (current)
# element.
# Scores are on scale from 0 to max_score
self
.
history
=
instance_state
.
get
(
'
history
'
,
[])
self
.
state
=
instance_state
.
get
(
'
state
'
,
'
initial
'
)
self
.
attempts
=
instance_state
.
get
(
'
attempts
'
,
0
)
self
.
max_attempts
=
int
(
self
.
metadata
.
get
(
'
attempts
'
,
MAX_ATTEMPTS
))
# Used for progress / grading. Currently get credit just for
# completion (doesn't matter if you self-assessed correct/incorrect).
self
.
_max_score
=
int
(
self
.
metadata
.
get
(
'
max_score
'
,
MAX_SCORE
))
self
.
rubric
=
definition
[
'
rubric
'
]
self
.
prompt
=
definition
[
'
prompt
'
]
self
.
submit_message
=
definition
[
'
submitmessage
'
]
self
.
hint_prompt
=
definition
[
'
hintprompt
'
]
class
CombinedOpenEndedDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment