Commit 1fcbf1c3 authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Small roll-up and test fix.

parent 0089232d
......@@ -325,7 +325,7 @@ class quiz_api_test extends advanced_testcase
$question_attempt_step_id = $DB->insert_record('question_attempt_steps', $question_attempt_step);
// Example of how to shorten the answer length
$answer_length = strlen($exapmle_answers) - ($student_id * strlen($exapmle_answers) / 6); // Reduce the answer by 10 characters for each subsequent student
$answer_length = strlen($exapmle_answers) - (int) ($student_id * strlen($exapmle_answers) / 6); // Reduce the answer by 10 characters for each subsequent student
$student_answer = substr($exapmle_answers, 0, $answer_length);
// Saving the answer text
......
......@@ -47,19 +47,17 @@ docker-compose exec moodle php ${MOODLE_BASE_DIR}/admin/cli/install.php \
echo "No database backup found. Skipping restore."
fi
# Locale setting inside the Docker container
docker-compose exec -u root moodle bash -c "apt-get update && apt-get install -y locales && \
echo 'en_AU.UTF-8 UTF-8' >> /etc/locale.gen && \
locale-gen && \
update-locale"
# Composer installation to run phpunit tests
docker-compose exec moodle php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
docker-compose exec moodle php composer-setup.php --install-dir=/usr/local/bin --filename=composer
docker-compose exec moodle php -r "unlink('composer-setup.php');"
docker-compose exec moodle php composer install --no-interaction \
--no-plugins \
--no-scripts \
--no-dev \
--prefer-dist && composer dump-autoload
docker-compose exec moodle apt-get update && apt-get install -y locales && \
echo "en_AU.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen
docker-compose exec moodle bash -c "cd /app && /usr/local/bin/composer install --no-interaction --no-plugins --no-scripts --no-dev --prefer-dist && /usr/local/bin/composer dump-autoload"
# Next, configure PHPUnit for Moodle:
docker-compose exec moodle php admin/tool/phpunit/cli/init.php
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment