From f39e58962508bf47313dee576cd39bb6b4a498a0 Mon Sep 17 00:00:00 2001 From: ichuang Date: Wed, 15 Aug 2012 21:57:33 -0400 Subject: [PATCH 1/2] do replace_urls within capa_module get_answer (eg for img in s) --- common/lib/xmodule/xmodule/capa_module.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index 46e02542c8..e27126c549 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -376,14 +376,17 @@ class CapaModule(XModule): ''' For the "show answer" button. - TODO: show answer events should be logged here, not just in the problem.js - Returns the answers: {'answers' : answers} ''' + event_info = dict() + event_info['problem_id'] = self.location.url() + self.system.track_function('show_answer', event_info) if not self.answer_available(): raise NotFoundError('Answer is not available') else: answers = self.lcp.get_question_answers() + # answers (eg ) may have embedded images + answers = dict( (k,self.system.replace_urls(answers[k], self.metadata['data_dir'])) for k in answers ) return {'answers': answers} # Figure out if we should move these to capa_problem? From 033211a5d18e226a2a3e9754438f186b55f59bde Mon Sep 17 00:00:00 2001 From: ichuang Date: Wed, 15 Aug 2012 22:03:00 -0400 Subject: [PATCH 2/2] doc update - LMS migrate reload --- doc/development.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/development.md b/doc/development.md index 590a935405..cb71278c40 100644 --- a/doc/development.md +++ b/doc/development.md @@ -66,3 +66,9 @@ To run a single nose test: Very handy: if you uncomment the `--pdb` argument in `NOSE_ARGS` in `lms/envs/test.py`, it will drop you into pdb on error. This lets you go up and down the stack and see what the values of the variables are. Check out http://docs.python.org/library/pdb.html + +## Content development + +If you change course content, while running the LMS in dev mode, it is unnecessary to restart to refresh the modulestore. + +Instead, hit /migrate/modules to see a list of all modules loaded, and click on links (eg /migrate/reload/edx4edx) to reload a course.