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
4bc27b93
Commit
4bc27b93
authored
11 years ago
by
jkarni
Browse files
Options
Downloads
Plain Diff
Merge pull request #47 from edx/hotfix/jkarni/folditpartialcred
Add partial credit for foldit
parents
01ef72f4
198d63db
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/foldit_module.py
+32
-3
32 additions, 3 deletions
common/lib/xmodule/xmodule/foldit_module.py
with
32 additions
and
3 deletions
common/lib/xmodule/xmodule/foldit_module.py
+
32
−
3
View file @
4bc27b93
...
...
@@ -16,6 +16,8 @@ log = logging.getLogger(__name__)
class
FolditFields
(
object
):
# default to what Spring_7012x uses
required_level_half_credit
=
Integer
(
default
=
3
,
scope
=
Scope
.
settings
)
required_sublevel_half_credit
=
Integer
(
default
=
5
,
scope
=
Scope
.
settings
)
required_level
=
Integer
(
default
=
4
,
scope
=
Scope
.
settings
)
required_sublevel
=
Integer
(
default
=
5
,
scope
=
Scope
.
settings
)
due
=
Date
(
help
=
"
Date that this problem is due by
"
,
scope
=
Scope
.
settings
)
...
...
@@ -36,6 +38,8 @@ class FolditModule(FolditFields, XModule):
<foldit show_basic_score=
"
true
"
required_level=
"
4
"
required_sublevel=
"
3
"
required_level_half_credit=
"
2
"
required_sublevel_half_credit=
"
3
"
show_leaderboard=
"
false
"
/>
"""
...
...
@@ -57,6 +61,22 @@ class FolditModule(FolditFields, XModule):
self
.
due_time
)
return
complete
def
is_half_complete
(
self
):
"""
Did the user reach the required level for half credit?
Ideally this would be more flexible than just 0, 0.5, or 1 credit. On
the other hand, the xml attributes for specifying more specific
cut-offs and partial grades can get more confusing.
"""
from
foldit.models
import
PuzzleComplete
complete
=
PuzzleComplete
.
is_level_complete
(
self
.
system
.
anonymous_student_id
,
self
.
required_level_half_credit
,
self
.
required_sublevel_half_credit
,
self
.
due_time
)
return
complete
def
completed_puzzles
(
self
):
"""
Return a list of puzzles that this user has completed, as an array of
...
...
@@ -139,9 +159,18 @@ class FolditModule(FolditFields, XModule):
def
get_score
(
self
):
"""
0 / 1 based on whether student has gotten far enough.
"""
score
=
1
if
self
.
is_complete
()
else
0
0 if required_level_half_credit - required_sublevel_half_credit not
reached.
0.5 if required_level_half_credit and required_sublevel_half_credit
reached.
1 if requred_level and required_sublevel reached.
"""
if
self
.
is_complete
():
score
=
1
elif
self
.
is_half_complete
():
score
=
0.5
else
:
score
=
0
return
{
'
score
'
:
score
,
'
total
'
:
self
.
max_score
()}
...
...
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