# 其他Moodle設定

## 啟動使用Moodle行動應用程式(APP)的存取

用具有管理權限的管理員帳號連上平台後，進入Moodle的 網站管理>外掛> Web服務>行動裝置。我們勾選「為行動裝置啟動網路服務」並儲存變更。

pic1

對於這個平台，其目的地不是公開的網際網路(Internet)，對於SSL憑證的建議可以沒有風險地忽略。

***驗證***

```
智慧型手機用Wi-Fi連上MoodleBox網路，開啟Moodle行動應用程式(APP)，用URL http://moodlebox.home 連上到平台，用管理員帳號登入。應該沒有任何錯誤回報，且在智慧型手機螢幕上顯示「沒有課程訊息可顯示」。
```

## 安裝MoodleBox管理外掛

為了讓MoodleBox的動新啟動及關機時，不造成MiscroSD卡損壞的風險，可以更改密碼、設定時間、改變Wi-Fi網路的密碼，以及在操作中提供有用的訊息，我們在MoodleBox上安裝管理Moodle的外掛。

最簡單的方法是透過GIT中安裝它。

```
$ cd /var/www/html/admin/tool/
$ sudo git clone https://github.com/martignoni/moodlebox-plugin.git moodlebox
$ cd /var/www/html/admin/tool/moodlebox
$ sudo touch .reboot-server; touch .shutdown-server; touch .set-server-datetime; touch .newpassword; touch .wifipassword
$ sudo chown -R www-data:www-data /var/www/html/admin/tool/moodlebox
```

完成外掛的安裝後，連至<http://moodlebox.home/admin> 。 安裝完整的套件incron。

```
$ sudo apt-get install incron
```

由root 授權使用incron，然後修改 incron任務表。

```
$ echo root | sudo tee -a /etc/incron.allow
$ sudo incrontab -e
```

在任務表加入這些行:

```
/var/www/html/admin/tool/moodlebox/.reboot-server IN_CLOSE_WRITE /sbin/shutdown –r now
/var/www/html/admin/tool/moodlebox/.shutdown-server IN_CLOSE_WRITE /sbin/shutdown -h now
/var/www/html/admin/tool/moodlebox/.set-server-datetime IN_MODIFY /bin/bash /var/www/html/admin/tool/moodlebox/.set-server-datetime
/var/www/html/admin/tool/moodlebox/.newpassword IN_CLOSE_WRITE /bin/bash /var/www/html/admin/tool/moodlebox/bin/changepassword.sh
/var/www/html/admin/tool/moodlebox/.wifipassword IN_CLOSE_WRITE /bin/bash /var/www/html/admin/tool/moodlebox/bin/setwifipassword.sh
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gxiangco.gitbook.io/moodlebox-on-raspberry-pi-3/chapter8.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
