Commit e83b10f5 by Xavier Antoviaque

Load scenarios from course content dynamically from separate repository

Also avoid having to explicitly list and order each individual XML file
parent a86a810a
[submodule "templates/xml"]
path = templates/xml
url = git@github.com:antoviaque/itc-course-content.git
...@@ -71,13 +71,3 @@ class MentoringDataExportBlock(XBlock): ...@@ -71,13 +71,3 @@ class MentoringDataExportBlock(XBlock):
cur_col += 1 cur_col += 1
if row: if row:
yield list2csv(row) yield list2csv(row)
@staticmethod
def workbench_scenarios():
"""
Sample scenarios which will be displayed in the workbench
"""
return [
("900) Intructors data export",
load_resource('templates/xml/999_dataexport.xml')),
]
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Imports ########################################################### # Imports ###########################################################
import logging import logging
import os
from xblock.core import XBlock from xblock.core import XBlock
from xblock.fields import Boolean, Scope, String from xblock.fields import Boolean, Scope, String
...@@ -101,47 +102,18 @@ class MentoringBlock(XBlock, XBlockWithChildrenFragmentsMixin): ...@@ -101,47 +102,18 @@ class MentoringBlock(XBlock, XBlockWithChildrenFragmentsMixin):
@staticmethod @staticmethod
def workbench_scenarios(): def workbench_scenarios():
""" """
Sample scenarios which will be displayed in the workbench Scenarios displayed by the workbench. Load them from external (private) repository
""" """
return [ templates_path = 'templates/xml'
("001) Pre-goal brainstom", base_fullpath = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
load_resource('templates/xml/001_pre_goal_brainstorm.xml')), templates_fullpath = os.path.join(base_fullpath, templates_path)
("002) Getting feedback",
load_resource('templates/xml/002_getting_feedback.xml')), scenarios = []
("003) Reflecting on your feedback", for template in os.listdir(templates_fullpath):
load_resource('templates/xml/003_reflecting_on_feedback.xml')), if not template.endswith('.xml'):
("004) Deciding on your improvement goal", continue
load_resource('templates/xml/004_deciding_on_your_improvement_goal.xml')), title = template[:-4].replace('_', ' ').title()
("005) Checking your improvement goal", template_path = os.path.join(templates_path, template)
load_resource('templates/xml/005_checking_your_improvement_goal.xml')), scenarios.append((title, load_resource(template_path)))
("006) Past attempts at change",
load_resource('templates/xml/006_past_attempts_at_change.xml')), return scenarios
("007) Doing / not doing instead",
load_resource('templates/xml/007_doing_not_doing_instead.xml')),
("008) Checking your doing / not doing instead",
load_resource('templates/xml/008_checking_your_doing_not_doing_instead.xml')),
("009) Worry box",
load_resource('templates/xml/009_worry_box.xml')),
("010) Hidden commitments",
load_resource('templates/xml/010_hidden_commitments.xml')),
("011) Checking your hidden commitments",
load_resource('templates/xml/011_checking_your_hidden_commitments.xml')),
("012) Your immune system",
load_resource('templates/xml/012_your_immune_system.xml')),
("013) Checking the map",
load_resource('templates/xml/013_checking_the_map.xml')),
("014) Big assumptions",
load_resource('templates/xml/014_big_assumptions.xml')),
("015) Checking your big assumptions",
load_resource('templates/xml/015_checking_your_big_assumptions.xml')),
("016) Revising your entire map",
load_resource('templates/xml/016_revising_your_entire_map.xml')),
("017) Checking the entire map",
load_resource('templates/xml/017_checking_the_entire_map.xml')),
("700) Change diary - Map",
load_resource('templates/xml/700_change_diary_map.xml')),
("701) Change diary - Other fields",
load_resource('templates/xml/701_change_diary_other_fields.xml')),
("800) Help on revising immunity to change maps",
load_resource('templates/xml/800_help_on_revising_immunity_to_change_maps.xml')),
]
Subproject commit 5f6d1695066626e7ac52d6899f28599765134779
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment