This repository contains a PHP implementation of a way to compile PEM tasks (conforming the PEM Installation API) into separate files that can be served conditionnaly.
You have a task task.html
containing all the modules, the main task, hints, solution, etc. and, in the context of a contest, you don't want users to see the solution. You can then use
$taskCompiler = new Task($taskJson, $taskBasePath, true);
$taskCompiler-> generate($dstDir, $dstUrl);
where
$taskJson
is the json as described in the PEM Installation API documentation$taskBasePath
is the base path of the files it references$dstDir
is the directory where you want the compiled files to appear$dstUrl
is the base URL on which the files will be accessed
This will createthe following files in $dstDir
:
index.html
containing the content that should be accessed by contestants (no solution nor grading), with all js and css files compiledbebras.js
containing the json describing the tasksolution.html
containing the solutiongrader.js
containing the grader.htaccess
denying the access to all previous files
Then it's up to you serve the files according to user rights.
composer install France-IOI/pem-task-compiler
- link to the Google doc
- a simple example (the one from svn is way too convoluted)
.htaccess
generation should be optional- document all functions (not just
generate
), as used bybeaver-platform