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
4bc27b93
Commit
4bc27b93
authored
Jun 03, 2013
by
jkarni
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #47 from edx/hotfix/jkarni/folditpartialcred
Add partial credit for foldit
parents
01ef72f4
198d63db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
3 deletions
+32
-3
common/lib/xmodule/xmodule/foldit_module.py
+32
-3
No files found.
common/lib/xmodule/xmodule/foldit_module.py
View file @
4bc27b93
...
@@ -16,6 +16,8 @@ log = logging.getLogger(__name__)
...
@@ -16,6 +16,8 @@ log = logging.getLogger(__name__)
class
FolditFields
(
object
):
class
FolditFields
(
object
):
# default to what Spring_7012x uses
# 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_level
=
Integer
(
default
=
4
,
scope
=
Scope
.
settings
)
required_sublevel
=
Integer
(
default
=
5
,
scope
=
Scope
.
settings
)
required_sublevel
=
Integer
(
default
=
5
,
scope
=
Scope
.
settings
)
due
=
Date
(
help
=
"Date that this problem is due by"
,
scope
=
Scope
.
settings
)
due
=
Date
(
help
=
"Date that this problem is due by"
,
scope
=
Scope
.
settings
)
...
@@ -36,6 +38,8 @@ class FolditModule(FolditFields, XModule):
...
@@ -36,6 +38,8 @@ class FolditModule(FolditFields, XModule):
<foldit show_basic_score="true"
<foldit show_basic_score="true"
required_level="4"
required_level="4"
required_sublevel="3"
required_sublevel="3"
required_level_half_credit="2"
required_sublevel_half_credit="3"
show_leaderboard="false"/>
show_leaderboard="false"/>
"""
"""
...
@@ -57,6 +61,22 @@ class FolditModule(FolditFields, XModule):
...
@@ -57,6 +61,22 @@ class FolditModule(FolditFields, XModule):
self
.
due_time
)
self
.
due_time
)
return
complete
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
):
def
completed_puzzles
(
self
):
"""
"""
Return a list of puzzles that this user has completed, as an array of
Return a list of puzzles that this user has completed, as an array of
...
@@ -139,9 +159,18 @@ class FolditModule(FolditFields, XModule):
...
@@ -139,9 +159,18 @@ class FolditModule(FolditFields, XModule):
def
get_score
(
self
):
def
get_score
(
self
):
"""
"""
0 / 1 based on whether student has gotten far enough.
0 if required_level_half_credit - required_sublevel_half_credit not
"""
reached.
score
=
1
if
self
.
is_complete
()
else
0
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
,
return
{
'score'
:
score
,
'total'
:
self
.
max_score
()}
'total'
:
self
.
max_score
()}
...
...
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