diff --git a/.DS_Store b/.DS_Store index cbd3fbb8..39568b5a 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/docs/content-validation.md b/docs/content-validation.md index 89892650..eb395c75 100644 --- a/docs/content-validation.md +++ b/docs/content-validation.md @@ -15,9 +15,12 @@ There is a need for a tool that can validate the code and content of the experim This will ensure consistency in the code, will point out bugs and will raise warnings when the coding standards are not followed. 2. Validate Experiment Descriptor The experiment descriptor is the primary file that contains information on how the build directory is going to be created, thus validating it is of high importance. -3. Validating Assessment Files +3. Validate code-assessment.json +The `code-assessment.json` file contains the Code assessment problems along with their inputs and +expected outputs. The component needs the json to be in prescribed format for the data to be parsed. Thus validating it becomes significant. +4. Validating Assessment Files In an experiment, a developer wants to create quizzes. Virtual labs have a standard template for rendering quizzes, thus a developer needs to write a JSON file which will be converted to a quiz. These JSON files are validated via this tool -4. Checking for HTTP links +5. Checking for HTTP links These tools check whether the build directory contains any HTTP links or not. The HTTP links bring security concerns and hosting issues. diff --git a/docs/exp-build-process.md b/docs/exp-build-process.md index 258a7cf2..276edda6 100644 --- a/docs/exp-build-process.md +++ b/docs/exp-build-process.md @@ -180,7 +180,8 @@ the filepath for any page is /. The experiment descriptor is a json document that provides information about all the learning units and tasks in an experiment, that is -required to build an experiment. +required to build an experiment as well as configurations for components like +code assessment. The =experiment-descriptor.json= needs to be provided by the experiment authors in the root of the experiment repository. If it is @@ -223,6 +224,11 @@ A Learning Unit object describes a learning unit. For example: "unit-type": "lu", "label": "Bubble Sort", "basedir": "bubble-sort", + "code-assessment": { + "include": false, + "languages": ["javascript"], + "position": 5 + }, "units": [...] } @@ -240,7 +246,9 @@ Some additional fields: All the tasks and units use this directory as root and relative paths are computed accordingly. -- LaTeXinMD :: This feild gives LaTeX support into the markdown using KaTeX integration. The feature is controlled by a flag which needs to put on the experiment descriptor. +- LaTeXinMD :: This feild gives LaTeX support into the markdown using KaTeX integration. The feature is controlled by a flag which needs to put on the experiment descriptor. + +- code-assessment :: Configuration for the code-assessment component. It includes options like languages to choose from, position/index in the List of all Units. - units :: This is a list of units (Tasks and LUs) that are contained within this learning unit. diff --git a/docs/plugins.org b/docs/plugins.org index 24d73ed1..12641370 100644 --- a/docs/plugins.org +++ b/docs/plugins.org @@ -47,6 +47,7 @@ following features can be separated as plugins. - Feedback - Discussion Forum - Ratings +- Component Units like code assessment *** Analytics Analytics feature tracks the usage of lab and experiment webpages. diff --git a/docs/units.org b/docs/units.org index abc9954a..4550f761 100644 --- a/docs/units.org +++ b/docs/units.org @@ -44,6 +44,7 @@ pages. | VIDEO | "video" | | SIMULATION | "simulation" | | ASSESMENT | "assesment" | +| COMPONENT | "component" | |------------+-----------------------| ** BuildEnvs diff --git a/exp_build/plugin-config.testing.js b/exp_build/plugin-config.testing.js index bcd4fa22..7ab59e5f 100644 --- a/exp_build/plugin-config.testing.js +++ b/exp_build/plugin-config.testing.js @@ -62,12 +62,11 @@ const config = [ { id: "VLABS-code-editor", div_id: "code-editor", - repo: "https://github.com/RhythmAgg/VLABS-code-editor", js_modules: [ - "./js/codeditor.js" + "https://virtual-labs.github.io/comp-code-editor/js/codeditor.js" ], css_modules: [ - "./css/codeditor.css" + "https://virtual-labs.github.io/comp-code-editor/css/codeditor.css" ], label: "Code Assessment", }, diff --git a/exp_build/plugin.js b/exp_build/plugin.js index d2e1a64a..080ca368 100644 --- a/exp_build/plugin.js +++ b/exp_build/plugin.js @@ -110,15 +110,9 @@ class Plugin { static loadCodeAssessment(options) { const pluginConfigFile = Plugin.getConfigFileName(options.env); - const codeditor = require(pluginConfigFile).find(plugin => plugin.label == "Code Assessment") - - if (!fs.existsSync("plugins")) { - shell.exec("mkdir plugins"); - } - shell.cd("plugins"); - prepareRepo(codeditor); - shell.cd(".."); - return [codeditor.id, codeditor.div_id, codeditor.js_modules, codeditor.css_modules] + const code_assessment = require(pluginConfigFile).find(plugin => plugin.label == "Code Assessment") + + return [code_assessment.id, code_assessment.div_id, code_assessment.js_modules, code_assessment.css_modules] } static processExpScopePlugins(exp_info, hb, lab_data, options) { diff --git a/exp_build/task.js b/exp_build/task.js index d999e1b1..19eb1000 100644 --- a/exp_build/task.js +++ b/exp_build/task.js @@ -289,13 +289,11 @@ class Task extends Unit { let css_module = []; let js_module = []; exp_info.codeassessment_js_modules.forEach(jsmodule => { - js_module.push(path.join(`plugins/${exp_info.codeditor_id}`,`${jsmodule}`)) + js_module.push(jsmodule) }) exp_info.codeassessment_css_modules.forEach(cssmodule => { - css_module.push(path.join(`plugins/${exp_info.codeditor_id}`,`${cssmodule}`)) + css_module.push(cssmodule) }) - // const css_modules = [path.join(`plugins/${exp_info.codeditor_id}`,`${js_module}`)]; - // const js_modules = [`plugins/${exp_info.codeditor_id}/js/codeditor.js`]; page_data.js_modules = this.finalPath(js_module); page_data.css_modules = this.finalPath(css_module); page_data.codeditor_div_id = exp_info.codeditor_div_id;