Skip to content
Snippets Groups Projects
Commit f7b5f80b authored by Lehtinen Teemu's avatar Lehtinen Teemu
Browse files

Use let when appropriate

parent f3320812
No related branches found
No related tags found
No related merge requests found
# acos-webdev-iwdap
Content package for Acos-servers that adds web development exercises
designed for *Introduction to Web Development and Programming*.
where student experiments with web using a browser inspector tool.
## Installation
For the time being, this package requires that `acos-webdev` package has been installed manually.
This package requires that `acos-webdev` package has been installed
as a dependency.
## Testing
Tests are written with WebDriverIO, refer to the `acos-server` documentation on testing.
Tests are written with WebDriverIO, refer to the `acos-server`
documentation on testing.
/* global module, require, __dirname, console */
/* jshint globalstrict: true */
'use strict';
var nj = require('nunjucks');
var fs = require('fs');
let nj = require('nunjucks');
let fs = require('fs');
var AcosMod = function () {};
let AcosMod = function () {};
var baseDir = __dirname;
var content = JSON.parse(fs.readFileSync(baseDir + '/content.json', 'utf8'));
let baseDir = __dirname;
let content = JSON.parse(fs.readFileSync(baseDir + '/content.json', 'utf8'));
AcosMod.initialize = function (req, params, handlers, cb) {
var templateDir = baseDir + '/templates/';
let templateDir = baseDir + '/templates/';
nj.configure(templateDir, { autoescape: false });
var config = content[params.name];
let config = content[params.name];
config.abFlag = params.abFlag;
if (config.template) {
config.html = nj.render(config.template, config);
}
var templateParam = {
let templateParam = {
id: 'acos-webdev-inspector-' + params.name,
config: JSON.stringify(config),
acceptTest: config.acceptTest,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment