Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const CodingQuestionNodeProperties = () => {
return (
<>
<NodeProperties
platform={['VSCode']}
platform={['CodingWebApp']}
activityDescription="In this activity learners will have to complete a coding exercise"
/>
<MarkDownField label="Question" name="data.question" />
Expand All @@ -24,8 +24,8 @@ const CodingQuestionNodeProperties = () => {
constraints={{ onChange: (event) => setLanguage(event.target.value) }}
options={
<>
<option value="csharp">csharp</option>
<option value="sysml">sysml</option>
<option value="javascript">javascript</option>
<option value="html">html</option>
</>
}
/>
Expand Down
9 changes: 9 additions & 0 deletions src/types/polyglotElements/elementMapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ElementToReactFlowComponentMapping<T> = {
};
type ElementToNameMapping = { [elementType: string]: string };
type ElementToIconMapping = { [elementType: string]: string | undefined };
type ElementToPlatformMapping = { [elementType: string]: string | undefined };
type ElementToGroupMapping = { [elementType: string]: string | undefined };
type ElementToDefaultDataMapping<T> = { [elementType: string]: T };
type ElementToTransformDataMapping<T> = {
Expand All @@ -33,6 +34,7 @@ type MappingType<T, U, K extends TypeWithData, V extends TypeWithData> = {
name: string;
icon?: string;
group?: string;
platform?: string;
propertiesComponent: PropertiesComponent<T>;
elementComponent: ReactFlowComponent<U>;
defaultData: K['data'] & V['data'];
Expand All @@ -44,6 +46,7 @@ class PolyglotComponentMapping<T, U, K extends TypeWithData> {
private _elementMapping: ElementToReactFlowComponentMapping<U> = {};
private _nameMapping: ElementToNameMapping = {};
private _iconMapping: ElementToIconMapping = {};
private _defaulPlatformMapping: ElementToPlatformMapping = {};
private _groupMapping: ElementToGroupMapping = {};
private _defaultDataMapping: ElementToDefaultDataMapping<K['data']> = {};
private _transformMapping: ElementToTransformDataMapping<K> = {};
Expand All @@ -55,6 +58,7 @@ class PolyglotComponentMapping<T, U, K extends TypeWithData> {
name,
icon,
group,
platform,
propertiesComponent,
elementComponent,
defaultData,
Expand All @@ -69,6 +73,7 @@ class PolyglotComponentMapping<T, U, K extends TypeWithData> {
this._elementMapping[elementType] = elementComponent;
this._nameMapping[elementType] = name;
this._iconMapping[elementType] = icon;
this._defaulPlatformMapping[elementType] = platform;
this._groupMapping[elementType] = group;
this._defaultDataMapping[elementType] = defaultData;
this._transformMapping[elementType] = transformData;
Expand All @@ -90,6 +95,10 @@ class PolyglotComponentMapping<T, U, K extends TypeWithData> {
return this._iconMapping;
}

get defaultPlatformMapping(): Readonly<ElementToPlatformMapping> {
return this._defaulPlatformMapping;
}

get groupMapping(): Readonly<ElementToGroupMapping> {
return this._groupMapping;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ polyglotNodeComponentMapping.registerMapping<AnalyzingPlottingDataNode>({
name: 'Analyzing-Plotting Data',
icon: icon.src,
group: 'apply_assessment',
platform: 'WebApp',
propertiesComponent: AnalyzingPlottingDataNodeProperties,
elementComponent: ReactFlowAnalyzingPlottingDataNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/BrainstormingNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ polyglotNodeComponentMapping.registerMapping<BrainstormingNode>({
name: 'Brainstorming',
icon: icon.src,
group: 'create_assessment',
platform: 'WebApp',
propertiesComponent: BrainstormingNodeProperties,
elementComponent: ReactFlowBrainstormingNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/CalculationNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ polyglotNodeComponentMapping.registerMapping<CalculationNode>({
name: 'Calculation',
icon: icon.src,
group: 'apply_assessment',
platform: 'WebApp',
propertiesComponent: CalculationNodeProperties,
elementComponent: ReactFlowCalculationNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/CasesEvaluationNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ polyglotNodeComponentMapping.registerMapping<CasesEvaluationNode>({
name: 'Cases Evaluation',
icon: icon.src,
group: 'understand_assessment',
platform: 'WebApp',
propertiesComponent: CasesEvaluationNodeProperties,
elementComponent: ReactFlowCasesEvaluationNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/CloseEndedQuestionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ polyglotNodeComponentMapping.registerMapping<CloseEndedQuestionNode>({
name: 'Close Ended Question',
icon: icon.src,
group: 'remember_assessment',
platform: 'WebApp',
propertiesComponent: CloseEndedQuestionNodeProperties,
elementComponent: ReactFlowCloseEndedQuestionNode,
defaultData: {
Expand Down
3 changes: 2 additions & 1 deletion src/types/polyglotElements/nodes/CodingQuestionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ polyglotNodeComponentMapping.registerMapping<CodingQuestionNode>({
name: 'Coding Question',
icon: icon.src,
group: 'create_assessment',
platform: 'CodingWebApp',
propertiesComponent: CodingQuestionNodeProperties,
elementComponent: ReactFlowCodingQuestionNode,
defaultData: {
Expand All @@ -30,7 +31,7 @@ int main() {
Console.WriteLine("Hello World!");
return 0;
}`,
language: 'csharp',
language: 'javascript',
...defaultPolyglotNodeData,
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ polyglotNodeComponentMapping.registerMapping<CollaborativeModelingNode>({
name: 'Collaborative Modeling',
icon: icon.src,
group: 'understand_assessment',
platform: 'WebApp',
propertiesComponent: CollaborativeModelingNodeProperties,
elementComponent: ReactFlowCollaborativeModelingNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/CreateKeywordsListNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ polyglotNodeComponentMapping.registerMapping<CreateKeywordsListNode>({
name: 'Create keywords list',
icon: icon.src,
group: 'remember_learning',
platform: 'WebApp',
propertiesComponent: CreateKeywordsListNodeProperties,
elementComponent: ReactFlowCreateKeywordsListNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/FindSolutionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ polyglotNodeComponentMapping.registerMapping<FindSolutionNode>({
name: 'Find Solution',
icon: icon.src,
group: 'create_learning',
platform: 'WebApp',
propertiesComponent: FindSolutionNodeProperties,
elementComponent: ReactFlowFindSolutionNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/FlowChartNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ polyglotNodeComponentMapping.registerMapping<FlowChartNode>({
name: 'Flow Chart',
icon: icon.src,
group: 'understand_assessment',
platform: 'WebApp',
propertiesComponent: FlowChartNodeProperties,
elementComponent: ReactFlowFlowChartNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/ImageEvaluationNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ polyglotNodeComponentMapping.registerMapping<ImageEvaluationNode>({
name: 'Image Evaluation',
icon: icon.src,
group: 'apply_assessment',
platform: 'WebApp',
propertiesComponent: ImageEvaluationNodeProperties,
elementComponent: ReactFlowImageEvaluationNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/InnovationPitchNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ polyglotNodeComponentMapping.registerMapping<InnovationPitchNode>({
name: 'Innovation Pitch',
icon: icon.src,
group: 'create_assessment',
platform: 'WebApp',
propertiesComponent: InnovationPitchNodeProperties,
elementComponent: ReactFlowInnovationPitchNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/LessonTextNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ polyglotNodeComponentMapping.registerMapping<LessonTextNode>({
name: 'Lesson (Text)',
icon: icon.src,
group: ' ',
platform: 'WebApp',
propertiesComponent: LessonTextNodeProperties,
elementComponent: ReactFlowLessonNode,
defaultData: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ polyglotNodeComponentMapping.registerMapping<MemoriseKeywordsListNode>({
name: 'Memorise keywords list',
icon: icon.src,
group: 'remember_learning',
platform: 'WebApp',
propertiesComponent: MemoriseKeywordsListNodeProperties,
elementComponent: ReactFlowMemoriseKeywordsListNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/MindMapNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ polyglotNodeComponentMapping.registerMapping<MindMapNode>({
name: 'MindMap',
icon: icon.src,
group: 'understand_learning',
platform: 'WebApp',
propertiesComponent: MindMapNodeProperties,
elementComponent: ReactFlowMindMapNode,
defaultData: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ polyglotNodeComponentMapping.registerMapping<MultipleChoiceQuestionNode>({
name: 'Multiple Choice Question',
icon: icon.src,
group: 'remember_assessment',
platform: 'WebApp',
propertiesComponent: MultipleChoiceQuestionNodeProperties,
elementComponent: ReactFlowMultipleChoiceQuestionNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/NewTypeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ polyglotNodeComponentMapping.registerMapping<NewTypeNode>({
name: 'New Type xText',
icon: icon.src,
group: '',
platform: 'WebApp',
propertiesComponent: NewTypeNodeProperties,
elementComponent: ReactFlowNewTypeNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/OpenQuestionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ polyglotNodeComponentMapping.registerMapping<OpenQuestionNode>({
name: 'Open Question',
icon: icon.src,
group: 'remember_assessment',
platform: 'WebApp',
propertiesComponent: OpenQuestionNodeProperties,
elementComponent: ReactFlowOpenQuestionNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/ProblemSolvingNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ polyglotNodeComponentMapping.registerMapping<ProblemSolvingNode>({
name: 'Problem Solving',
icon: icon.src,
group: 'apply_learning',
platform: 'WebApp',
propertiesComponent: ProblemSolvingNodeProperties,
elementComponent: ReactFlowProblemSolvingNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/PromptEngineeringNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ polyglotNodeComponentMapping.registerMapping<PromptEngineeringNode>({
name: 'Prompt Engineering',
icon: icon.src,
group: 'apply_learning',
platform: 'WebApp',
propertiesComponent: PromptEngineeringNodeProperties,
elementComponent: ReactFlowPromptEngineeringNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/ReadMaterialNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ polyglotNodeComponentMapping.registerMapping<ReadMaterialNode>({
name: 'Read material',
icon: icon.src,
group: 'remember_learning',
platform: 'WebApp',
propertiesComponent: ReadMaterialNodeProperties,
elementComponent: ReactFlowReadMaterialNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/ScanningNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ polyglotNodeComponentMapping.registerMapping<ScanningNode>({
name: 'AR Scan',
icon: icon.src,
group: 'understand_learning',
platform: 'MuNDAR',
propertiesComponent: ScanningNodeProperties,
elementComponent: ReactFlowScanningNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/SimulationNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ polyglotNodeComponentMapping.registerMapping<SimulationNode>({
name: 'Simulation',
icon: icon.src,
group: 'create_assessment',
platform: 'WebApp',
propertiesComponent: SimulationNodeProperties,
elementComponent: ReactFlowSimulationNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/SummaryNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ polyglotNodeComponentMapping.registerMapping<SummaryNode>({
name: 'Summary',
icon: icon.src,
group: 'understand_learning',
platform: 'WebApp',
propertiesComponent: SummaryNodeProperties,
elementComponent: ReactFlowSummaryNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/TrueFalseNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ polyglotNodeComponentMapping.registerMapping<TrueFalseNodeNode>({
name: 'True False',
icon: icon.src,
group: 'remember_assessment',
platform: 'WebApp',
propertiesComponent: TrueFalseNodeProperties,
elementComponent: ReactFlowTrueFalseNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/UMLModelingNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ polyglotNodeComponentMapping.registerMapping<UMLModelingNode>({
name: 'UML Modeling',
icon: icon.src,
group: 'understand_assessment',
platform: 'PapyrusWeb',
propertiesComponent: UMLModelingNodeProperties,
elementComponent: ReactFlowUMLModelingNode,
defaultData: {
Expand Down
1 change: 1 addition & 0 deletions src/types/polyglotElements/nodes/WatchVideoNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ polyglotNodeComponentMapping.registerMapping<WatchVideoNode>({
name: 'Watch Video',
icon: icon.src,
group: 'remember_learning',
platform: 'WebApp',
propertiesComponent: WatchVideoNodeProperties,
elementComponent: ReactFlowWatchVideoNode,
defaultData: {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const createNewDefaultPolyglotNode: (
title: 'New Node',
description: '',
difficulty: 1,
platform: polyglotNodeComponentMapping.defaultPlatformMapping[nodeType],
data: polyglotNodeComponentMapping.defaultDataMapping[nodeType],
reactFlow: {
id: id,
Expand All @@ -101,6 +102,7 @@ const configUnconditionalEdge = [
'MemoriseKeywordsListNode',
'PromptEngineeringNode',
'ProblemSolvingNode',
'CodingQuestionNode',
];

export const createNewDefaultPolyglotEdge = (
Expand Down
Loading