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
a76b91b5
Commit
a76b91b5
authored
Jun 20, 2013
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #42 from edx/alex/fix_is_completed
Alex/fix is completed
parents
6f95d21e
23d4a2b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
10 deletions
+31
-10
common/lib/xmodule/xmodule/capa_module.py
+12
-7
common/lib/xmodule/xmodule/conditional_module.py
+15
-2
doc/public/course_data_formats/conditional_module/conditional_module.rst
+4
-1
No files found.
common/lib/xmodule/xmodule/capa_module.py
View file @
a76b91b5
...
...
@@ -279,7 +279,7 @@ class CapaModule(CapaFields, XModule):
"""
Return True/False to indicate whether to show the "Check" button.
"""
submitted_without_reset
=
(
self
.
is_
comple
ted
()
and
self
.
rerandomize
==
"always"
)
submitted_without_reset
=
(
self
.
is_
submit
ted
()
and
self
.
rerandomize
==
"always"
)
# If the problem is closed (past due / too many attempts)
# then we do NOT show the "check" button
...
...
@@ -302,7 +302,7 @@ class CapaModule(CapaFields, XModule):
# then do NOT show the reset button.
# If the problem hasn't been submitted yet, then do NOT show
# the reset button.
if
(
self
.
closed
()
and
not
is_survey_question
)
or
not
self
.
is_
comple
ted
():
if
(
self
.
closed
()
and
not
is_survey_question
)
or
not
self
.
is_
submit
ted
():
return
False
else
:
return
True
...
...
@@ -322,7 +322,7 @@ class CapaModule(CapaFields, XModule):
return
not
self
.
closed
()
else
:
is_survey_question
=
(
self
.
max_attempts
==
0
)
needs_reset
=
self
.
is_
comple
ted
()
and
self
.
rerandomize
==
"always"
needs_reset
=
self
.
is_
submit
ted
()
and
self
.
rerandomize
==
"always"
# If the student has unlimited attempts, and their answers
# are not randomized, then we do not need a save button
...
...
@@ -516,13 +516,18 @@ class CapaModule(CapaFields, XModule):
return
False
def
is_completed
(
self
):
# used by conditional module
# return self.answer_available()
def
is_submitted
(
self
):
"""
Used to decide to show or hide RESET or CHECK buttons.
Means that student submitted problem and nothing more.
Problem can be completely wrong.
Pressing RESET button makes this function to return False.
"""
return
self
.
lcp
.
done
def
is_attempted
(
self
):
# used by conditional module
"""Used by conditional module"""
return
self
.
attempts
>
0
def
is_correct
(
self
):
...
...
common/lib/xmodule/xmodule/conditional_module.py
View file @
a76b91b5
...
...
@@ -35,8 +35,11 @@ class ConditionalModule(ConditionalFields, XModule):
<conditional> tag attributes:
sources - location id of required modules, separated by ';'
completed - map to `is_completed` module method
submitted - map to `is_submitted` module method.
(pressing RESET button makes this function to return False.)
attempted - map to `is_attempted` module method
correct - map to `is_correct` module method
poll_answer - map to `poll_answer` module attribute
voted - map to `voted` module attribute
...
...
@@ -70,8 +73,18 @@ class ConditionalModule(ConditionalFields, XModule):
# value: <name of module attribute>
conditions_map
=
{
'poll_answer'
:
'poll_answer'
,
# poll_question attr
'completed'
:
'is_completed'
,
# capa_problem attr
# problem was submitted (it can be wrong)
# if student will press reset button after that,
# state will be reverted
'submitted'
:
'is_submitted'
,
# capa_problem attr
# if student attempted problem
'attempted'
:
'is_attempted'
,
# capa_problem attr
# if problem is full points
'correct'
:
'is_correct'
,
'voted'
:
'voted'
# poll_question attr
}
...
...
doc/public/course_data_formats/conditional_module/conditional_module.rst
View file @
a76b91b5
...
...
@@ -23,8 +23,11 @@ be specified for this tag::
sources - location id of required modules, separated by ';'
[message | ""] - message for case, where one or more are not passed. Here you can use variable {link}, which generate link to required module.
[submitted] - map to `is_submitted` module method.
(pressing RESET button makes this function to return False.)
[co
mpleted] - map to `is_completed
` module method
[co
rrect] - map to `is_correct
` module method
[attempted] - map to `is_attempted` module method
[poll_answer] - map to `poll_answer` module attribute
[voted] - map to `voted` module attribute
...
...
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