Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
943e08e2
Commit
943e08e2
authored
Mar 04, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `local_resource_url()` to load js and css
parent
335ee78e
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
24 additions
and
18 deletions
+24
-18
mentoring/answer.py
+5
-4
mentoring/dataexport.py
+3
-3
mentoring/mentoring.py
+5
-5
mentoring/public/css/answer.css
+0
-0
mentoring/public/css/answer_table.css
+0
-0
mentoring/public/css/dataexport.css
+0
-0
mentoring/public/css/mentoring-table.css
+0
-0
mentoring/public/css/mentoring.css
+0
-0
mentoring/public/css/quizz.css
+0
-0
mentoring/public/js/answer.js
+0
-0
mentoring/public/js/dataexport.js
+0
-0
mentoring/public/js/mentoring-table.js
+0
-0
mentoring/public/js/mentoring.js
+0
-0
mentoring/public/js/quizz.js
+0
-0
mentoring/public/js/vendor/jquery.shorten.js
+0
-0
mentoring/public/js/vendor/underscore-min.js
+0
-0
mentoring/quizz.py
+5
-3
mentoring/table.py
+6
-3
No files found.
mentoring/answer.py
View file @
943e08e2
...
...
@@ -31,7 +31,7 @@ from xblock.fragment import Fragment
from
.light_children
import
LightChild
,
Boolean
,
Scope
,
String
from
.models
import
Answer
from
.utils
import
load_resource
,
render_template
from
.utils
import
render_template
# Globals ###########################################################
...
...
@@ -81,8 +81,9 @@ class AnswerBlock(LightChild):
})
fragment
=
Fragment
(
html
)
fragment
.
add_css
(
load_resource
(
'static/css/answer.css'
))
fragment
.
add_javascript
(
load_resource
(
'static/js/answer.js'
))
fragment
.
add_css_url
(
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/css/answer.css'
))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/js/answer.js'
))
fragment
.
initialize_js
(
'AnswerBlock'
)
return
fragment
...
...
@@ -91,7 +92,7 @@ class AnswerBlock(LightChild):
'self'
:
self
,
})
fragment
=
Fragment
(
html
)
fragment
.
add_css
(
load_resource
(
'stat
ic/css/answer_table.css'
))
fragment
.
add_css
_url
(
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'publ
ic/css/answer_table.css'
))
return
fragment
def
submit
(
self
,
submission
):
...
...
mentoring/dataexport.py
View file @
943e08e2
...
...
@@ -31,7 +31,7 @@ from xblock.core import XBlock
from
xblock.fragment
import
Fragment
from
.models
import
Answer
from
.utils
import
l
oad_resource
,
l
ist2csv
,
render_template
from
.utils
import
list2csv
,
render_template
# Globals ###########################################################
...
...
@@ -52,8 +52,8 @@ class MentoringDataExportBlock(XBlock):
})
fragment
=
Fragment
(
html
)
fragment
.
add_javascript
(
load_resource
(
'stat
ic/js/dataexport.js'
))
fragment
.
add_css
(
load_resource
(
'stat
ic/css/dataexport.css'
))
fragment
.
add_javascript
_url
(
self
.
runtime
.
local_resource_url
(
self
,
'publ
ic/js/dataexport.js'
))
fragment
.
add_css
_url
(
self
.
runtime
.
local_resource_url
(
self
,
'publ
ic/css/dataexport.css'
))
fragment
.
initialize_js
(
'MentoringDataExportBlock'
)
...
...
mentoring/mentoring.py
View file @
943e08e2
...
...
@@ -70,17 +70,17 @@ class MentoringBlock(XBlockWithLightChildren):
fragment
,
named_children
=
self
.
get_children_fragment
(
context
,
view_name
=
'mentoring_view'
,
not_instance_of
=
MentoringMessageBlock
)
correct_icon_url
=
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/img/correct-icon.png'
)
correct_icon_url
=
self
.
runtime
.
local_resource_url
(
self
,
'public/img/correct-icon.png'
)
fragment
.
add_content
(
render_template
(
'templates/html/mentoring.html'
,
{
'self'
:
self
,
'named_children'
:
named_children
,
'missing_dependency_url'
:
self
.
has_missing_dependency
and
self
.
next_step_url
,
}))
fragment
.
add_css
(
load_resource
(
'static/css/mentoring.css'
))
fragment
.
add_javascript
(
load_resource
(
'static/js/vendor/underscore-min.js'
))
fragment
.
add_javascript
(
load_resource
(
'static/js/mentoring.js'
))
fragment
.
add_css_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/css/mentoring.css'
))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/js/vendor/underscore-min.js'
))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/js/mentoring.js'
))
fragment
.
add_resource
(
load_resource
(
'templates/html/mentoring_progress.html'
)
.
format
(
completed
=
correct_icon_url
),
"text/html"
)
...
...
mentoring/
stat
ic/css/answer.css
→
mentoring/
publ
ic/css/answer.css
View file @
943e08e2
File moved
mentoring/
stat
ic/css/answer_table.css
→
mentoring/
publ
ic/css/answer_table.css
View file @
943e08e2
File moved
mentoring/
stat
ic/css/dataexport.css
→
mentoring/
publ
ic/css/dataexport.css
View file @
943e08e2
File moved
mentoring/
stat
ic/css/mentoring-table.css
→
mentoring/
publ
ic/css/mentoring-table.css
View file @
943e08e2
File moved
mentoring/
stat
ic/css/mentoring.css
→
mentoring/
publ
ic/css/mentoring.css
View file @
943e08e2
File moved
mentoring/
stat
ic/css/quizz.css
→
mentoring/
publ
ic/css/quizz.css
View file @
943e08e2
File moved
mentoring/
stat
ic/js/answer.js
→
mentoring/
publ
ic/js/answer.js
View file @
943e08e2
File moved
mentoring/
stat
ic/js/dataexport.js
→
mentoring/
publ
ic/js/dataexport.js
View file @
943e08e2
File moved
mentoring/
stat
ic/js/mentoring-table.js
→
mentoring/
publ
ic/js/mentoring-table.js
View file @
943e08e2
File moved
mentoring/
stat
ic/js/mentoring.js
→
mentoring/
publ
ic/js/mentoring.js
View file @
943e08e2
File moved
mentoring/
stat
ic/js/quizz.js
→
mentoring/
publ
ic/js/quizz.js
View file @
943e08e2
File moved
mentoring/
stat
ic/js/vendor/jquery.shorten.js
→
mentoring/
publ
ic/js/vendor/jquery.shorten.js
View file @
943e08e2
File moved
mentoring/
stat
ic/js/vendor/underscore-min.js
→
mentoring/
publ
ic/js/vendor/underscore-min.js
View file @
943e08e2
File moved
mentoring/quizz.py
View file @
943e08e2
...
...
@@ -28,7 +28,7 @@ import logging
from
xblock.fragment
import
Fragment
from
.light_children
import
LightChild
,
Scope
,
String
from
.utils
import
load_resource
,
render_template
from
.utils
import
render_template
# Globals ###########################################################
...
...
@@ -91,8 +91,10 @@ class QuizzBlock(LightChild):
})
fragment
=
Fragment
(
html
)
fragment
.
add_css
(
load_resource
(
'static/css/quizz.css'
))
fragment
.
add_javascript
(
load_resource
(
'static/js/quizz.js'
))
fragment
.
add_css_url
(
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/css/quizz.css'
))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/js/quizz.js'
))
fragment
.
initialize_js
(
'QuizzBlock'
)
return
fragment
...
...
mentoring/table.py
View file @
943e08e2
...
...
@@ -73,9 +73,12 @@ class MentoringTableBlock(LightChild):
'bg_image_url'
:
bg_image_url
,
'bg_image_description'
:
bg_image_description
,
}))
fragment
.
add_css
(
load_resource
(
'static/css/mentoring-table.css'
))
fragment
.
add_javascript
(
load_resource
(
'static/js/vendor/jquery.shorten.js'
))
fragment
.
add_javascript
(
load_resource
(
'static/js/mentoring-table.js'
))
fragment
.
add_css_url
(
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/css/mentoring-table.css'
))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/js/vendor/jquery.shorten.js'
))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
.
xblock_container
,
'public/js/mentoring-table.js'
))
fragment
.
initialize_js
(
'MentoringTableBlock'
)
return
fragment
...
...
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