own blocklyWindow for an instruction
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { TUTORIAL_SUCCESS, TUTORIAL_ERROR, TUTORIAL_CHANGE, TUTORIAL_XML, TUTORIAL_ID } from './types';
|
||||
import { TUTORIAL_SUCCESS, TUTORIAL_ERROR, TUTORIAL_CHANGE, TUTORIAL_XML, TUTORIAL_ID, TUTORIAL_LEVEL } from './types';
|
||||
|
||||
export const tutorialChange = () => (dispatch) => {
|
||||
dispatch({
|
||||
@@ -19,7 +19,8 @@ export const tutorialCheck = (status) => (dispatch, getState) => {
|
||||
|
||||
export const storeTutorialXml = (code) => (dispatch, getState) => {
|
||||
var id = getState().tutorial.currentId;
|
||||
if(id !== null){
|
||||
var level = getState().tutorial.level;
|
||||
if(id !== null && level === 'assessment'){
|
||||
var tutorialsStatus = getState().tutorial.status;
|
||||
tutorialsStatus[id] = {...tutorialsStatus[id], xml: code};
|
||||
dispatch({
|
||||
@@ -29,6 +30,14 @@ export const storeTutorialXml = (code) => (dispatch, getState) => {
|
||||
}
|
||||
};
|
||||
|
||||
// level = "instruction" or "assessment"
|
||||
export const setTutorialLevel = (level) => (dispatch) => {
|
||||
dispatch({
|
||||
type: TUTORIAL_LEVEL,
|
||||
payload: level
|
||||
});
|
||||
}
|
||||
|
||||
export const tutorialId = (id) => (dispatch) => {
|
||||
dispatch({
|
||||
type: TUTORIAL_ID,
|
||||
|
||||
@@ -12,3 +12,4 @@ export const TUTORIAL_ERROR = 'TUTORIAL_ERROR';
|
||||
export const TUTORIAL_CHANGE = 'TUTORIAL_CHANGE';
|
||||
export const TUTORIAL_XML = 'TUTORIAL_XML';
|
||||
export const TUTORIAL_ID = 'TUTORIAL_ID';
|
||||
export const TUTORIAL_LEVEL = 'TUTORIAL_LEVEL';
|
||||
|
||||
Reference in New Issue
Block a user