Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request merging Moodlecpd 4.1 LTS to Medicine branch #14

Merged
merged 34 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bd59bb7
updated CPD Moodle41
tuehoang Jan 12, 2023
05b04d8
Update README.md
ubc-tuehoang Nov 17, 2023
917895c
Update README.md
ubc-tuehoang Nov 17, 2023
2d2f3e7
in progress README and updated moodlecore image
ubc-tuehoang Nov 20, 2023
e342c01
update readme
ubc-tuehoang Nov 20, 2023
ac40f4d
update readme
ubc-tuehoang Nov 20, 2023
44dc26e
update readme with step 1-2
ubc-tuehoang Nov 20, 2023
f5346e2
updated readme
ubc-tuehoang Nov 20, 2023
b443efb
udpated readme
ubc-tuehoang Nov 20, 2023
979ce9a
udpated
ubc-tuehoang Dec 8, 2023
7f9a74a
update moove theme
ubc-tuehoang Dec 10, 2023
2a5f260
updated hvp latest ver
ubc-tuehoang Dec 11, 2023
e56cc85
updated hvp and questionaire to latest
ubc-tuehoang Dec 11, 2023
5d18667
updated modules
ubc-tuehoang Dec 11, 2023
545fe30
updated code change for language icon and plugins
ubc-tuehoang Apr 18, 2024
57d34dc
updated maker theme language icon
ubc-tuehoang Apr 24, 2024
1e8b9b0
updated dockerfile and icons
ubc-tuehoang Apr 30, 2024
2cdb720
uploaded custom icons
ubc-tuehoang Apr 30, 2024
055c35a
added custom icons and bug fixed
ubc-tuehoang May 2, 2024
0825325
uploaded additional custom icons
ubc-tuehoang May 2, 2024
226bfde
uploaded custom icons
ubc-tuehoang May 2, 2024
5726130
added custom icons for core
ubc-tuehoang May 3, 2024
9304730
udpated div for langmenu
ubc-tuehoang May 3, 2024
ac08744
updated icons
ubc-tuehoang May 3, 2024
1bc64a1
updated more icons
ubc-tuehoang May 3, 2024
60045ae
updated lang and modified folder for icons
ubc-tuehoang May 6, 2024
ba1950f
updated custom icons
ubc-tuehoang May 6, 2024
c4a0c86
updated lthub moodlecore for production
ubc-tuehoang May 6, 2024
aafae7b
updated langmenu and readme
ubc-tuehoang May 9, 2024
356d2f9
updated dockerfile to use sed instead of copy
ubc-tuehoang May 9, 2024
56bf32d
udpated Moodle 4.1.10 and group choice plugins
ubc-tuehoang Jul 30, 2024
3e76aff
no confirmation from Kate, removed this plugin
ubc-tuehoang Aug 2, 2024
037b5b4
udpated Dockerfile and added Arlo ver4.1.4 zip
ubc-tuehoang Sep 4, 2024
1a394c3
Merge branch 'medicine' into moodlecpd-4.1LTS
Lannro Sep 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 108 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,142 +1,198 @@
FROM lthub/moodle:3.9.25
FROM lthub/moodle:4.1.13
MAINTAINER Tyler Cinkant <[email protected]>

RUN curl -L https://moodle.org/plugins/download.php/22949/mod_questionnaire_moodle310_2020062302.zip -o /questionnaire.zip \
##6May2024: production release
##Version 4.1.9
##FROM dangtue2020/moodlecore:419stg2-41ec0380b10f

##Version 4.1.10
##FROM dangtue2020/moodlecore:4110-2d9b62e726d4

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be moved to commit message


#Updated to newer questionnaire 10Dec2023
RUN curl -L https://moodle.org/plugins/download.php/29228/mod_questionnaire_moodle42_2022092202.zip -o /questionnaire.zip \
&& cp /questionnaire.zip /var/www/html/mod/ \
&& cd /var/www/html/mod \
&& unzip questionnaire.zip \
&& rm questionnaire.zip \
&& rm questionnaire.zip \

#This is the latest version of choicegroup plugin 18Jun2024
#REMOVED no confirmation from Kate for production 30July2024
#&& curl -L https://moodle.org/plugins/download.php/30464/mod_choicegroup_moodle43_2023110900.zip -o /choicegroup.zip \
#&& cp /choicegroup.zip /var/www/html/mod/ \
#&& cd /var/www/html/mod \
#&& unzip choicegroup.zip \
#&& rm choicegroup.zip \

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be deleted and move above comment to commit message.

#This is the latest version of plugin moodle33 as of 20Dec2022 and 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/11565/mod_certificate_moodle33_2016052300.zip -o /certificate.zip \
&& cp /certificate.zip /var/www/html/mod/ \
&& cd /var/www/html/mod \
&& unzip certificate.zip \
&& rm certificate.zip \

&& curl -L https://moodle.org/plugins/download.php/29419/mod_hvp_moodle42_2023061200.zip -o /hvp.zip \
#Updated to newer hvp 10Dec2023 and 18Apr2024
&& curl -L https://moodle.org/plugins/download.php/30739/mod_hvp_moodle43_2023122500.zip -o /hvp.zip \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to add this kind of comment. The information can be reflect in the commit and commit message.

&& cp /hvp.zip /var/www/html/mod/ \
&& cd /var/www/html/mod \
&& unzip hvp.zip \
&& rm hvp.zip \
&& rm hvp.zip \

#This is the latest version: And pending on Kate verification with her team.
#This is the latest version of plugin moodle33 as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/16906/block_poll_moodle37_2018052500.zip -o /poll.zip \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are those statement still valid?

&& cp /poll.zip /var/www/html/blocks/ \
&& cd /var/www/html/blocks \
&& unzip poll.zip \
&& rm poll.zip \

&& curl -L https://moodle.org/plugins/download.php/24644/report_customsql_moodle311_2021070700.zip -o /customsql.zip \
#This is the latest version of plugin moodle31 as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/26177/report_customsql_moodle40_2022031800.zip -o /customsql.zip \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

&& cp /customsql.zip /var/www/html/report/ \
&& cd /var/www/html/report \
&& unzip customsql.zip \
&& rm customsql.zip \
&& rm customsql.zip \

&& curl -L https://moodle.org/plugins/download.php/24594/format_grid_moodle39_2020070705.zip -o /grid.zip \
#Updated as of 11Dec2023 and 18Apr2024
&& curl -L https://moodle.org/plugins/download.php/31635/format_grid_moodle41_2022112609.zip -o /grid.zip \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

&& cp /grid.zip /var/www/html/course/format/ \
&& cd /var/www/html/course/format \
&& unzip grid.zip \
&& rm grid.zip \

&& curl -L https://moodle.org/plugins/download.php/21512/format_flexsections_moodle38_2020051100.zip -o /flex.zip \

#Updated as of 11Dec2023 and 18Apr2024
&& curl -L https://moodle.org/plugins/download.php/30735/format_flexsections_moodle43_2023122300.zip -o /flex.zip \
&& cp /flex.zip /var/www/html/course/format/ \
&& cd /var/www/html/course/format \
&& unzip flex.zip \
&& rm flex.zip \

&& curl -L https://moodle.org/plugins/download.php/23458/mod_facetoface_moodle39_2020080400.zip -o /facetoface.zip \
&& cp /facetoface.zip /var/www/html/mod/ \
&& cd /var/www/html/mod \
&& unzip facetoface.zip \
&& rm facetoface.zip \

&& curl -L https://moodle.org/plugins/download.php/14468/local_mass_enroll_moodle33_2015092402.zip -o /mass.zip \
&& rm flex.zip \

# Kate requested to remove:
# && curl -L https://moodle.org/plugins/download.php/25559/mod_facetoface_moodle311_2021113000.zip -o /facetoface.zip \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this section and include the comment in the commit message

# && cp /facetoface.zip /var/www/html/mod/ \
# && cd /var/www/html/mod \
# && unzip facetoface.zip \
# && rm facetoface.zip \
#

#Updated as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/30331/local_mass_enroll_moodle43_2023102300.zip -o /mass.zip \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

&& cp /mass.zip /var/www/html/local/ \
&& cd /var/www/html/local \
&& unzip mass.zip \
&& rm mass.zip \

&& curl -L https://moodle.org/plugins/download.php/21761/block_course_modulenavigation_moodle39_2020061615.zip -o /modulenav.zip \
#Updated as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/30267/block_course_modulenavigation_moodle43_2023101700.zip -o /modulenav.zip \
&& cp /modulenav.zip /var/www/html/blocks/ \
&& cd /var/www/html/blocks \
&& unzip modulenav.zip \
&& rm modulenav.zip \
&& rm modulenav.zip \

#This is the latest version of this plugin for moodle310 as of 11Jan2023 and 11Dec2023:
&& curl -L https://moodle.org/plugins/download.php/22758/block_configurable_reports_moodle310_2020110300.zip -o /configurable.zip \
&& cp /configurable.zip /var/www/html/blocks/ \
&& cd /var/www/html/blocks \
&& unzip configurable.zip \
&& rm configurable.zip \

&& curl -L https://moodle.org/plugins/download.php/22161/local_boostnavigation_moodle38_2020080400.zip -o /boostnavig.zip \
#No change as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/27010/local_boostnavigation_moodle311_2021071501.zip -o /boostnavig.zip \
&& cp /boostnavig.zip /var/www/html/local/ \
&& cd /var/www/html/local \
&& unzip boostnavig.zip \
&& rm boostnavig.zip \
&& rm boostnavig.zip \

&& curl -L https://moodle.org/plugins/download.php/20137/tool_mergeusers_moodle37_2019082000.zip -o /mergeuser.zip \
&& curl -L https://moodle.org/plugins/download.php/28943/tool_mergeusers_moodle41_2023040402.zip -o /mergeuser.zip \
&& cp /mergeuser.zip /var/www/html/admin/tool/ \
&& cd /var/www/html/admin/tool \
&& unzip mergeuser.zip \
&& rm mergeuser.zip \
&& rm mergeuser.zip \

&& curl -L https://moodle.org/plugins/download.php/22662/filter_multilang2_moodle310_2020101300.zip -o /multi.zip \
#Updated as of 11Dec2023 and 18Apr2024
&& curl -L https://moodle.org/plugins/download.php/31000/filter_multilang2_moodle43_2024013101.zip -o /multi.zip \
&& cp /multi.zip /var/www/html/filter/ \
&& cd /var/www/html/filter \
&& unzip multi.zip \
&& rm multi.zip \

&& curl -L https://moodle.org/plugins/download.php/24719/availability_language_moodle311_2021071800.zip -o /avail.zip \
#Updated as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/30198/availability_language_moodle43_2023101400.zip -o /avail.zip \
&& cp /avail.zip /var/www/html/availability/condition/ \
&& cd /var/www/html/availability/condition \
&& unzip avail.zip \
&& rm avail.zip \

&& curl -L https://moodle.org/plugins/download.php/23089/block_panopto_moodle310_2020121100.zip -o /panopto.zip \
#Pending on Kate verification with her team.
#Updated as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/29980/block_panopto_moodle42_2023091800.zip -o /panopto.zip \
&& cp /panopto.zip /var/www/html/blocks/ \
&& cd /var/www/html/blocks \
&& unzip panopto.zip \
&& rm panopto.zip \

&& curl -L https://moodle.org/plugins/download.php/21850/local_recompletion_moodle39_2020062500.zip -o /recomplete.zip \
#Updated as of 11Dec2023 and 18Apr2024
&& curl -L https://moodle.org/plugins/download.php/31207/local_recompletion_moodle42_2023112702.zip -o /recomplete.zip \
&& cp /recomplete.zip /var/www/html/local/ \
&& cd /var/www/html/local \
&& unzip recomplete.zip \
&& rm recomplete.zip \

&& curl -L https://github.com/ArloSoftware/moodle-enrol_arlo/archive/refs/tags/v3.11.3.zip -o /enrolarlo.zip \
&& cp /enrolarlo.zip /var/www/html/enrol/ \
&& cd /var/www/html/enrol \
&& rm recomplete.zip

#This is the latest version of this plugin ARLO v4.1.4 - checked again on 23Jan2024 12:38:
#ARLO plugin requires Arlo_connection setting.
# && curl -L https://moodle.org/plugins/download.php/30634/enrol_arlo_moodle42_2023110900.zip -o /enrolarlo.zip \
# && cp /enrolarlo.zip /var/www/html/enrol/ \
# && cd /var/www/html/enrol \
# && unzip enrolarlo.zip \
# && rm enrolarlo.zip

# add arlo version 4.1.4
COPY plugin/enrol_arlo_moodle42_2023110900.zip /var/www/html/enrol/enrolarlo.zip
RUN cd /var/www/html/enrol \
&& unzip enrolarlo.zip \
&& mv moodle-enrol_arlo-3.11.3 arlo \
&& rm enrolarlo.zip
&& rm enrolarlo.zip


# add custom cert
COPY certificate.php /var/www/html/mod/certificate/type/letter_non_embedded/

# add custom moove theme
COPY themes/moove_premium.zip /var/www/html/theme/
RUN cd /var/www/html/theme \
&& unzip moove_premium.zip \
&& rm moove_premium.zip

# add custom theme
COPY themes/maker-v6.1-moodle-3.9.zip /var/www/html/theme/
COPY themes/maker-v10.0-moodle-4.1.zip /var/www/html/theme/
RUN cd /var/www/html/theme \
&& unzip maker-v6.1-moodle-3.9.zip \
&& rm maker-v6.1-moodle-3.9.zip
&& unzip maker-v10.0-moodle-4.1.zip \
&& rm maker-v10.0-moodle-4.1.zip

# add tinymce for panopto
COPY plugin/panoptobutton.zip /var/www/html/lib/editor/tinymce/plugins/

RUN cd /var/www/html/lib/editor/tinymce/plugins/ \
&& unzip panoptobutton.zip \
&& rm panoptobutton.zip

# add new config file for mergeusers plugin
COPY plugin/config.local.php /var/www/html/admin/tool/mergeusers/config/


RUN cd /var/www/html/theme/maker/pix/ \
&& rm favicon.ico

COPY themes/favicon.ico /var/www/html/theme/maker/pix/

# add favicon to moove
COPY themes/favicon.ico /var/www/html/theme/moove/pix/

# add custom font
COPY fonts /var/www/html/theme/maker/fonts

# add custom font to moove
COPY fonts /var/www/html/theme/moove/fonts

RUN chown -R www-data /var/www/html

# install odbc for shib sp
Expand All @@ -154,4 +210,17 @@ COPY moodle-shib.conf /etc/apache2/conf-enabled/
COPY docker-entrypoint.d/* /docker-entrypoint.d/
COPY 000-default.conf /etc/apache2/sites-available/

# add modified files for Language Icon
COPY themes/maker-header.mustache /var/www/html/theme/maker/templates/header.mustache
COPY themes/boost-language_menu.mustache /var/www/html/theme/boost/templates/language_menu.mustache
COPY themes/updated-icon-designs-4.1/mod/ /var/www/html/theme/maker/pix_plugins/mod

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be very useful to add some comments about how we got those files. Did you write them or sent by Kate? So for future updates, we can trace them back to the source. Same for the fonts and favicon above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These mustache codes were modified to meet Kate's requirements based on the UX/UI specifications.

COPY themes/updated-icon-designs-4.1/core/f/ /var/www/html/pix/f/

##COPY themes/lib/outputrenderers.php /var/www/html/lib/
RUN sed -i.bak '/public function lang_menu/ i\ public function get_language() {return current_language();}\n' /var/www/html/lib/outputrenderers.php

RUN sleep 3 && echo "\$THEME->removedprimarynavitems = ['courses'];" >> /var/www/html/theme/maker/config.php
##RUN sleep 3 && sed -i "\$a\\n\\n\$THEME->removedprimarynavitems = ['courses'];" /var/www/html/theme/maker/config.php

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment still needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, for line 223—this is a requirement from Kate to ensure that the course is not displayed in the students' menu.

RUN chmod -R 755 /docker-entrypoint.d/
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,97 @@
## MoodleCPD 4.1LTS


<!--img width="847" alt="MoodleCPD_L2" src="https://github.com/ubc/moodle-docker/assets/86985864/bb61e8a3-866d-4f5e-8a62-1a900e874511"-->

![alt text](image-1.png)

## Build MoodleCPD Image

* Step 1-2: build MoodleCore 4.1-LTS
- Source to build MoodleCore https://github.com/ubc/moodle-docker/tree/moodlecore-4.1LTS


* Step 3: for development

* HOW-TO Build MoodleCPD from MoodleCore 4.1-LTS with Github > Codespace

* - (optional) fork "moodlecpd-4.1LTS" branch
- From "moodlecpd-4.1LTS" branch:
- click on the (green button) "<> CODE"
- select "Codespaces" tab
- click the + to launch Codespaces instance
- This will launch a default Codespaces instance with 2-core 8GB RAM, 32GB (sufficient to build this image)
- The browser navigates to the codespace instance: something like this... [some random name]gp.github.dev
- At bottom, select tab "Terminal" - this is bash shell
- Edit Dockerfile or other
- After completed the change (if any), then do build image

- Execute > docker-compose build
- After build completed, tag the image.

- (optional) docker login -u [your hub.docker.com accout]

- Execute > docker tag [some image ID] [your hub.docker.com accout]/moodlecpd:4.1.6-[some unique id]
- example, docker tag eb73e7a5c010 hubdocker2020/moodlecpd:4.1.6-eb73e7a5c010

- Execute > docker push [your hub.docker.com accout]/moodlecpd:4.1.6-[some unique id]
- example, docker push hubdocker2020/moodlecpd:4.1.6-eb73e7a5c010

- DONE with buidling MoodleCPD 4.1 LTS, this image to your hub.docker.com account.



* Step 4: for deployment to STAGING or PROD

* After completion of Step 3 above:

- commit the change back to main repo branch "moodlecpd-4.1LTS" from the Github > Codespaces instance above.

- this "commit" step will initiate the automatic building of the image to LTHub, making it ready for the next step 5: HELM launch.

- DONE with MoodleCPD 4.1 LTS, the Moodle Core image is on LTHub: https://hub.docker.com/u/lthub



* Step 5: for building MoodleCPD with MoodleCore image from Step 3 OR Step 4 above:


- Update values_stg2.yaml with the following:
- Check value_stg2.yaml about line 16, for repo location and tag
- image:
- repository: lthub/moodlecore
- tag: moodlecore-4.1.6

- value_stg2.yaml about line 102, for database name:
- db:
- type: mysqli
- auth:
- database: mdl_ubccpd_stg2

- value_stg2.yaml about line 254, for NFS moodledata folder location:
- resources:
- nfs:
- server: storageverf.lthub.ubc.ca
- path: "/medicinemoodlestg2"


- Launch HELM:

- helm INSTALL -n default -f ./configuration/moodle/values_stg2.yaml moodle-medicine-stg2 ./charts/moodle/

- OR

- helm UPGRADE -n default -f ./configuration/moodle/values_stg2.yaml moodle-medicine-stg2 ./charts/moodle/

-----------------------

* Optional Moodle CLI commands:

- upgrade command: php ./admin/cli/upgrade.php
- clear cache command: php ./admin/cli/purge_cache.php

-----------------------

## Known Issues

* When using NFS shared volume for `/moodledata`, you may get `session data file is not created by your uid` error. It is due to the NFS mount user id mapping is not consistent with local user id. Use Redis session for workaround.
Expand Down
Binary file added image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugin/enrol_arlo_moodle42_2023110900.zip
Binary file not shown.
44 changes: 44 additions & 0 deletions themes/boost-language_menu.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{!
This file is part of Moodle - http://moodle.org/

Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template theme_boost/language_menu

Language menu template.

Context variables required for this template:
* title - The title of the menu (displays the text of the currently active language).
* items - Array of data representing the available languages to be displayed in the language menu.
* link - If a link is provided render it.
* title - The title of the language item.
* text - The text displayed for the language item.
* url - The url link to activate the given language.
* isactive - Whether the language is currently active.

Example context (json):
{
"title": "English (en)",
"items": {
"link": {
"title": "English (en)",
"text": "English (en)",
"url": "http://example.com",
"isactive": 0
}
}
}
}}

Loading
Loading