openct-tasks/_common/modules/ext/codecast
Haifeng Luo a2feebe153 Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00
..
components Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00
source-components-es6 Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00
README.md Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00
analysis.js Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00
codecast.css Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00
loader.js Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00

README.md

Skulpt Analysis module for python tasks

Add the skulpt analysis to a task

In task/index.html, load the python_analysis module that is available from importModules 1.5 :

  importModules([
    ...'python-analysis'...
  ]);

Note : The module will be loaded only if the python language is selected.

In task/task.js, the "variables" whole category must be selected :

  ...
  subTask.gridInfos = {
    ...
    includeBlocks: {
      ...
      standardBlocks: {
        ...
        wholeCategories: [..."variables"...],
      }
      ...
    }
    ...
  }
  ...

The components are written using javascript ES6 and compiled using babel, their source code are within the source-components-es6 directory.

If you need to make any modifications to the components, modify the ES6 files, then from the <MODULES_DIR>/ext/codecast, which is the directory you are reading this file, run the following commands :

Install the babel tools and the required plugins :

npm install --save-dev @babel/core @babel/cli @babel/preset-react

Then, generate the files :

npx babel source-components-es6 --out-dir components --presets @babel/env,@babel/preset-react --plugins @babel/plugin-proposal-class-properties