Edit text

Edit text

Joe Boyle -
回帖数:3

Hi All,

I need some advice on how to edit text for listings such as Page, Scorm Package, etc found in the View.php file:  I can find the code when I inspect the element in web page https://www.geotol-lms.com/moodle/course/view.php?id=40&section=4.


I want to change Change instances of "<div class="text-uppercase small">                    Page"  to  "<div class="text-uppercase small">                    Video"

I have access to cpanel and have already changed the page icon to a video icon.   My problem is how do I locate and then edit the section of view.php file?id=40&section=40. 

I plan to do the same with scorm package-  

Any suggestions on how I locate and edit HTML code in ?id=40&section=40. of the View.php file- it is not in the View.php file but in a section stored some where else on the server.


Thanks Joe






回复Joe Boyle

Re: Edit text

Mary Cooch -
Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Testers的头像 Translators的头像
Hello - if I understand you correctly you want to change the word Page as in your screenshot to Video? You can do this via the admin interface Site administration >Language > Language customisation
回复Mary Cooch

Re: Edit text

Joe Boyle -
Thanks Mary,
Took your advice and tried language customization, however now I need to need to jump a new hurdle- an Error message:

This is what I get:
Error writing to database

More information about this error

Debug info: Incorrect string value: '\xF0\x9F\x91\x8B' for column `jboyle_moo1`.`eoi_tool_customlang`.`original` at row 1
INSERT INTO eoi_tool_customlang (lang,componentid,stringid,original,master,timemodified,outdated,local,timecustomized) VALUES(?,?,?,?,?,?,?,?,?)
[array (
0 => 'en',
1 => '1',
2 => 'welcomeback',
3 => 'Welcome back, {$a->firstname}! 👋',
4 => 'Welcome back, {$a->firstname}! 👋',
5 => 1665230908,
6 => 0,
7 => NULL,
8 => NULL,
)]
Error code: dmlwriteexception×Dismiss this notification
Stack trace:
line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 1357 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 1403 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
line 206 of /admin/tool/customlang/locallib.php: call to mysqli_native_moodle_database->insert_record()
line 63 of /admin/tool/customlang/index.php: call to tool_customlang_utils::checkout()

Error writing to database

Debug info: Incorrect string value: '\xF0\x9F\x91\x8B' for column `jboyle_moo1`.`eoi_tool_customlang`.`original` at row 1
INSERT INTO eoi_tool_customlang (lang,componentid,stringid,original,master,timemodified,outdated,local,timecustomized) VALUES(?,?,?,?,?,?,?,?,?)
[array (
0 => 'en',
1 => '1',
2 => 'welcomeback',
3 => 'Welcome back, {$a->firstname}! 👋',
4 => 'Welcome back, {$a->firstname}! 👋',
5 => 1665230908,
6 => 0,
7 => NULL,
8 => NULL,
)]
Error code: dmlwriteexception×Dismiss this notification
Stack trace:
      • line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
      • line 1357 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      • line 1403 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      • line 206 of /admin/tool/customlang/locallib.php: call to mysqli_native_moodle_database->insert_record()
      • line 63 of /admin/tool/customlang/index.php: call to tool_customlang_utils::checkout()
Will keep digging.  Will check to see other posts on fixing this error- may be back for more moodle advice on how to fix this error from the moodle forum.

Joe
回复Joe Boyle

Re: Edit text

Joe Boyle -
Mary,
Thank you for helping me to solve this problem of changing text, (PAGE to VIDEO and SCORM PACKAGE to EXERCISE) you helped me on the right path- To get to this point, I also learned about Moodle debugging tool and setting collation to make Moodle to match collation settings on the server.  Setting debugging temporarily to developer was essential in solving the errors. Error reading from database - COLLATION 'utf8mb4_bin' is not valid for CHARACTER SET 'utf8' SELECT * FROM mdl_user WHERE LOWER(username) COLLATE utf8mb4_bin  
Having access to the server allowed me to change collation settings and there were quite a few places. 



My next challenge is to change the back ground color of the EXERCISE icon (previously SCORM PACKAGE) so that workshop exercises stand out.  If you or other Moodlers can point me in the right direction I would appreciate your advice.  

Also if it helps others I can post screen shots or short video showing how to solve Error reading from database - COLLATION 'utf8mb4-  ......
It would include setting debug tool in moodle - this shows where to look on the server, and then how to make changes to data base collation for each instance there is a mismatch between moodle and the server. 
I learned a lot this time
Thank you again,

Best

Joe