Skip to content

Commit

Permalink
- Code Assessment Docs
Browse files Browse the repository at this point in the history
- Github Pages integration of the code assessment
  • Loading branch information
RhythmAgg committed Mar 30, 2024
1 parent a6fa6b2 commit 001a73f
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
Binary file modified .DS_Store
Binary file not shown.
7 changes: 5 additions & 2 deletions docs/content-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
12 changes: 10 additions & 2 deletions docs/exp-build-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ the filepath for any page is <base-dir-name>/<filename>.

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
Expand Down Expand Up @@ -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": [...]
}
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions docs/plugins.org
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions docs/units.org
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pages.
| VIDEO | "video" |
| SIMULATION | "simulation" |
| ASSESMENT | "assesment" |
| COMPONENT | "component" |
|------------+-----------------------|

** BuildEnvs
Expand Down
5 changes: 2 additions & 3 deletions exp_build/plugin-config.testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
12 changes: 3 additions & 9 deletions exp_build/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 2 additions & 4 deletions exp_build/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 001a73f

Please sign in to comment.