Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-activetable
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
xblock-activetable
Commits
e933d41b
Commit
e933d41b
authored
May 17, 2017
by
Sven Marnach
Committed by
GitHub
May 17, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2 from UmanShahzad/uman/OC-2642
Fix [EDUCATOR-338]: Errors: "'float' object is not callable"
parents
1786a2c8
e05e35b0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
activetable/activetable.py
+5
-5
activetable/static/js/src/activetable.js
+2
-2
No files found.
activetable/activetable.py
View file @
e933d41b
...
...
@@ -74,7 +74,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
scope
=
Scope
.
content
,
default
=
1.0
,
)
max_score
=
Float
(
max
imum
_score
=
Float
(
display_name
=
'Maximum score'
,
help
=
'The number of points students will be awarded when solving all fields correctly. '
'For partially correct attempts, the score will be pro-rated.'
,
...
...
@@ -95,7 +95,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
'column_widths'
,
'row_heights'
,
'default_tolerance'
,
'max_score'
,
'max
imum
_score'
,
'max_attempts'
,
]
...
...
@@ -171,7 +171,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
num_correct_answers
=
self
.
num_correct_answers
,
num_total_answers
=
self
.
num_total_answers
,
score
=
self
.
score
,
max
_score
=
self
.
max
_score
,
max
imum_score
=
self
.
maximum
_score
,
attempts
=
self
.
attempts
,
max_attempts
=
self
.
max_attempts
,
)
...
...
@@ -231,8 +231,8 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
"""
self
.
answers_correct
=
self
.
check_and_save_answers
(
data
)
self
.
attempts
+=
1
self
.
score
=
self
.
num_correct_answers
*
self
.
max_score
/
len
(
self
.
answers_correct
)
self
.
runtime
.
publish
(
self
,
'grade'
,
dict
(
value
=
self
.
score
,
max_value
=
self
.
max_score
))
self
.
score
=
self
.
num_correct_answers
*
self
.
max
imum
_score
/
len
(
self
.
answers_correct
)
self
.
runtime
.
publish
(
self
,
'grade'
,
dict
(
value
=
self
.
score
,
max_value
=
self
.
max
imum
_score
))
return
self
.
get_status
()
@XBlock.json_handler
...
...
activetable/static/js/src/activetable.js
View file @
e933d41b
...
...
@@ -47,9 +47,9 @@ function ActiveTableXBlock(runtime, element, init_args) {
function
updateFeedback
(
data
)
{
var
feedback_msg
;
if
(
data
.
score
===
null
)
{
feedback_msg
=
'('
+
data
.
max_score
+
' points possible)'
;
feedback_msg
=
'('
+
data
.
max
imum
_score
+
' points possible)'
;
}
else
{
feedback_msg
=
'('
+
data
.
score
+
'/'
+
data
.
max_score
+
' points)'
;
feedback_msg
=
'('
+
data
.
score
+
'/'
+
data
.
max
imum
_score
+
' points)'
;
}
if
(
data
.
max_attempts
)
{
feedback_msg
=
'You have used '
+
data
.
attempts
+
' of '
+
data
.
max_attempts
+
...
...
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