Skip to content

Commit 0c72764

Browse files
HektikRMarco Angererdominik-probst
authored
Update for ILIAS 9 (#2)
* Add LaTeX-gitignore * Remove question working time (unsupported since ILIAS 8) (c. f. https://docu.ilias.de/ilias.php\?baseClass\=ilwikihandlergui\&cmdNode\=16f:rp\&cmdClass\=ilobjwikigui\&cmd\=viewPage\&ref_id\=1357\&wpg_id\=7842\) * Apply upstream updates from assExampleQuestion * Ensure installability on ILIAS 8 * Remove unneeded include of jThread * Re-refactor loadFromDb to have $data accessible * ILIAS 9: No setSuggestedSolution() anymore * ILIAS 9: getAnswerTableName() is abstract * Fix: Database access on creation as in assExampleQuestion See ilifau/assExampleQuestion@1b508a3 * ILIAS 9: Fix data types * Update minfy.js to get rid of deprecation warning * Dirty hack to make JS load in time * Use current ILIAS version in docker-compose * Fix #15: addQTIMaterial * Minor: Remove unneeded daclaration * Fix #18: Dependency Injection * Fix #22: Delete unused template * Fix #21: Exception instead of return value * Fix #20: Negative return value on duplication error * Add Dockerfile and .dockerignore * Redo 818fdb50568e6241184c3699da3e981d70de2e7c of assCodeQuestion * Partial redo of b6c39d0 in assCodeQuestion * Redo 0281fe0 of assCodeQuestion * Fixes #12: Update MySQL to MariaDB * Fix some capitalizations and formatting * Fix #26 by un-overriding setQuestionTabs() * Fix #25: Info while JS is loading * Bump Plugin Version * Add Jenkinsfile * Switch to autoload and enable strict_types * Mini code spacing improvement * Add technical provisions to add the syntax help text later * Fix: prepareTextAreaOutput is class method now * Fix: Create an own JS Area... to make sure that there is always exactly one * Fix: getOriginalId has moved * Fix: we do not need any answer table * Get rid of * Use autoloading instead of ilPlugin::includeClass() * Fix return types of table name functions * Use method_exists() to determine ILIAS version * Remove strict_types in some places until we've got DB type security * Fix taxonomy import by fixing import_mapping * Use composer to get latest minify version * Add notice on composer usage for minify update * Add PRAGMA foreign_keys note * Resolve "Ensure type safety with database queries" * Fix typo * Format bigbang, PSR-12 * Update CodeMirror to v6 * fix int/float type mismatch * Prevent js class from being output to console by composer * Relocate a README entry * Add an editor max-height * CodeMirror: Handle Tabs and Enters * Add Further Syntax Info * UI text improvements * Fix typo in image name * Docker-Compose: version is not needed anymore * Transfer CodeMirror content on execution * ColumnNames::calculateReachedPoints() - Exception due to wrong array access (#3) * README: Switch to permalink * Code Style Fixes * Fix calculateReachedPoints * Fix for unanswered questions * Allow partial points by using floats instead of ints * Add a test suite * Fix FunctionalDependencies Amount Bug * FunctionalDependencies: Simplify Early Return * Add Test for Commutativity - FunctionalDependencies --------- Co-authored-by: Marco Angerer <marco.angerer@fau.de> * Increased the minor version number to 0.0.82 to reflect the bugfix implemented by @HektikR in #3 --------- Co-authored-by: Marco Angerer <marco.angerer@fau.de> Co-authored-by: Dominik Probst <dominik.probst@fau.de>
1 parent ef65cae commit 0c72764

156 files changed

Lines changed: 5833 additions & 14835 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
docs/
2+
docker-compose.yml
3+
vendor/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor/

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM srsolutions/ilias:latest
2+
3+
COPY . /var/www/html/Customizing/global/plugins/Modules/TestQuestionPool/Questions/assSQLQuestion/
4+
5+
RUN composer dump-autoload
6+
7+
# use ENTRYPOINT from FROM

Jenkinsfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
pipeline {
2+
environment {
3+
registryCredential = 'xe66gydo-gitlab'
4+
}
5+
6+
agent any
7+
8+
stages {
9+
stage('Build image') {
10+
steps {
11+
echo 'Starting to build docker image'
12+
13+
script {
14+
docker.withRegistry('https://cs6-gitlab.cs6.fau.de:4567/xe66gydo/asssqlquestion', registryCredential ) {
15+
def customImage = docker.build("cs6-gitlab.cs6.fau.de:4567/xe66gydo/asssqlquestion:${env.BUILD_ID}")
16+
customImage.push()
17+
customImage.push('latest')
18+
}
19+
}
20+
}
21+
}
22+
23+
stage('Deploy image') {
24+
steps {
25+
sshagent(['jenkins']) {
26+
sh '''
27+
ssh -o StrictHostKeyChecking=no xe66gydo@ilias.cs6.fau.de docker compose -f /opt/containers/ilias/docker-compose.yml up -d --pull always
28+
'''
29+
}
30+
}
31+
}
32+
33+
stage('Build phpdocs') {
34+
agent {
35+
docker {
36+
image 'phpdoc/phpdoc:3'
37+
args '--entrypoint ""'
38+
}
39+
}
40+
steps {
41+
sh 'phpdoc run -t public'
42+
stash includes: 'public/**', name: 'docs'
43+
}
44+
}
45+
46+
stage('Deploy phpdocs') {
47+
steps {
48+
sshagent(['jenkins']) {
49+
unstash 'docs'
50+
sh 'rsync -av --delete -e "ssh -o StrictHostKeyChecking=no" public/ xe66gydo@ilias.cs6.fau.de:/opt/containers/phpdocs/src'
51+
}
52+
}
53+
}
54+
}
55+
}

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,31 @@ There are two different options to install this plugin. One for demonstration an
3838

3939
1. Press "Activate" for the assSQLQuestion plugin
4040

41+
## Development
42+
43+
Some of the artifacts are uploaded to the repository in built form, some need to be built during installation. For the PHP part of the plugin, we adhere to the suggestions of ILIAS, namely to `composer install --no-dev` all dependencies during installation and not check in dependency artifacts into git (c.f. https://github.com/ILIAS-eLearning/ILIAS/pull/1833 and specifically https://docu.ilias.de/go/wiki/wpage_6371_1357 for plugins).
44+
45+
At the same time, there is the file `js/min.js.php`, which depends on `MatthiasMullie\Minify`. `min.js.php` is called directly from the browser but not via `ilias.php`. For this reason, we maintain a second, parallel composer in `lib/minify/vendor/`, which we do check in! It is up to the developer to update these dependencies and in order to do so, they need to operate in this composer instance (e.g. by calling `composer update matthiasmullie/path-converter`).
46+
47+
### Building the JavaScript bundle
48+
49+
From version 6 on, _Codemirror_ "exposes only modules, which will require some kind of build step before you can use them." (https://codemirror.net/docs/migration/) Therefore, we use _rollupjs_ and some glue code (c.f. `lib/codemirror/editor.mjs`) to make codemirror available from the global environment (i.e. `<script src="compiled.bundle.js"></script><script>here</script>`). This approach is taken from the official manual here: https://codemirror.net/examples/bundle/ The link gives an explanation about the later rollup invocation, too.
50+
51+
To install codemirror, rollup and its plugins, use `npm install` in the `lib/codemirror` directory, which installs the packages as in `package-lock.json`.
52+
53+
Use the following command to build the bundle:
54+
55+
```sh
56+
node_modules/.bin/rollup editor.mjs \
57+
-f iife \
58+
-o codemirror_sqlquestion.bundle.js \
59+
-p @rollup/plugin-node-resolve \
60+
-p @rollup/plugin-terser \
61+
--name codemirror_sqlquestion
62+
```
63+
64+
We do check in the resulting `codemirror_sqlquestion.bundle.js` file, as we cannot expect all administrators to set up their own JavaScript build environment to gather the file themselves.
65+
4166
## Documentation
4267
Additionally to the in source documentation there is a documentation educating about the interaction of components and further informations. Due to the origin of this project this part of the documentation is only available in German. It can be viewed by compiling the `dokumentation.tex` in the `docs/` folder with *pdflatex* or a comparable Latex compiler.
4368

0 commit comments

Comments
 (0)