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
108ab51f
Commit
108ab51f
authored
Aug 16, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #434 from MITx/sarina/max-attempts-fix
Add facility for fixed number of problem attempts
parents
9c0e5fd9
9f158dbd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
common/lib/xmodule/xmodule/capa_module.py
+10
-5
No files found.
common/lib/xmodule/xmodule/capa_module.py
View file @
108ab51f
...
...
@@ -108,11 +108,9 @@ class CapaModule(XModule):
self
.
grace_period
=
None
self
.
close_date
=
self
.
display_due_date
self
.
max_attempts
=
only_one
(
dom2
.
xpath
(
'/problem/@attempts'
)
)
if
len
(
self
.
max_attempts
)
>
0
:
self
.
max_attempts
=
self
.
metadata
.
get
(
'attempts'
,
None
)
if
self
.
max_attempts
is
not
None
:
self
.
max_attempts
=
int
(
self
.
max_attempts
)
else
:
self
.
max_attempts
=
None
self
.
show_answer
=
self
.
metadata
.
get
(
'showanswer'
,
'closed'
)
...
...
@@ -244,7 +242,14 @@ class CapaModule(XModule):
# We using strings as truthy values, because the terminology of the
# check button is context-specific.
check_button
=
"Grade"
if
self
.
max_attempts
else
"Check"
# Put a "Check" button if unlimited attempts or still some left
if
self
.
max_attempts
is
None
or
self
.
attempts
<
self
.
max_attempts
-
1
:
check_button
=
"Check"
else
:
# Will be final check so let user know that
check_button
=
"Final Check"
reset_button
=
True
save_button
=
True
...
...
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