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
7664f910
Commit
7664f910
authored
Sep 02, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add is_released
parent
9433e897
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
common/djangoapps/xmodule_modifiers.py
+11
-1
lms/templates/staff_problem_info.html
+1
-0
No files found.
common/djangoapps/xmodule_modifiers.py
View file @
7664f910
import
re
import
json
import
logging
import
time
from
django.conf
import
settings
from
functools
import
wraps
...
...
@@ -117,6 +118,13 @@ def add_histogram(get_html, module, user):
data_dir
=
""
source_file
=
module
.
metadata
.
get
(
'source_file'
,
''
)
# source used to generate the problem XML, eg latex or word
# useful to indicate to staff if problem has been released or not
now
=
time
.
gmtime
()
is_released
=
"unknown"
if
hasattr
(
module
,
'start'
):
if
module
.
start
is
not
None
:
is_released
=
"<font color='red'>Yes!</font>"
if
(
now
>
module
.
start
)
else
"<font color='green'>Not yet</font>"
staff_context
=
{
'definition'
:
module
.
definition
.
get
(
'data'
),
'metadata'
:
json
.
dumps
(
module
.
metadata
,
indent
=
4
),
'location'
:
module
.
location
,
...
...
@@ -130,7 +138,9 @@ def add_histogram(get_html, module, user):
'xqa_server'
:
settings
.
MITX_FEATURES
.
get
(
'USE_XQA_SERVER'
,
'http://xqa:server@content-qa.mitx.mit.edu/xqa'
),
'histogram'
:
json
.
dumps
(
histogram
),
'render_histogram'
:
render_histogram
,
'module_content'
:
get_html
()}
'module_content'
:
get_html
(),
'is_released'
:
is_released
,
}
return
render_to_string
(
"staff_problem_info.html"
,
staff_context
)
return
_get_html
...
...
lms/templates/staff_problem_info.html
View file @
7664f910
...
...
@@ -32,6 +32,7 @@ ${module_content}
<h2>
Staff Debug
</h2>
</header>
<div
class=
"staff_info"
style=
"display:block"
>
is_released = ${is_released}
location = ${location | h}
github =
<a
href=
"${edit_link}"
>
${edit_link | h}
</a>
%if source_file:
...
...
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