Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
a44eacd4
Commit
a44eacd4
authored
11 years ago
by
Vik Paruchuri
Browse files
Options
Downloads
Patches
Plain Diff
Make fields stringy, remove false dict
parent
21f7e222
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/combined_open_ended_module.py
+8
-8
8 additions, 8 deletions
common/lib/xmodule/xmodule/combined_open_ended_module.py
lms/djangoapps/open_ended_grading/views.py
+1
-2
1 addition, 2 deletions
lms/djangoapps/open_ended_grading/views.py
with
9 additions
and
10 deletions
common/lib/xmodule/xmodule/combined_open_ended_module.py
+
8
−
8
View file @
a44eacd4
...
...
@@ -8,7 +8,7 @@ from .x_module import XModule
from
xblock.core
import
Integer
,
Scope
,
String
,
Boolean
,
List
from
xmodule.open_ended_grading_classes.combined_open_ended_modulev1
import
CombinedOpenEndedV1Module
,
CombinedOpenEndedV1Descriptor
from
collections
import
namedtuple
from
.fields
import
Date
,
StringyFloat
from
.fields
import
Date
,
StringyFloat
,
StringyInteger
,
StringyBoolean
log
=
logging
.
getLogger
(
"
mitx.courseware
"
)
...
...
@@ -49,19 +49,19 @@ class VersionInteger(Integer):
class
CombinedOpenEndedFields
(
object
):
display_name
=
String
(
help
=
"
Display name for this module
"
,
default
=
"
Open Ended Grading
"
,
scope
=
Scope
.
settings
)
current_task_number
=
Integer
(
help
=
"
Current task that the student is on.
"
,
default
=
0
,
scope
=
Scope
.
user_state
)
current_task_number
=
Stringy
Integer
(
help
=
"
Current task that the student is on.
"
,
default
=
0
,
scope
=
Scope
.
user_state
)
task_states
=
List
(
help
=
"
List of state dictionaries of each task within this module.
"
,
scope
=
Scope
.
user_state
)
state
=
String
(
help
=
"
Which step within the current task that the student is on.
"
,
default
=
"
initial
"
,
scope
=
Scope
.
user_state
)
student_attempts
=
Integer
(
help
=
"
Number of attempts taken by the student on this problem
"
,
default
=
0
,
student_attempts
=
Stringy
Integer
(
help
=
"
Number of attempts taken by the student on this problem
"
,
default
=
0
,
scope
=
Scope
.
user_state
)
ready_to_reset
=
Boolean
(
help
=
"
If the problem is ready to be reset or not.
"
,
default
=
False
,
ready_to_reset
=
Stringy
Boolean
(
help
=
"
If the problem is ready to be reset or not.
"
,
default
=
False
,
scope
=
Scope
.
user_state
)
attempts
=
Integer
(
help
=
"
Maximum number of attempts that a student is allowed.
"
,
default
=
1
,
scope
=
Scope
.
settings
)
is_graded
=
Boolean
(
help
=
"
Whether or not the problem is graded.
"
,
default
=
False
,
scope
=
Scope
.
settings
)
accept_file_upload
=
Boolean
(
help
=
"
Whether or not the problem accepts file uploads.
"
,
default
=
False
,
attempts
=
Stringy
Integer
(
help
=
"
Maximum number of attempts that a student is allowed.
"
,
default
=
1
,
scope
=
Scope
.
settings
)
is_graded
=
Stringy
Boolean
(
help
=
"
Whether or not the problem is graded.
"
,
default
=
False
,
scope
=
Scope
.
settings
)
accept_file_upload
=
Stringy
Boolean
(
help
=
"
Whether or not the problem accepts file uploads.
"
,
default
=
False
,
scope
=
Scope
.
settings
)
skip_spelling_checks
=
Boolean
(
help
=
"
Whether or not to skip initial spelling checks.
"
,
default
=
True
,
skip_spelling_checks
=
Stringy
Boolean
(
help
=
"
Whether or not to skip initial spelling checks.
"
,
default
=
True
,
scope
=
Scope
.
settings
)
due
=
Date
(
help
=
"
Date that this problem is due by
"
,
default
=
None
,
scope
=
Scope
.
settings
)
graceperiod
=
String
(
help
=
"
Amount of time after the due date that submissions will be accepted
"
,
default
=
None
,
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/open_ended_grading/views.py
+
1
−
2
View file @
a44eacd4
...
...
@@ -103,13 +103,12 @@ def find_peer_grading_module(course):
#Get the course id and split it
course_id_parts
=
course
.
id
.
split
(
"
/
"
)
false_dict
=
[
False
,
"
False
"
,
"
false
"
,
"
FALSE
"
]
#TODO: This will not work with multiple runs of a course. Make it work. The last key in the Location passed
#to get_items is called revision. Is this the same as run?
#Get the peer grading modules currently in the course
items
=
modulestore
().
get_items
([
'
i4x
'
,
None
,
course_id_parts
[
1
],
'
peergrading
'
,
None
])
#See if any of the modules are centralized modules (ie display info from multiple problems)
items
=
[
i
for
i
in
items
if
getattr
(
i
,
"
use_for_single_location
"
,
True
)
in
false_dict
]
items
=
[
i
for
i
in
items
if
not
getattr
(
i
,
"
use_for_single_location
"
,
True
)]
#Get the first one
if
len
(
items
)
>
0
:
item_location
=
items
[
0
].
location
...
...
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