def register_module(): """Registers this module for use.""" def on_module_disable(): tags.Registry.remove_tag_binding(MathTag.binding_name) def on_module_enable(): tags.Registry.add_tag_binding(MathTag.binding_name, MathTag) global_routes = [ (RESOURCES_URI + '/.*', tags.ResourcesHandler), (MATHJAX_URI + '/(fonts/.*)', sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'mathjax-fonts-2.3.0.zip'))), (MATHJAX_URI + '/(.*)', sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'mathjax-2.3.0.zip')))] namespaced_routes = [] global custom_module custom_module = custom_modules.Module( 'Mathematical Formula Display', 'Provides a custom tag to embed mathematical formulas using TeX or MML.' , global_routes, namespaced_routes, notify_module_disabled=on_module_disable, notify_module_enabled=on_module_enable) return custom_module
def register_module(): """Registers this module in the registry.""" yui_handlers = [('/static/inputex-3.1.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))), ('/static/yui_3.6.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'))), ('/static/2in3/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip')))] codemirror_handler = [('/static/codemirror/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/codemirror-4.5.0.zip')))] if appengine_config.BUNDLE_LIB_FILES: yui_handlers += [('/static/combo/inputex', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'), '/static/inputex-3.1.0/')), ('/static/combo/yui', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'), '/yui/')), ('/static/combo/2in3', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip'), '/static/2in3/'))] namespaced_routes = [('/oeditorpopup', PopupHandler), ('/oeditor/preview', PreviewHandler), ('/oeditor/rest/editor_prefs', EditorPrefsRestHandler) ] global_routes = yui_handlers + codemirror_handler + [ ('/modules/oeditor/buttonbar.css', ButtonbarCssHandler), (RESOURCES_URI + '/.*', tags.ResourcesHandler) ] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Object Editor', 'A visual editor for editing various types of objects.', global_routes, namespaced_routes) return custom_module
def register_module(): """Registers this module in the registry.""" from controllers import sites yui_handlers = [('/static/inputex-3.1.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))), ('/static/yui_3.6.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'))), ('/static/2in3/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip')))] codemirror_handler = [('/static/codemirror/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/codemirror-4.5.0.zip')))] if appengine_config.BUNDLE_LIB_FILES: yui_handlers += [('/static/combo/inputex', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'), '/static/inputex-3.1.0/')), ('/static/combo/yui', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'), '/yui/')), ('/static/combo/2in3', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip'), '/static/2in3/'))] oeditor_handlers = [('/oeditorpopup', PopupHandler)] global_routes = yui_handlers + codemirror_handler + [(os.path.join( RESOURCES_PATH, '.*'), tags.ResourcesHandler)] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Object Editor', 'A visual editor for editing various types of objects.', global_routes, oeditor_handlers) return custom_module
def register_module(): """Registers this module in the registry.""" yui_handlers = [ ('/static/inputex-3.1.0/(.*)', sites.make_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))), ('/static/yui_3.6.0/(.*)', sites.make_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'))), ('/static/2in3/(.*)', sites.make_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip')))] codemirror_handler = [ ('/static/codemirror/(.*)', sites.make_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/codemirror-4.5.0.zip')))] if appengine_config.BUNDLE_LIB_FILES: yui_handlers += [ ('/static/combo/inputex', sites.make_css_combo_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'), '/static/inputex-3.1.0/')), ('/static/combo/yui', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'), '/yui/')), ('/static/combo/2in3', sites.make_css_combo_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip'), '/static/2in3/'))] namespaced_routes = [ ('/oeditorpopup', PopupHandler), ('/oeditor/preview', PreviewHandler), ('/oeditor/rest/editor_prefs', EditorPrefsRestHandler)] global_routes = yui_handlers + codemirror_handler + [ ('/modules/oeditor/buttonbar.css', ButtonbarCssHandler), (RESOURCES_URI +'/.*', tags.ResourcesHandler)] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Object Editor', 'A visual editor for editing various types of objects.', global_routes, namespaced_routes) return custom_module
def register_module(): """Registers this module for use.""" def on_module_enable(): tags.Registry.add_tag_binding(CodeTag.binding_name, CodeTag) def on_module_disable(): tags.Registry.remove_tag_binding(CodeTag.binding_name) global_routes = [(CODETAGS_RESOURCES_URI + '/.*', tags.ResourcesHandler), (CODEMIRROR_URI + '/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/codemirror-4.5.0.zip')))] namespaced_routes = [] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Code Editor and Code Example Display', 'Allow teacher to use a proper code editor and' 'allow student to see a proper piece of code', global_routes, namespaced_routes, notify_module_enabled=on_module_enable, notify_module_disabled=on_module_disable) return custom_module
def register_module(): """Registers this module in the registry.""" def on_module_enabled(): roles.Roles.register_permissions(custom_module, DashboardHandler.permissions_callback) ApplicationHandler.RIGHT_LINKS.append( DashboardHandler.generate_dashboard_link) DashboardHandler.add_nav_mapping('roles', 'Roles') DashboardHandler.add_nav_mapping('settings', 'Settings') DashboardHandler.add_custom_get_action('settings') global_routes = [ (dashboard_utils.RESOURCES_PATH + '/material-design-icons/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib', 'material-design-iconic-font-1.1.1.zip'))), (dashboard_utils.RESOURCES_PATH + '/js/.*', tags.JQueryHandler), (dashboard_utils.RESOURCES_PATH + '/.*', tags.ResourcesHandler) ] dashboard_handlers = [ ('/dashboard', DashboardHandler), ] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Course Dashboard', 'A set of pages for managing Course Builder course.', global_routes, dashboard_handlers, notify_module_enabled=on_module_enabled) return custom_module
def register_module(): """Registers this module in the registry.""" underscore_js_handler = sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib', 'underscore-1.7.0.zip')) global_routes = [ (os.path.join(RESOURCES_PATH, 'css', '.*'), tags.ResourcesHandler), (os.path.join(RESOURCES_PATH, 'js', '.*'), tags.JQueryHandler), ('/static/underscore-1.7.0/(underscore.js)', underscore_js_handler), ('/static/underscore-1.7.0/(underscore.min.js)', underscore_js_handler) ] namespaced_routes = [(SkillListRestHandler.URL, SkillListRestHandler), (SkillRestHandler.URL, SkillRestHandler), (SkillMapHandler.URL, SkillMapHandler)] global skill_mapping_module # pylint: disable=global-statement skill_mapping_module = custom_modules.Module( 'Skill Mapping Module', 'Provide skill mapping of course content', global_routes, namespaced_routes, notify_module_enabled=notify_module_enabled) return skill_mapping_module
def register_module(): """Registers this module in the registry.""" def notify_module_enabled(): courses.Course.OPTIONS_SCHEMA_PROVIDERS[ GUIDE_SETTINGS_SCHEMA_SECTION] += get_schema_fields() settings.CourseSettingsHandler.register_settings_section( GUIDE_SETTINGS_SCHEMA_SECTION, title='Guides') # we now register ZIP handler; here is a test URL: # /modules/guide/resources/polymer/bower_components/bower.json polymer_js_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'polymer-guide-1.2.0.zip')) global_routes = [ ('/modules/guide/resources' + '/polymer/(.*)', polymer_js_handler), ('/modules/guides', GuideApplicationHandler),] namespaced_routes = [('/guide', GuideUnitHandler),] global guide_module # pylint: disable=global-statement guide_module = custom_modules.Module( 'Guide, a new learning experience module.', 'An alternative to the default course explorer and course experience.', global_routes, namespaced_routes, notify_module_enabled=notify_module_enabled) return guide_module
def register_module(): """Registers this module for use.""" def on_module_enable(): tags.Registry.add_tag_binding(CodeTag.binding_name, CodeTag) def on_module_disable(): tags.Registry.remove_tag_binding(CodeTag.binding_name) global_routes = [ (CODETAGS_RESOURCES_URI + '/.*', tags.ResourcesHandler), (CODEMIRROR_URI + '/(.*)', sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib/codemirror-4.5.0.zip')))] namespaced_routes = [] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Code Editor and Code Example Display', 'Allow teacher to use a proper code editor and' 'allow student to see a proper piece of code', global_routes, namespaced_routes, notify_module_enabled=on_module_enable, notify_module_disabled=on_module_disable) return custom_module
def register_module(): """Registers this module in the registry.""" def on_module_enabled(): roles.Roles.register_permissions( custom_module, DashboardHandler.permissions_callback) ApplicationHandler.RIGHT_LINKS.append( DashboardHandler.generate_dashboard_link) DashboardHandler.add_nav_mapping('roles', 'Roles') DashboardHandler.add_nav_mapping('settings', 'Settings') DashboardHandler.add_custom_get_action('settings') global_routes = [ ( dashboard_utils.RESOURCES_PATH +'/material-design-icons/(.*)', sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'material-design-iconic-font-1.1.1.zip'))), (dashboard_utils.RESOURCES_PATH +'/js/.*', tags.JQueryHandler), (dashboard_utils.RESOURCES_PATH + '/.*', tags.ResourcesHandler)] dashboard_handlers = [ ('/dashboard', DashboardHandler), ] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Course Dashboard', 'A set of pages for managing Course Builder course.', global_routes, dashboard_handlers, notify_module_enabled=on_module_enabled) return custom_module
def register_module(): """Registers this module in the registry.""" associated_js_files_handlers = [ ('/modules/subjective/editor/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'modules/subjective_assignments/lib/ckeditor.zip'))), ] question_handlers = [(question.SubjectiveAssignmentBaseHandler.UNIT_URL, SubjectiveAssignmentHandler), (question.SubjectiveAssignmentRESTHandler.URI, question.SubjectiveAssignmentRESTHandler)] # Course Staff Custom Handlers evaluate.EvaluationHandler.add_custom_get_action( (subjective_course_staff.SubjectiveAssignmentCourseStaffBase. LIST_ACTION), (subjective_course_staff.SubjectiveAssignmentCourseStaffHandler. get_list_subjective)) evaluate.EvaluationHandler.add_custom_get_action( (subjective_course_staff.SubjectiveAssignmentCourseStaffBase. EVALUATE_ACTION), (subjective_course_staff.SubjectiveAssignmentCourseStaffHandler. get_evaluate_subjective)) evaluate.EvaluationHandler.add_custom_post_action( (subjective_course_staff.SubjectiveAssignmentCourseStaffBase. POST_SCORE_ACTION), (subjective_course_staff.SubjectiveAssignmentCourseStaffHandler. post_submit_score)) evaluate.EvaluationHandler.add_custom_post_action( (subjective_course_staff.SubjectiveAssignmentCourseStaffBase. POST_SAVE_ACTION), (subjective_course_staff.SubjectiveAssignmentCourseStaffHandler. post_save_comments)) global custom_module custom_module = custom_modules.Module( question.SubjectiveAssignmentBaseHandler.NAME, question.SubjectiveAssignmentBaseHandler.DESCRIPTION, associated_js_files_handlers, question_handlers) custom_unit = custom_units.CustomUnit( question.SubjectiveAssignmentBaseHandler.UNIT_TYPE_ID, question.SubjectiveAssignmentBaseHandler.NAME, question.SubjectiveAssignmentRESTHandler, visible_url, cleanup_helper=delete_assignement, import_helper=import_assignment, is_graded=True) # Add custom unit details to course staff course_staff.CourseStaff.add_custom_unit( question.SubjectiveAssignmentBaseHandler.UNIT_TYPE_ID, 'list') return custom_module
def register_module(): """Registers this module in the registry.""" from controllers import sites # pylint: disable-msg=g-import-not-at-top yui_handlers = [ ('/static/inputex-3.1.0/(.*)', sites.make_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))), ('/static/yui_3.6.0/(.*)', sites.make_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'))), ('/static/2in3/(.*)', sites.make_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip')))] codemirror_handler = [ ('/static/codemirror/(.*)', sites.make_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/codemirror-4.5.0.zip')))] if appengine_config.BUNDLE_LIB_FILES: yui_handlers += [ ('/static/combo/inputex', sites.make_css_combo_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'), '/static/inputex-3.1.0/')), ('/static/combo/yui', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'), '/yui/')), ('/static/combo/2in3', sites.make_css_combo_zip_handler( os.path.join( appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip'), '/static/2in3/'))] oeditor_handlers = [('/oeditorpopup', PopupHandler)] global_routes = yui_handlers + codemirror_handler + [ (os.path.join(RESOURCES_PATH, '.*'), tags.ResourcesHandler)] global custom_module custom_module = custom_modules.Module( 'Object Editor', 'A visual editor for editing various types of objects.', global_routes, oeditor_handlers) return custom_module
def register_module(): """Registers this module in the registry.""" from controllers import sites # pylint: disable-msg=g-import-not-at-top yui_handlers = [('/static/inputex-3.1.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))), ('/static/yui_3.6.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'))), ('/static/2in3/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip')))] if appengine_config.BUNDLE_LIB_FILES: yui_handlers += [('/static/combo/inputex', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'), '/static/inputex-3.1.0/')), ('/static/combo/yui', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'), '/yui/')), ('/static/combo/2in3', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip'), '/static/2in3/'))] oeditor_handlers = [('/oeditorpopup', PopupHandler)] global custom_module custom_module = custom_modules.Module( 'Object Editor', 'A visual editor for editing various types of objects.', yui_handlers, oeditor_handlers) return custom_module
def get_global_handlers(): # https://github.com/dc-js # # "Multi-Dimensional charting built to work natively with # crossfilter rendered with d3.js" dc_handler = sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib', 'dc.js-1.6.0.zip')) # https://github.com/square/crossfilter # # "Crossfilter is a JavaScript library for exploring large # multivariate datasets in the browser. Crossfilter supports # extremely fast (<30ms) interaction with coordinated views, even # with datasets containing a million or more records; we built it # to power analytics for Square Register, allowing merchants to # slice and dice their payment history fluidly." crossfilter_handler = sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib', 'crossfilter-1.3.7.zip')) # http://d3js.org/ # # "D3.js is a JavaScript library for manipulating documents based # on data. D3 helps you bring data to life using HTML, SVG and # CSS. D3's emphasis on web standards gives you the full # capabilities of modern browsers without tying yourself to a # proprietary framework, combining powerful visualization # components and a data-driven approach to DOM manipulation." d3_handler = sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib', 'd3-3.4.3.zip')) # Restrict files served from full zip package to minimum needed return [ ('/static/crossfilter-1.3.7/(crossfilter-1.3.7/crossfilter.min.js)', crossfilter_handler), ('/static/d3-3.4.3/(d3.min.js)', d3_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.js)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.min.js)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.min.js.map)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.css)', dc_handler), ]
def get_global_handlers(): # https://github.com/dc-js # # "Multi-Dimensional charting built to work natively with # crossfilter rendered with d3.js" dc_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'dc.js-1.6.0.zip')) # https://github.com/square/crossfilter # # "Crossfilter is a JavaScript library for exploring large # multivariate datasets in the browser. Crossfilter supports # extremely fast (<30ms) interaction with coordinated views, even # with datasets containing a million or more records; we built it # to power analytics for Square Register, allowing merchants to # slice and dice their payment history fluidly." crossfilter_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'crossfilter-1.3.7.zip')) # http://d3js.org/ # # "D3.js is a JavaScript library for manipulating documents based # on data. D3 helps you bring data to life using HTML, SVG and # CSS. D3's emphasis on web standards gives you the full # capabilities of modern browsers without tying yourself to a # proprietary framework, combining powerful visualization # components and a data-driven approach to DOM manipulation." d3_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'd3-3.4.3.zip')) # Restrict files served from full zip package to minimum needed return [ ('/static/crossfilter-1.3.7/(crossfilter-1.3.7/crossfilter.min.js)', crossfilter_handler), ('/static/d3-3.4.3/(d3.min.js)', d3_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.js)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.min.js)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.min.js.map)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.css)', dc_handler), ]
def register_module(): """Registers this module in the registry.""" DashboardHandler.add_nav_mapping('edit', 'Create', placement=1000) DashboardHandler.add_nav_mapping('style', 'Style', placement=2000) DashboardHandler.add_nav_mapping('publish', 'Publish', placement=3000) DashboardHandler.add_nav_mapping('analytics', 'Manage', placement=4000) DashboardHandler.add_nav_mapping('settings', 'Settings', placement=5000) make_help_menu(DashboardHandler.root_menu_group) # pylint: disable=protected-access DashboardHandler.add_sub_nav_mapping( 'edit', 'roles', 'Roles', action='edit_roles', contents=DashboardHandler._render_roles_view, placement=8000) # pylint: enable=protected-access def on_module_enabled(): roles.Roles.register_permissions(custom_module, DashboardHandler.permissions_callback) ApplicationHandler.RIGHT_LINKS.append( DashboardHandler.generate_dashboard_link) global_routes = [ (dashboard_utils.RESOURCES_PATH + '/material-design-icons/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib', 'material-design-iconic-font-1.1.1.zip'))), (dashboard_utils.RESOURCES_PATH + '/js/.*', tags.JQueryHandler), (dashboard_utils.RESOURCES_PATH + '/.*', tags.ResourcesHandler) ] dashboard_handlers = [ ('/dashboard', DashboardHandler), ] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Course Dashboard', 'A set of pages for managing Course Builder course.', global_routes, dashboard_handlers, notify_module_enabled=on_module_enabled) return custom_module
def register_module(): """Registers this module in the registry.""" # register custom tag tags.Registry.add_tag_binding('khanex', KhanExerciseTag) # register handlers zip_handler = ('/khan-exercises', sites.make_zip_handler(ZIP_FILE)) render_handler = ('/khan-exercises/khan-exercises/indirect/', KhanExerciseRenderer) # register module global custom_module custom_module = custom_modules.Module( 'Khan Academy Exercise', 'A set of pages for delivering Khan Academy Exercises via ' 'Course Builder.', [], [render_handler, zip_handler]) return custom_module
def register_module(): """Registers this module in the registry.""" DashboardHandler.add_nav_mapping('edit', 'Create', placement=1000) DashboardHandler.add_nav_mapping('style', 'Style', placement=2000) DashboardHandler.add_nav_mapping('publish', 'Publish', placement=3000) DashboardHandler.add_nav_mapping('analytics', 'Manage', placement=4000) DashboardHandler.add_nav_mapping('settings', 'Settings', placement=5000) make_help_menu(DashboardHandler.root_menu_group) # pylint: disable=protected-access DashboardHandler.add_sub_nav_mapping( 'edit', 'roles', 'Roles', action='edit_roles', contents=DashboardHandler._render_roles_view, placement=8000) # pylint: enable=protected-access def on_module_enabled(): roles.Roles.register_permissions( custom_module, DashboardHandler.permissions_callback) ApplicationHandler.RIGHT_LINKS.append( DashboardHandler.generate_dashboard_link) global_routes = [ ( dashboard_utils.RESOURCES_PATH +'/material-design-icons/(.*)', sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'material-design-iconic-font-1.1.1.zip'))), (dashboard_utils.RESOURCES_PATH +'/js/.*', tags.JQueryHandler), (dashboard_utils.RESOURCES_PATH + '/.*', tags.ResourcesHandler)] dashboard_handlers = [ ('/dashboard', DashboardHandler), ] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Course Dashboard', 'A set of pages for managing Course Builder course.', global_routes, dashboard_handlers, notify_module_enabled=on_module_enabled) return custom_module
def register_module(): """Registers this module in the registry.""" # register custom tag tags.Registry.add_tag_binding('khanex', KhanExerciseTag) # register handlers zip_handler = ( '/khan-exercises', sites.make_zip_handler(ZIP_FILE)) render_handler = ( '/khan-exercises/khan-exercises/indirect/', KhanExerciseRenderer) # register module global custom_module custom_module = custom_modules.Module( 'Khan Academy Exercise', 'A set of pages for delivering Khan Academy Exercises via ' 'Course Builder.', [], [render_handler, zip_handler]) return custom_module
('/student/editstudent', utils.StudentEditStudentHandler), ('/student/home', utils.StudentProfileHandler), ('/student/unenroll', utils.StudentUnenrollHandler), ('/unit', lessons.UnitHandler), ########################################################################################## ################### Miriam MARCIEL's CODE STARTING POINT ################################# ######### Role: Handler of Youtube events ########################## ########################################################################################## ('/youtubeevent', lessons.YouTubeHandler) ] sites.ApplicationRequestHandler.bind(urls) inputex_handler = ('/static/inputex-3.1.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))) admin_handlers = [('/admin', admin.AdminHandler), ('/rest/config/item', config.ConfigPropertyItemRESTHandler), ('/rest/courses/item', config.CoursesItemRESTHandler)] app_handler = (r'(.*)', sites.ApplicationRequestHandler) webapp2_i18n_config = { 'translations_path': os.path.join(appengine_config.BUNDLE_ROOT, 'modules/i18n/resources/locale') } debug = not appengine_config.PRODUCTION_MODE
def register_module(): # https://github.com/dc-js # # "Multi-Dimensional charting built to work natively with # crossfilter rendered with d3.js" dc_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'dc.js-1.6.0.zip')) # https://github.com/square/crossfilter # # "Crossfilter is a JavaScript library for exploring large # multivariate datasets in the browser. Crossfilter supports # extremely fast (<30ms) interaction with coordinated views, even # with datasets containing a million or more records; we built it # to power analytics for Square Register, allowing merchants to # slice and dice their payment history fluidly." crossfilter_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'crossfilter-1.3.7.zip')) # http://d3js.org/ # # "D3.js is a JavaScript library for manipulating documents based # on data. D3 helps you bring data to life using HTML, SVG and # CSS. D3's emphasis on web standards gives you the full # capabilities of modern browsers without tying yourself to a # proprietary framework, combining powerful visualization # components and a data-driven approach to DOM manipulation." d3_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'd3-3.4.3.zip')) underscore_js_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'underscore-1.4.3.zip')) dep_graph_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'dependo-0.1.4.zip')) global_routes = [ ('/modules/core_ui/style_guide/style_guide.html', StyleGuideHandler), ('/static/codemirror/(.*)', sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib/codemirror-4.5.0.zip'))), ('/static/crossfilter-1.3.7/(crossfilter-1.3.7/crossfilter.min.js)', crossfilter_handler), ('/static/d3-3.4.3/(d3.min.js)', d3_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.js)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.min.js)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.min.js.map)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.css)', dc_handler), ('/static/material-design-icons/(.*)', sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'material-design-iconic-font-1.1.1.zip'))), ('/static/underscore-1.4.3/(underscore.min.js)', underscore_js_handler), ('/static/dependo-0.1.4/(.*)', dep_graph_handler), ] namespaced_routes = [] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Core UI', 'Shared client-side UI', global_routes, namespaced_routes) return custom_module
('/course', lessons.CourseHandler), ('/calendar', utils.CalendarHandler), ('/forum', utils.ForumHandler), ('/wiki', wiki.WikiHandler), ('/dashboard', dashboard.DashboardHandler), ('/preview', utils.PreviewHandler), ('/register', utils.RegisterHandler), ('/student/editstudent', utils.StudentEditStudentHandler), ('/student/home', utils.StudentProfileHandler), ('/student/unenroll', utils.StudentUnenrollHandler), ('/unit', lessons.UnitHandler)] sites.ApplicationRequestHandler.bind(urls) inputex_handler = ( '/static/inputex-3.1.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))) admin_handlers = [ ('/admin', admin.AdminHandler), ('/rest/config/item', config.ConfigPropertyItemRESTHandler)] app_handler = (r'(.*)', sites.ApplicationRequestHandler) webapp2_i18n_config = {'translations_path': os.path.join( appengine_config.BUNDLE_ROOT, 'modules/i18n/resources/locale')} debug = not appengine_config.PRODUCTION_MODE app = webapp2.WSGIApplication( admin_handlers + [inputex_handler] + [app_handler], config={'webapp2_extras.i18n': webapp2_i18n_config}, debug=debug)
def register_module(): """Registers this module in the registry.""" # Course Dashboard tabs.Registry.register(base.OfflineAssignmentBase.DASHBOARD_NAV, base.OfflineAssignmentBase.DASHBOARD_TAB, base.OfflineAssignmentBase.DESCRIPTION, off_ass_dashboard.OfflineAssignmentDashboardHandler) dashboard.DashboardHandler.add_custom_get_action( base.OfflineAssignmentBase.DASHBOARD_DEFAULT_ACTION, None) dashboard.DashboardHandler.add_nav_mapping( base.OfflineAssignmentBase.DASHBOARD_NAV, base.OfflineAssignmentBase.NAME, ) dashboard.DashboardHandler.add_custom_get_action( base.OfflineAssignmentBase.OFFLINE_ASSIGNMENT_DETAILS_ACTION, off_ass_dashboard.OfflineAssignmentDashboardHandler. get_assignment_scores) dashboard.DashboardHandler.add_custom_get_action( base.OfflineAssignmentBase.SCORE_OFFLINE_ASSIGNMENT_ACTION, off_ass_dashboard.OfflineAssignmentDashboardHandler.get_bulk_score) dashboard.DashboardHandler.add_custom_post_action( base.OfflineAssignmentBase.SCORE_OFFLINE_ASSIGNMENT_ACTION, off_ass_dashboard.OfflineAssignmentDashboardHandler.post_bulk_score) # Course Staff Custom Handlers evaluate.EvaluationHandler.add_custom_get_action( offline_course_staff.OfflineAssignmentsCourseStaffBase.LIST_ACTION, offline_course_staff.OfflineAssignmentsCourseStaffHandler. get_list_offline) evaluate.EvaluationHandler.add_custom_get_action( offline_course_staff.OfflineAssignmentsCourseStaffBase.EVALUATE_ACTION, offline_course_staff.OfflineAssignmentsCourseStaffHandler. get_evaluate_offline) evaluate.EvaluationHandler.add_custom_post_action( offline_course_staff.OfflineAssignmentsCourseStaffBase. POST_SCORE_ACTION, offline_course_staff. OfflineAssignmentsCourseStaffHandler.post_score_offline) associated_js_files_handlers = [ ('/modules/offline_assignments/editor/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'modules/offline_assignments/lib/ckeditor.zip'))), (settings.OfflineAssignmentRESTHandler.URI, settings.OfflineAssignmentRESTHandler) ] question_handlers = [(base.OfflineAssignmentBase.UNIT_URL, assignment.OfflineAssignmentHandler), (question.OfflineAssignmentRESTHandler.URI, question.OfflineAssignmentRESTHandler)] global custom_module custom_module = custom_modules.Module( base.OfflineAssignmentBase.NAME, base.OfflineAssignmentBase.DESCRIPTION, associated_js_files_handlers, question_handlers) custom_unit = custom_units.CustomUnit( base.OfflineAssignmentBase.UNIT_TYPE_ID, base.OfflineAssignmentBase.NAME, question.OfflineAssignmentRESTHandler, visible_url, cleanup_helper=delete_assignement, import_helper=import_assignment, is_graded=True) # Add custom unit details to course staff module course_staff.CourseStaff.add_custom_unit( base.OfflineAssignmentBase.UNIT_TYPE_ID, offline_course_staff.OfflineAssignmentsCourseStaffBase.LIST_ACTION) return custom_module
def register_module(): # https://github.com/dc-js # # "Multi-Dimensional charting built to work natively with # crossfilter rendered with d3.js" dc_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'dc.js-1.6.0.zip')) # https://github.com/square/crossfilter # # "Crossfilter is a JavaScript library for exploring large # multivariate datasets in the browser. Crossfilter supports # extremely fast (<30ms) interaction with coordinated views, even # with datasets containing a million or more records; we built it # to power analytics for Square Register, allowing merchants to # slice and dice their payment history fluidly." crossfilter_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'crossfilter-1.3.7.zip')) # http://d3js.org/ # # "D3.js is a JavaScript library for manipulating documents based # on data. D3 helps you bring data to life using HTML, SVG and # CSS. D3's emphasis on web standards gives you the full # capabilities of modern browsers without tying yourself to a # proprietary framework, combining powerful visualization # components and a data-driven approach to DOM manipulation." d3_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'd3-3.4.3.zip')) underscore_js_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'underscore-1.4.3.zip')) dep_graph_handler = sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'dependo-0.1.4.zip')) global_routes = [ ('/modules/core_ui/style_guide/style_guide.html', StyleGuideHandler), ('/static/codemirror/(.*)', sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib/codemirror-4.5.0.zip'))), ('/static/crossfilter-1.3.7/(crossfilter-1.3.7/crossfilter.min.js)', crossfilter_handler), ('/static/d3-3.4.3/(d3.min.js)', d3_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.js)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.min.js)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.min.js.map)', dc_handler), ('/static/dc.js-1.6.0/(dc.js-1.6.0/dc.css)', dc_handler), ('/static/material-design-icons/(.*)', sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'material-design-iconic-font-1.1.1.zip'))), ('/static/underscore-1.4.3/(underscore.min.js)', underscore_js_handler), ('/static/dependo-0.1.4/(.*)', dep_graph_handler), ('/static/polymer-1.2.0/(.*)', sites.make_zip_handler(os.path.join( appengine_config.BUNDLE_ROOT, 'lib', 'polymer-1.2.0.zip'))), ] namespaced_routes = [] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( 'Core UI', 'Shared client-side UI', global_routes, namespaced_routes) return custom_module
def register_module(): """Registers this module in the registry.""" data_sources.Registry.register(panalytics.ProgrammingStatsDataSource) tab_name = 'programming_assignment_stats' stats = analytics.Visualization( tab_name, base.ProgAssignment.NAME, 'templates/prog_assignment_stats.html', data_source_classes=[panalytics.ProgrammingStatsDataSource]) tabs.Registry.register('analytics', tab_name, base.ProgAssignment.NAME, [stats]) settings.ProgrammingAssignmentSettings.register() tabs.Registry.register(scoring_base.ScoringBase.DASHBOARD_NAV, base.ProgAssignment.DASHBOARD_REEVALUATION_TAB, 'Programming Assignments', pdashboard.ProgAssignmentDashboardHandler) tabs.Registry.register(base.ProgAssignment.DASHBOARD_NAV, base.ProgAssignment.DASHBOARD_TEST_RUN_TAB, 'Test Run Details', pdashboard.ProgAssignmentTestRunHandler) tabs.Registry.register(base.ProgAssignment.DASHBOARD_NAV, base.ProgAssignment.DASHBOARD_DOWNLOAD_TAB, 'Download', pdashboard.ProgAssignmentDownloadDashboardHandler) dashboard.DashboardHandler.add_custom_get_action( base.ProgAssignment.DASHBOARD_NAV, None) dashboard.DashboardHandler.add_custom_post_action( base.ProgAssignment.REEVAL_ACTION, pdashboard.ProgAssignmentDashboardHandler.confirm_reevaluation_page) dashboard.DashboardHandler.add_custom_post_action( base.ProgAssignment.REEVAL_CONFIRMED_ACTION, pdashboard.ProgAssignmentDashboardHandler.reevalaute_assignment) dashboard.DashboardHandler.add_custom_post_action( base.ProgAssignment.DOWNLOAD_ACTION, pdashboard.ProgAssignmentDownloadDashboardHandler.download_assignment) dashboard.DashboardHandler.add_custom_get_action( base.ProgAssignment.TEST_RUN_ACTION, pdashboard.ProgAssignmentTestRunHandler.get_show_results) dashboard.DashboardHandler.add_nav_mapping( base.ProgAssignment.DASHBOARD_NAV, base.ProgAssignment.NAME) associated_js_files_handlers = [ ('/static/edit_area/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/edit-area.zip'))), ('/static/prettify/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/google-code-prettify.zip'))), ('/cron/compute_programming_test_case_stats', panalytics.ComputeProgrammingStatsHandler), ('/cron/reevaluate_programming_submissions', reevaluator.ReevaulateSubmissionHandler), ('/modules/programming_assignments/assets/.*', tags.ResourcesHandler) ] prog_assignment_handlers = [(base.ProgAssignment.UNIT_URL, assignment.ProgAssignmentHandler), (question.ProgAssignmentRESTHandler.URI, question.ProgAssignmentRESTHandler)] global custom_module # pylint: disable=global-statement custom_module = custom_modules.Module( base.ProgAssignment.NAME, 'A set pages to manage programming assignments.', associated_js_files_handlers, prog_assignment_handlers) global custom_unit # pylint: disable=global-statement custom_unit = custom_units.CustomUnit( base.ProgAssignment.UNIT_TYPE_ID, base.ProgAssignment.NAME, question.ProgAssignmentRESTHandler, base.ProgAssignment.get_public_url, create_helper=question.create_assignment, cleanup_helper=base.ProgAssignment.delete_content, import_helper=question.import_assignment, is_graded=True) return custom_module
('/answer', assessments.AnswerHandler), ('/assessment', lessons.AssessmentHandler), ('/course', lessons.CourseHandler), ('/forum', utils.ForumHandler), ('/dashboard', dashboard.DashboardHandler), ('/preview', utils.PreviewHandler), ('/register', utils.RegisterHandler), ('/student/editstudent', utils.StudentEditStudentHandler), ('/student/home', utils.StudentProfileHandler), ('/student/unenroll', utils.StudentUnenrollHandler), ('/unit', lessons.UnitHandler)] sites.ApplicationRequestHandler.bind(urls) yui_handlers = [('/static/inputex-3.1.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))), ('/static/yui_3.6.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'))), ('/static/2in3/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip')))] if appengine_config.BUNDLE_LIB_FILES: yui_handlers += [('/static/combo/inputex', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'),
('/register', utils.RegisterHandler), ('/student/editstudent', utils.StudentEditStudentHandler), ('/student/home', utils.StudentProfileHandler), ('/student/unenroll', utils.StudentUnenrollHandler), ('/unit', lessons.UnitHandler), ('/homework', lessons.HomeWorkHandler), ('/playlist', lessons.PlayListHandler), ('/course_playlist', lessons.CourseNewHandler), ('/unitplaylist', lessons.PlayListUnitHandler), ('/activityplaylist', lessons.PlayListActivityHandler), ('/home', utils.HomeHandler)] sites.ApplicationRequestHandler.bind(urls) yui_handlers = [ ('/static/inputex-3.1.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))), ('/static/yui_3.6.0/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'))), ('/static/2in3/(.*)', sites.make_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip')))] if appengine_config.BUNDLE_LIB_FILES: yui_handlers += [ ('/static/combo/inputex', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'), '/static/inputex-3.1.0/')), ('/static/combo/yui', sites.make_css_combo_zip_handler( os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'), '/yui/')), ('/static/combo/2in3', sites.make_css_combo_zip_handler( os.path.join(