[FIXED] Docebo Test Time Left (Time Format Change)

Third party plugins, patches, bugfixes
Post Reply
User avatar
murat
FormaLms User
Posts: 112
Joined: Fri Oct 12, 2012 6:28 pm
Version: forma.lms 2.0

[FIXED] Docebo Test Time Left (Time Format Change)

Post by murat »

Hi,

I want to docebo 4.05 test time left format change.
Example:
Language English when test question time is 1h 34m 34s

But language is Turkish or other when test question time is 1h 34m 34 s

normally turkish time format must be 1s 34dk 34s

How to change time format for test

Solution:

You must found do.test.php file (/doceboLms/modules/test/do.test.php)

After change ,
# 568 rows (this file)

Code: Select all

 .elem.innerHTML = minute + ' m ' + second  + '  s';  
Write what you want instead (m and s)
Example,
Turkish version:

Code: Select all

 .elem.innerHTML = minute + ' dk ' + second  + '  saniye '; // Change on the language 
Attachments
Test time life format change
Test time life format change
test_time_left_format.jpg (21.47 KiB) Viewed 1245 times
Hello,I'm Murat. If you need me, you can contact my mail

User avatar
max
FormaLms Guru
Posts: 2353
Joined: Thu Mar 01, 2012 10:41 am
Version: forma.lms 2.4
Contact:

Re: [FIXED] Docebo Test Time Left (Time Format Change)

Post by max »

Thank you Murat for looking into this issue, I think it will be very useful for all the users with the same language needs as you have.
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it

User avatar
murat
FormaLms User
Posts: 112
Joined: Fri Oct 12, 2012 6:28 pm
Version: forma.lms 2.0

Re: [FIXED] Docebo Test Time Left (Time Format Change)

Post by murat »

The new update for code :)

Change the old code with this new code

Code: Select all

.elem.innerHTML = minute + ' ".$lang->def('_MINUTE')." ' + second  + ' ".$lang->def('_SECOND')."'; 

After, save to your own language. (_MINUTE' and _SECOND)

With this change, the "time left (for test)" was translated into all languages​​.
Hello,I'm Murat. If you need me, you can contact my mail

nangi
Newbie
Posts: 15
Joined: Wed Jul 03, 2013 1:06 pm
Version: forma.lms 2.3
Contact:

Re: [FIXED] Docebo Test Time Left (Time Format Change)

Post by nangi »

well how can we modfy/change the total time to other languages it shown as 2h 20m and want this shown as 2 sa. 20 dk.
I've attached the screenshot of the total time on the left collobration section.
Attachments
collabration.png
collabration.png (12.88 KiB) Viewed 1232 times

User avatar
murat
FormaLms User
Posts: 112
Joined: Fri Oct 12, 2012 6:28 pm
Version: forma.lms 2.0

Re: [FIXED] Docebo Test Time Left (Time Format Change)

Post by murat »

nangi wrote:well how can we modfy/change the total time to other languages it shown as 2h 20m and want this shown as 2 sa. 20 dk.
I've attached the screenshot of the total time on the left collobration section.

Hi,

You must open "doceboLms/menu/menu_lat.php' file.

After change this codes:

(line 150)

Code: Select all

	$partial_time = ( $hours != 0 ? $hours.'h ' : '' ).$minutes.'m ';//.$seconds.'s '; 
(line 157)

Code: Select all

	$tot_time = ( $hours != 0 ? $hours.'h ' : '' ).$minutes.'m ';//.$seconds.'s '; 
with codes;

For one language

(line 150)

Code: Select all

	$partial_time = ( $hours != 0 ? $hours.'s ' : '' ).$minutes.'dk ';//.$seconds.'sn '; 
(line 157)

Code: Select all

	$tot_time = ( $hours != 0 ? $hours.'s ' : '' ).$minutes.'dk ';//.$seconds.'sn '; 
or

You can want to multi languages;

(line 150)

Code: Select all

	$partial_time = ( $hours != 0 ? $hours.''.Lang::t('_HOURS', 'time').'' : '' ).$minutes.''.Lang::t('_MINUTE', 'time').' ';//.$seconds.''.Lang::t('_SECOND', 'time').' '; 
(line 157)

Code: Select all

	$tot_time = ( $hours != 0 ? $hours.''.Lang::t('_HOURS', 'time').' ' : '' ).$minutes.''.Lang::t('_MINUTE', 'time').' ';//.$seconds.''.Lang::t('_SECOND', 'time').' '; 
Do not forget to add it to the language settings

Code: Select all

example add , language setting.
Modul: time 
LANG_KEY: _MINUTE
DESCRIPTION: dk
if you want to "second" time
You delete this code

Code: Select all

;//
example;

Code: Select all

(line 157)	[code]	$tot_time = ( $hours != 0 ? $hours.'s ' : '' ).$minutes.'dk '.$seconds.'sn '; 
Attachments
finally , time setting :)
finally , time setting :)
collabration.png (15.01 KiB) Viewed 1219 times
Hello,I'm Murat. If you need me, you can contact my mail

Post Reply