Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
7664f910
Commit
7664f910
authored
12 years ago
by
ichuang
Browse files
Options
Downloads
Patches
Plain Diff
add is_released
parent
9433e897
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/djangoapps/xmodule_modifiers.py
+11
-1
11 additions, 1 deletion
common/djangoapps/xmodule_modifiers.py
lms/templates/staff_problem_info.html
+1
-0
1 addition, 0 deletions
lms/templates/staff_problem_info.html
with
12 additions
and
1 deletion
common/djangoapps/xmodule_modifiers.py
+
11
−
1
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
...
...
This diff is collapsed.
Click to expand it.
lms/templates/staff_problem_info.html
+
1
−
0
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:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment