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
8587044e
Commit
8587044e
authored
Feb 18, 2013
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix capa save button msgs, add simple capa survey mode
parent
3e23b9e1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
common/lib/xmodule/xmodule/capa_module.py
+15
-6
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+1
-2
No files found.
common/lib/xmodule/xmodule/capa_module.py
View file @
8587044e
...
@@ -333,6 +333,12 @@ class CapaModule(XModule):
...
@@ -333,6 +333,12 @@ class CapaModule(XModule):
reset_button
=
False
reset_button
=
False
save_button
=
False
save_button
=
False
# If attempts=0 then show just check and reset buttons; this is for survey questions using capa
if
self
.
max_attempts
==
0
:
check_button
=
False
reset_button
=
True
save_button
=
True
# User submitted a problem, and hasn't reset. We don't want
# User submitted a problem, and hasn't reset. We don't want
# more submissions.
# more submissions.
if
self
.
lcp
.
done
and
self
.
rerandomize
==
"always"
:
if
self
.
lcp
.
done
and
self
.
rerandomize
==
"always"
:
...
@@ -622,11 +628,11 @@ class CapaModule(XModule):
...
@@ -622,11 +628,11 @@ class CapaModule(XModule):
event_info
[
'answers'
]
=
answers
event_info
[
'answers'
]
=
answers
# Too late. Cannot submit
# Too late. Cannot submit
if
self
.
closed
():
if
self
.
closed
()
and
not
self
.
max_attempts
==
0
:
event_info
[
'failure'
]
=
'closed'
event_info
[
'failure'
]
=
'closed'
self
.
system
.
track_function
(
'save_problem_fail'
,
event_info
)
self
.
system
.
track_function
(
'save_problem_fail'
,
event_info
)
return
{
'success'
:
False
,
return
{
'success'
:
False
,
'
error
'
:
"Problem is closed"
}
'
msg
'
:
"Problem is closed"
}
# Problem submitted. Student should reset before saving
# Problem submitted. Student should reset before saving
# again.
# again.
...
@@ -634,13 +640,16 @@ class CapaModule(XModule):
...
@@ -634,13 +640,16 @@ class CapaModule(XModule):
event_info
[
'failure'
]
=
'done'
event_info
[
'failure'
]
=
'done'
self
.
system
.
track_function
(
'save_problem_fail'
,
event_info
)
self
.
system
.
track_function
(
'save_problem_fail'
,
event_info
)
return
{
'success'
:
False
,
return
{
'success'
:
False
,
'
error
'
:
"Problem needs to be reset prior to save."
}
'
msg
'
:
"Problem needs to be reset prior to save."
}
self
.
lcp
.
student_answers
=
answers
self
.
lcp
.
student_answers
=
answers
# TODO: should this be save_problem_fail? Looks like success to me...
self
.
system
.
track_function
(
'save_problem_success'
,
event_info
)
self
.
system
.
track_function
(
'save_problem_fail'
,
event_info
)
msg
=
"Your answers have been saved"
return
{
'success'
:
True
}
if
not
self
.
max_attempts
==
0
:
msg
+=
" but not graded. Hit 'Check' to grade them."
return
{
'success'
:
True
,
'msg'
:
msg
}
def
reset_problem
(
self
,
get
):
def
reset_problem
(
self
,
get
):
''' Changes problem state to unfinished -- removes student answers,
''' Changes problem state to unfinished -- removes student answers,
...
...
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
8587044e
...
@@ -262,8 +262,7 @@ class @Problem
...
@@ -262,8 +262,7 @@ class @Problem
save
:
=>
save
:
=>
Logger
.
log
'problem_save'
,
@
answers
Logger
.
log
'problem_save'
,
@
answers
$
.
postWithPrefix
"
#{
@
url
}
/problem_save"
,
@
answers
,
(
response
)
=>
$
.
postWithPrefix
"
#{
@
url
}
/problem_save"
,
@
answers
,
(
response
)
=>
if
response
.
success
saveMessage
=
response
.
msg
saveMessage
=
"Your answers have been saved but not graded. Hit 'Check' to grade them."
@
gentle_alert
saveMessage
@
gentle_alert
saveMessage
@
updateProgress
response
@
updateProgress
response
...
...
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