Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

IEditorConfig is not generalised and it contains BMGS fields

  • File - editor.ts

    • board, medium, grade Level, subject, topic present in editor.ts file as:

    • Which defines the IEditorConfig interface

      • Code Block
        export interface IEditorConfig {
            context: Context;
            config: any;
            metadata?: any;
            data?: any;
        }
        
        export interface Context {
            ...
            ...
            board?: any;
            medium?: any;
            gradeLevel?: any;
            subject?: any;
            topic?: any;
            ...
            ...
        }
  • This interface defines the editorConfig.

  • These value of board, medium, grade Level, subject, topic are getting attached as default value to question if question set does not have BMGS fields.

  • If question set contains BMGS fields and then BMGS present in editor config get replaced with selected BMGS in question set.

Solution to Generalise interface

  • Code Block
    export interface IEditorConfig {
        context: Context;
        config: any;
        metadata?: any;
        data?: any;
    }
    
    export interface Context {
        ...
        ...
        frameworkDefaultValues?: any
        ...
        ...
    }

...

Code Block
frameworkDefaultValues: {
  hospital: 'Apollo',
  department: 'Cardiology',
  ...
  ...
}

...

Place where above passed BMGS is currently getting fetched and getting added to question metadata

File - question.component.ts

...

Code Block
_.get(this.editorService.editorConfig, 'context.frameworkDefaultValues')

...

BMGS and other fields hard coding in ConfigService

File - config.service.ts

sessionContext contains hard coded fields name as 

...

We can remove BMGS fields from these files.

...

Resource Library

Question in Question bank shows BMGS and various other fields which it’s not configurable

...

Solution 1 - we can use the form config which is being used while question creation to the field code and label and display in this same above format without bringing any new UI change.

...

Pros

Solution 2-We can define a new form config in which these fields can be set as config. (Not Recommended)

  • It will add additional config to the editor.

...

Board value is getting displayed to the contents

library-player

library-list.component

...

Using this libraryConfig we can display whichever value we want to show in above page.

...

BMGS is present in SessionContext.ts file

This file is not getting used anywhere so can be removed.

...

BMGS is present in config.service.ts

It defines sessionContext but it is not getting used so can be removed.

...

We can remove BMGS fields from these files.

...

QuML Player

data.service.ts

Board,medium,grade,subject,etc present in the getContent method.

...