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
0739d3ba
Commit
0739d3ba
authored
Nov 01, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding in progress functionality
parent
56637347
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
16 deletions
+31
-16
common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
+5
-14
common/lib/xmodule/xmodule/self_assessment_module.py
+26
-2
No files found.
common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
View file @
0739d3ba
$
(
document
).
on
(
'click'
,
'section.sa-wrapper input#show'
,
(
->
root
=
location
.
protocol
+
"//"
+
location
.
host
post_url
=
$
(
'section.sa-wrapper input#show'
).
attr
(
'url'
)
alert
(
post_url
)
final_url
=
"/courses/MITx/6.002x/2012_Fall/modx/
#{
post_url
}
/sa_show"
a
lert
(
final_url
)
a
nswer
=
$
(
'section.sa-wrapper input#answer'
).
val
(
)
$
.
post
final_url
,
answer
,
(
response
)
->
if
response
.
success
$
(
'p.rubric'
).
replace
(
response
.
rubric
)
alert
(
"posted"
)
if
response
.
success
alert
(
response
.
rubric
)
$
(
'section.sa-wrapper p#rubric'
).
replace
(
response
.
rubric
)
alert
(
"save"
)
));
...
...
@@ -33,13 +34,3 @@ $(document).on('click', 'section.sa-wrapper input#save', ( ->
alert
(
"save"
)
));
show
:
=>
alert
(
"show"
)
#$.postWithPrefix "/sa_show", (response) =>
# answers = response.answers
# @el.addClass 'showed'
save
:
=>
alert
(
"save"
)
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
0739d3ba
...
...
@@ -74,6 +74,30 @@ class SelfAssessmentModule(XModule):
self
.
answers
=
{}
self
.
score
=
0
self
.
max_score
=
1
def
get_score
(
self
):
return
self
.
score
def
max_score
(
self
):
return
self
.
max_score
def
get_progress
(
self
):
''' For now, just return score / max_score
'''
score
=
self
.
get_score
()
score
=
d
[
'score'
]
total
=
self
.
max_score
()
if
total
>
0
:
try
:
return
Progress
(
score
,
total
)
except
Exception
as
err
:
log
.
exception
(
"Got bad progress"
)
return
None
return
None
def
handle_ajax
(
self
,
dispatch
,
get
):
'''
...
...
@@ -105,8 +129,8 @@ class SelfAssessmentModule(XModule):
def
show_rubric
:
return
{
'success'
:
True
}
def
show_rubric
(
self
,
get
)
:
return
{
'success'
:
True
,
'rubric'
:
rubric_form
}
def
save_problem
(
self
,
get
):
...
...
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