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
1494cbbd
Commit
1494cbbd
authored
12 years ago
by
ichuang
Committed by
pmitros
12 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged root URL prefix from Ike. Errors should be attributed to pmitros.
parent
cd782670
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
15 deletions
+26
-15
djangoapps/courseware/module_render.py
+3
-1
djangoapps/courseware/views.py
+1
-1
lib/mitxmako/shortcuts.py
+1
-0
settings.py
+8
-0
templates/main.html
+1
-1
templates/navigation.html
+7
-7
templates/problem.js
+4
-4
templates/seq_module.js
+1
-1
No files found.
djangoapps/courseware/module_render.py
View file @
1494cbbd
...
@@ -78,7 +78,7 @@ def render_x_module(user, request, xml_module, module_object_preload):
...
@@ -78,7 +78,7 @@ def render_x_module(user, request, xml_module, module_object_preload):
state
=
smod
.
state
state
=
smod
.
state
# Create a new instance
# Create a new instance
ajax_url
=
'/modx/'
+
module_type
+
'/'
+
module_id
+
'/'
ajax_url
=
settings
.
MITX_ROOT_URL
+
'/modx/'
+
module_type
+
'/'
+
module_id
+
'/'
system
=
I4xSystem
(
track_function
=
make_track_function
(
request
),
system
=
I4xSystem
(
track_function
=
make_track_function
(
request
),
render_function
=
lambda
x
:
render_module
(
user
,
request
,
x
,
module_object_preload
),
render_function
=
lambda
x
:
render_module
(
user
,
request
,
x
,
module_object_preload
),
ajax_url
=
ajax_url
,
ajax_url
=
ajax_url
,
...
@@ -102,6 +102,8 @@ def render_x_module(user, request, xml_module, module_object_preload):
...
@@ -102,6 +102,8 @@ def render_x_module(user, request, xml_module, module_object_preload):
content
=
instance
.
get_html
()
content
=
instance
.
get_html
()
init_js
=
instance
.
get_init_js
()
init_js
=
instance
.
get_init_js
()
destory_js
=
instance
.
get_destroy_js
()
destory_js
=
instance
.
get_destroy_js
()
# special extra information about each problem, only for users who are staff
if
user
.
is_staff
:
if
user
.
is_staff
:
histogram
=
grade_histogram
(
module_id
)
histogram
=
grade_histogram
(
module_id
)
render_histogram
=
len
(
histogram
)
>
0
render_histogram
=
len
(
histogram
)
>
0
...
...
This diff is collapsed.
Click to expand it.
djangoapps/courseware/views.py
View file @
1494cbbd
...
@@ -204,7 +204,7 @@ def modx_dispatch(request, module=None, dispatch=None, id=None):
...
@@ -204,7 +204,7 @@ def modx_dispatch(request, module=None, dispatch=None, id=None):
dispatch
=
dispatch
.
split
(
'?'
)[
0
]
dispatch
=
dispatch
.
split
(
'?'
)[
0
]
ajax_url
=
'/modx/'
+
module
+
'/'
+
id
+
'/'
ajax_url
=
settings
.
MITX_ROOT_URL
+
'/modx/'
+
module
+
'/'
+
id
+
'/'
# Grab the XML corresponding to the request from course.xml
# Grab the XML corresponding to the request from course.xml
xml
=
content_parser
.
module_xml
(
request
.
user
,
module
,
'id'
,
id
)
xml
=
content_parser
.
module_xml
(
request
.
user
,
module
,
'id'
,
id
)
...
...
This diff is collapsed.
Click to expand it.
lib/mitxmako/shortcuts.py
View file @
1494cbbd
...
@@ -27,6 +27,7 @@ def render_to_string(template_name, dictionary, context=None, namespace='main'):
...
@@ -27,6 +27,7 @@ def render_to_string(template_name, dictionary, context=None, namespace='main'):
# collapse context_instance to a single dictionary for mako
# collapse context_instance to a single dictionary for mako
context_dictionary
=
{}
context_dictionary
=
{}
context_instance
[
'settings'
]
=
settings
context_instance
[
'settings'
]
=
settings
context_instance
[
'MITX_ROOT_URL'
]
=
settings
.
MITX_ROOT_URL
for
d
in
mitxmako
.
middleware
.
requestcontext
:
for
d
in
mitxmako
.
middleware
.
requestcontext
:
context_dictionary
.
update
(
d
)
context_dictionary
.
update
(
d
)
for
d
in
context_instance
:
for
d
in
context_instance
:
...
...
This diff is collapsed.
Click to expand it.
settings.py
View file @
1494cbbd
...
@@ -5,6 +5,14 @@ import tempfile
...
@@ -5,6 +5,14 @@ import tempfile
import
djcelery
import
djcelery
MITX_ROOT_URL
=
''
COURSE_NAME
=
"6.002_Spring_2012"
COURSE_NUMBER
=
"6.002x"
COURSE_TITLE
=
"Circuits and Electronics"
ROOT_URLCONF
=
'urls'
# from settings2.askbotsettings import LIVESETTINGS_OPTIONS
# from settings2.askbotsettings import LIVESETTINGS_OPTIONS
DEFAULT_GROUPS
=
[]
DEFAULT_GROUPS
=
[]
...
...
This diff is collapsed.
Click to expand it.
templates/main.html
View file @
1494cbbd
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
</li>
</li>
<li><a
href=
"/s/help.html"
>
Help
</a></li>
<li><a
href=
"/s/help.html"
>
Help
</a></li>
% if user.is_authenticated():
% if user.is_authenticated():
<li><a
href=
"
/logout"
>
Log out
</a></li>
<li><a
href=
"${ settings.MITX_ROOT_URL }
/logout"
>
Log out
</a></li>
% endif
% endif
</ul>
</ul>
</nav>
</nav>
...
...
This diff is collapsed.
Click to expand it.
templates/navigation.html
View file @
1494cbbd
...
@@ -3,20 +3,20 @@
...
@@ -3,20 +3,20 @@
<header>
<header>
<hgroup>
<hgroup>
<h1><em>
MITx
</em></h1>
<h1><em>
MITx
</em></h1>
<h2><a
href=
"
/courseware"
>
Circuits and Electronics
</a></h2>
<h2><a
href=
"
${ MITX_ROOT_URL }/courseware/"
>
${ settings.COURSE_TITLE }
</a></h2>
</hgroup>
</hgroup>
<nav
class=
"${active_page}"
>
<nav
class=
"${active_page}"
>
<ul
class=
"coursenav"
>
<ul
class=
"coursenav"
>
<li
class=
"courseware"
><a
href=
"
/courseware
"
>
Courseware
</a></li>
<li
class=
"courseware"
><a
href=
"
${ MITX_ROOT_URL }/courseware/
"
>
Courseware
</a></li>
<li
class=
"info"
><a
href=
"/info"
>
Course Info
</a></li>
<li
class=
"info"
><a
href=
"
${ MITX_ROOT_URL }
/info"
>
Course Info
</a></li>
% if user.is_authenticated():
% if user.is_authenticated():
<li
class=
"book"
><a
href=
"/book"
>
Textbook
</a></li>
<li
class=
"book"
><a
href=
"
${ MITX_ROOT_URL }
/book"
>
Textbook
</a></li>
<li
class=
"discussion"
><a
href=
"
/discussion/questions
"
>
Discussion
</a></li>
<li
class=
"discussion"
><a
href=
"
${ MITX_ROOT_URL }/discussion/questions/
"
>
Discussion
</a></li>
% endif
% endif
<li
class=
"wiki"
><a
href=
"
/wiki/view
"
>
Wiki
</a></li>
<li
class=
"wiki"
><a
href=
"
${ MITX_ROOT_URL }/wiki/view/
"
>
Wiki
</a></li>
% if user.is_authenticated():
% if user.is_authenticated():
<li
class=
"profile"
><a
href=
"/profile"
>
Profile
</a></li>
<li
class=
"profile"
><a
href=
"
${ MITX_ROOT_URL }
/profile"
>
Profile
</a></li>
% endif
% endif
</ul>
</ul>
</nav>
</nav>
...
...
This diff is collapsed.
Click to expand it.
templates/problem.js
View file @
1494cbbd
...
@@ -8,7 +8,7 @@ function ${ id }_content_updated() {
...
@@ -8,7 +8,7 @@ function ${ id }_content_updated() {
$
.
each
(
$
(
"[id^=input_${ id }_]"
),
function
(
index
,
value
){
$
.
each
(
$
(
"[id^=input_${ id }_]"
),
function
(
index
,
value
){
submit_data
[
value
.
id
]
=
value
.
value
;
submit_data
[
value
.
id
]
=
value
.
value
;
});
});
postJSON
(
'/modx/problem/${ id }/problem_check'
,
postJSON
(
'
${ MITX_ROOT_URL }
/modx/problem/${ id }/problem_check'
,
submit_data
,
submit_data
,
function
(
json
)
{
function
(
json
)
{
switch
(
json
.
success
)
{
switch
(
json
.
success
)
{
...
@@ -30,7 +30,7 @@ function ${ id }_content_updated() {
...
@@ -30,7 +30,7 @@ function ${ id }_content_updated() {
submit_data
[
value
.
id
]
=
value
.
value
;
submit_data
[
value
.
id
]
=
value
.
value
;
});
});
postJSON
(
'/modx/problem/${ id }/problem_reset'
,
{
'id'
:
'${ id }'
},
function
(
html_as_json
)
{
postJSON
(
'
${ MITX_ROOT_URL }
/modx/problem/${ id }/problem_reset'
,
{
'id'
:
'${ id }'
},
function
(
html_as_json
)
{
$
(
'#main_${ id }'
).
html
(
html_as_json
);
$
(
'#main_${ id }'
).
html
(
html_as_json
);
$
{
id
}
_content_updated
();
$
{
id
}
_content_updated
();
});
});
...
@@ -38,7 +38,7 @@ function ${ id }_content_updated() {
...
@@ -38,7 +38,7 @@ function ${ id }_content_updated() {
});
});
$
(
'#show_${ id }'
).
unbind
(
'click'
).
click
(
function
()
{
$
(
'#show_${ id }'
).
unbind
(
'click'
).
click
(
function
()
{
postJSON
(
'/modx/problem/${ id }/problem_show'
,
{},
function
(
data
)
{
postJSON
(
'
${ MITX_ROOT_URL }
/modx/problem/${ id }/problem_show'
,
{},
function
(
data
)
{
for
(
var
key
in
data
)
{
for
(
var
key
in
data
)
{
$
(
"#answer_"
+
key
).
text
(
data
[
key
]);
$
(
"#answer_"
+
key
).
text
(
data
[
key
]);
}
}
...
@@ -53,7 +53,7 @@ function ${ id }_content_updated() {
...
@@ -53,7 +53,7 @@ function ${ id }_content_updated() {
$
.
each
(
$
(
"[id^=input_${ id }_]"
),
function
(
index
,
value
)
{
$
.
each
(
$
(
"[id^=input_${ id }_]"
),
function
(
index
,
value
)
{
submit_data
[
value
.
id
]
=
value
.
value
;
submit_data
[
value
.
id
]
=
value
.
value
;
});
});
postJSON
(
'/modx/problem/${ id }/problem_save'
,
postJSON
(
'
${ MITX_ROOT_URL }
/modx/problem/${ id }/problem_save'
,
submit_data
,
submit_data
,
function
(
data
)
{
function
(
data
)
{
if
(
data
.
success
)
{
if
(
data
.
success
)
{
...
...
This diff is collapsed.
Click to expand it.
templates/seq_module.js
View file @
1494cbbd
...
@@ -53,7 +53,7 @@ function disablePrev() {
...
@@ -53,7 +53,7 @@ function disablePrev() {
function
$
{
id
}
goto
(
i
)
{
function
$
{
id
}
goto
(
i
)
{
log_event
(
"seq_goto"
,
{
'old'
:
$
{
id
}
loc
,
'new'
:
i
,
'id'
:
'${id}'
});
log_event
(
"seq_goto"
,
{
'old'
:
$
{
id
}
loc
,
'new'
:
i
,
'id'
:
'${id}'
});
postJSON
(
'/modx/sequential/${ id }/goto_position'
,
postJSON
(
'
${ MITX_ROOT_URL }
/modx/sequential/${ id }/goto_position'
,
{
'position'
:
i
});
{
'position'
:
i
});
if
(
$
{
id
}
loc
!=-
1
)
if
(
$
{
id
}
loc
!=-
1
)
...
...
This diff is collapsed.
Click to expand it.
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