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
8d747e44
Commit
8d747e44
authored
Aug 17, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Conditionally show calculator
parent
db492cc4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
common/lib/xmodule/xmodule/course_module.py
+18
-0
lms/templates/courseware/courseware.html
+5
-2
No files found.
common/lib/xmodule/xmodule/course_module.py
View file @
8d747e44
...
@@ -127,6 +127,24 @@ class CourseDescriptor(SequenceDescriptor):
...
@@ -127,6 +127,24 @@ class CourseDescriptor(SequenceDescriptor):
def
grade_cutoffs
(
self
):
def
grade_cutoffs
(
self
):
return
self
.
_grading_policy
[
'GRADE_CUTOFFS'
]
return
self
.
_grading_policy
[
'GRADE_CUTOFFS'
]
@property
def
show_calculator
(
self
):
return
self
.
metadata
.
get
(
"show_calculator"
,
None
)
==
"Yes"
@lazyproperty
def
__grading_policy
(
self
):
policy_string
=
""
try
:
with
self
.
system
.
resources_fs
.
open
(
"grading_policy.json"
)
as
grading_policy_file
:
policy_string
=
grading_policy_file
.
read
()
except
(
IOError
,
ResourceNotFoundError
):
log
.
warning
(
"Unable to load course settings file from grading_policy.json in course "
+
self
.
id
)
grading_policy
=
load_grading_policy
(
policy_string
)
return
grading_policy
@lazyproperty
@lazyproperty
def
grading_context
(
self
):
def
grading_context
(
self
):
"""
"""
...
...
lms/templates/courseware/courseware.html
View file @
8d747e44
...
@@ -73,7 +73,9 @@
...
@@ -73,7 +73,9 @@
</div>
</div>
</section>
</section>
<div
class=
"calc-main"
>
% if course.show_calculator:
<div
class=
"calc-main"
>
<a
aria-label=
"Open Calculator"
href=
"#"
class=
"calc"
>
Calculator
</a>
<a
aria-label=
"Open Calculator"
href=
"#"
class=
"calc"
>
Calculator
</a>
<div
id=
"calculator_wrapper"
>
<div
id=
"calculator_wrapper"
>
...
@@ -104,4 +106,5 @@
...
@@ -104,4 +106,5 @@
</form>
</form>
</div>
</div>
</div>
</div>
% endif
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