|
88 | 88 | $ragcourse = optional_param('rag_course_enabled', 0, PARAM_INT); |
89 | 89 | set_config('rag_enabled_course_' . $courseid, $ragcourse, 'local_ai_course_assistant'); |
90 | 90 |
|
| 91 | + // English lock — force English responses for ELL courses. |
| 92 | + $englishlock = optional_param('english_lock', 0, PARAM_INT); |
| 93 | + set_config('english_lock_course_' . $courseid, $englishlock, 'local_ai_course_assistant'); |
| 94 | + |
91 | 95 | // Starter overrides — per-course enable/disable for each starter. |
92 | 96 | $starteroverrides = []; |
93 | 97 | $allstarters = \local_ai_course_assistant\starter_manager::get_global_starters(); |
|
109 | 113 | $ragcourseraw = get_config('local_ai_course_assistant', 'rag_enabled_course_' . $courseid); |
110 | 114 | $ragcourseenabled = ($ragcourseraw === false) || (bool)$ragcourseraw; |
111 | 115 |
|
| 116 | +// English lock setting. |
| 117 | +$englishlockenabled = (bool)get_config('local_ai_course_assistant', 'english_lock_course_' . $courseid); |
| 118 | + |
112 | 119 | // Build provider options. |
113 | 120 | $providers = [ |
114 | 121 | '' => get_string('coursesettings:using_global', 'local_ai_course_assistant') . |
@@ -305,6 +312,33 @@ class="btn btn-sm btn-outline-secondary" target="_blank"> |
305 | 312 | </div> |
306 | 313 | <?php } ?> |
307 | 314 |
|
| 315 | + <div class="card mb-3"> |
| 316 | + <div class="card-header"> |
| 317 | + <h5 class="mb-0">English Lock (ELL Courses)</h5> |
| 318 | + </div> |
| 319 | + <div class="card-body"> |
| 320 | + <p class="text-muted">Force SOLA to always respond in English for this course, regardless of the student's language preference. Ideal for English language learning courses where students should practice reading and writing in English.</p> |
| 321 | + <div class="form-group row"> |
| 322 | + <label class="col-sm-3 col-form-label" for="english_lock"> |
| 323 | + English Lock |
| 324 | + </label> |
| 325 | + <div class="col-sm-9"> |
| 326 | + <div class="custom-control custom-switch"> |
| 327 | + <input type="checkbox" class="custom-control-input" id="english_lock" |
| 328 | + name="english_lock" value="1" |
| 329 | + <?php if ($englishlockenabled) { echo 'checked'; } ?>> |
| 330 | + <label class="custom-control-label" for="english_lock"> |
| 331 | + Always respond in English |
| 332 | + </label> |
| 333 | + </div> |
| 334 | + <small class="form-text text-muted"> |
| 335 | + When enabled, SOLA will respond in English even if the student writes in another language. The student's language preference in their settings panel will be overridden. |
| 336 | + </small> |
| 337 | + </div> |
| 338 | + </div> |
| 339 | + </div> |
| 340 | + </div> |
| 341 | + |
308 | 342 | <?php |
309 | 343 | // Starter overrides section. |
310 | 344 | $allstarters = \local_ai_course_assistant\starter_manager::get_global_starters(); |
|
0 commit comments