jl2035 / moodle_mod_mootyper Goto Github PK
View Code? Open in Web Editor NEWTyping instructor extension for Moodle.
Typing instructor extension for Moodle.
The add to log function in exercises.php is commented out. It needs to be re-implemented as an event.
add_to_log() has been deprecated, please rewrite your code to the new events API
line 48 of /lib/deprecatedlib.php: call to debugging()
line 39 of /mod/mootyper/index.php: call to add_to_log()
get_context_instance() is deprecated, please use context_xxxx::instance() instead.
line 3670 of /lib/deprecatedlib.php: call to debugging()
line 41 of /mod/mootyper/index.php: call to get_context_instance()
Suggestion.
Vaules in column "Time" contains "s" (seconds).
First. This is not translated to other languages.
Second. It is not comfortable. When exporting to CSV, this letter has to be removed each time. If need specify that the time is in seconds, then it can be done in header of column:
https://github.com/jl2035/moodle_mod_mootyper/blob/master/lang/en/mootyper.php#L63
For examle:
$string['timeinseconds'] = 'Time (s)';
As result, this string can be localized by translators. And letter "s" will not interfere in CSV table.
When exercise ends, results shown on the right side are stuck. Statistics loses some last characters and last second. And this statistics differs from statistics in grades list.
P.S.
MooTyper 2.6.5 (Build: 2014102300)
Moodle 2.7.3 (Build: 20141110)
Server: Ubuntu 12.04, Apache 2.4.10, PHP 5.5.18
Client: Ubuntu 12.04, Firefox/Chrome
Once you reach an apostrophe in a lesson nothing can be types. For example using "don't" will cause a lesson to hang.
Hi, It looks like there are permissions defined in access.php that do not have corresponding language strings. The ones I get errors for are
$string['mootyper:editall'] = '';
$string['mootyper:aftersetup'] = '';
$string['mootyper:setup'] = '';
$string['mootyper:view'] = '';
$string['mootyper:viewgrades'] = '';
Thanks
Alex
Float values in Lesson/Exam mode and in grades tables are not localized. This values always shown with "." (point) decimal mark, regardless of the choosen language. But in many countries decimal mark is "," (comma):
https://en.wikipedia.org/wiki/Decimal_mark#Hindu.E2.80.93Arabic_numeral_system
Especially this is uncomfortable when exporting to CSV. LO Calc importing this CSV does not detect this values as numbers, this values are detected as text.
Moodle has special functions to display different types in user's locale. There is function "format_float" for float values:
... format_float($gr->hitsperminute,2).'</td><td>'.$gr->fullhits.'</td><td>'.format_float($gr->precisionfield,2) ...
Using this function, float values are shown with correct decimal mark, depending on choosen language in Moodle.
Pressing "To manage exercises and categories click here" leads to error:
Debug info: ERROR: argument of AND must be type boolean, not type integer
LINE 4: (visible = 1 AND 0) OR
^
SELECT id, lessonname
FROM mdl_mootyper_lessons
WHERE ((visible = 2 AND authorid = 2) OR
(visible = 1 AND 0) OR
(1))
ORDER BY id
[array (
)]
Error code: dmlreadexception
Stack trace:
line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 244 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 764 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 122 of /mod/mootyper/locallib.php: call to pgsql_native_moodle_database->get_records_sql()
line 75 of /mod/mootyper/exercises.php: call to get_mootyperlessons()
May be this is because of using postgres? (instead of mysql by default)
Issue fix:
diff -ur ./mootyper.orig/locallib.php ./mootyper/locallib.php
--- ./mootyper.orig/locallib.php 2014-10-23 23:00:58.000000000 +0600
+++ ./mootyper/locallib.php 2014-11-11 11:28:50.700307039 +0500
@@ -109,8 +109,8 @@
$sql = "SELECT id, lessonname
FROM ".$CFG->prefix."mootyper_lessons
WHERE ((visible = 2 AND authorid = ".$u.") OR
- (visible = 1 AND ".is_user_enrolled($u, $c).") OR
- (".can_view_edit_all($u, $c)."))
+ (visible = 1 AND ".is_user_enrolled($u, $c)." = 1) OR
+ (".can_view_edit_all($u, $c)." = 1))
ORDER BY id";
/*
/// This was taken out, because we have some context_module::instance confusion
There is no link to "View my grades" when lesson passed ("End of the category / lesson"). It is not possible to view own results.
I have been trying to access Scales in Moodle (/grade/edit/scale/index.php) and get the following error
line 307 of /lib/grade/grade_scale.php: call to debugging()
line 146 of /grade/edit/scale/index.php: call to grade_scale->is_used()
Field "grade" does not exist in table "mootyper"
More information about this error
Debug info:
Error code: ddlfieldnotexist
Stack trace:
line 526 of /lib/dml/moodle_database.php: dml_exception thrown
line 1606 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
line 395 of /mod/mootyper/lib.php: call to moodle_database->record_exists()
line 9487 of /lib/moodlelib.php: call to mootyper_scale_used()
line 9527 of /lib/moodlelib.php: call to course_scale_used()
line 322 of /lib/grade/grade_scale.php: call to site_scale_used()
line 146 of /grade/edit/scale/index.php: call to grade_scale->is_used()
There is no field called Grade in mdl_mootyper, but there is a grades table mdl_mootyper_grades, could that be changes so that this will work, or maybe adjust it so it doesn't fail. There code which needs to be changed is below in mod/mootyper/lib.php line 395
if ($scaleid and $DB->record_exists('mootyper', array('id' => $mootyperid, 'grade' => -$scaleid))) {
return true;
} else {
return false;
}
I would suggest that it needs to be changed in the next function (mootyper_scale_used_anywhere($scaleid)) as well.
"timetake" is shown always in English.
Suggesting using of Moodle Time API for show time in student's language.
https://docs.moodle.org/dev/Time_API
diff -ur ./mootyper.orig/gview.php ./mootyper/gview.php
--- ./mootyper.orig/gview.php 2014-10-20 16:09:08.000000000 +0600
+++ ./mootyper/gview.php 2014-11-13 09:35:11.156307200 +0500
@@ -108,7 +108,7 @@
$remove_lnk = '<a href="'.$CFG->wwwroot . '/mod/mootyper/attrem.php?c_id='.$_GET['id'].'&m_id='.$_GET['n'].'&g='.$gr->id.'">'.get_string('eremove', 'mootyper').'</a>';
$htmlout .= '<tr style="border-top-style: solid;"><td>'.$klicaj.' '.$gr->firstname.' '.$gr->lastname.'</td><td>'.$gr->mistakes.'</td><td>'.$gr->timeinseconds.
- ' s</td><td>'.$gr->hitsperminute.'</td><td>'.$gr->fullhits.'</td><td>'.$gr->precisionfield.'%</td><td>'.date('d. M Y G:i', $gr->timetaken).'</td><td>'.$gr->wpm.'</td><td>'.$remove_lnk.'</td></tr>';
+ ' s</td><td>'.$gr->hitsperminute.'</td><td>'.$gr->fullhits.'</td><td>'.$gr->precisionfield.'%</td><td>'.userdate($gr->timetaken).'</td><td>'.$gr->wpm.'</td><td>'.$remove_lnk.'</td></tr>';
}
$avg = get_grades_avg($grds);
$htmlout .= '<tr style="border-top-style: solid;"><td><strong>'.get_string('average', 'mootyper').': </strong></td><td>'.$avg['mistakes'].'</td><td>'.$avg['timeinseconds'].' s</td><td>'.$avg['hitsperminute'].'</td><td>'.$avg['fullhits'].'</td><td>'.$avg['precisionfield'].'%</td><td></td></tr>';
@@ -211,7 +211,7 @@
$stil = 'background-color: #FF6C6C;';
$remove_lnk = '<a href="'.$CFG->wwwroot . '/mod/mootyper/attrem.php?c_id='.$_GET['id'].'&m_id='.$_GET['n'].'&g='.$gr->id.'">'.get_string('eremove', 'mootyper').'</a>';
$htmlout .= '<tr style="border-top-style: solid;'.$stil.'"><td>'.$klicaj.' '.$gr->firstname.' '.$gr->lastname.'</td><td>'.$gr->exercisename.'</td><td>'.$gr->mistakes.'</td><td>'.
- $gr->timeinseconds.' s</td><td>'.$gr->hitsperminute.'</td><td>'.$gr->fullhits.'</td><td>'.$gr->precisionfield.'%</td><td>'.date('d. M Y G:i', $gr->timetaken).'</td><td>'.$gr->wpm.'</td><td>'.$remove_lnk.'</td></tr>';
+ $gr->timeinseconds.' s</td><td>'.$gr->hitsperminute.'</td><td>'.$gr->fullhits.'</td><td>'.$gr->precisionfield.'%</td><td>'.userdate($gr->timetaken).'</td><td>'.$gr->wpm.'</td><td>'.$remove_lnk.'</td></tr>';
}
$avg = get_grades_avg($grds);
$htmlout .= '<tr style="border-top-style: solid;"><td><strong>'.get_string('average', 'mootyper').': </strong></td><td> </td><td>'.$avg['mistakes'].'</td><td>'.$avg['timeinseconds'].' s</td><td>'.$avg['hitsperminute'].'</td><td>'.$avg['fullhits'].'</td><td>'.$avg['precisionfield'].'%</td><td></td></tr>';
diff -ur ./mootyper.orig/owngrades.php ./mootyper/owngrades.php
--- ./mootyper.orig/owngrades.php 2014-10-20 16:09:08.000000000 +0600
+++ ./mootyper/owngrades.php 2014-11-13 09:35:26.996307564 +0500
@@ -110,7 +110,7 @@
$stil = '';
$f_col = $mootyper->isexam ? '---' : $gr->exercisename;
$htmlout .= '<tr style="border-top-style: solid;'.$stil.'"><td>'.$f_col.'</td><td>'.$gr->mistakes.'</td><td>'.$gr->timeinseconds.
- ' s</td><td>'.$gr->hitsperminute.'</td><td>'.$gr->fullhits.'</td><td>'.$gr->precisionfield.'%</td><td>'.date('d. M Y G:i', $gr->timetaken).'</td><td>'.$gr->wpm.'</td></tr>';
+ ' s</td><td>'.$gr->hitsperminute.'</td><td>'.$gr->fullhits.'</td><td>'.$gr->precisionfield.'%</td><td>'.userdate($gr->timetaken).'</td><td>'.$gr->wpm.'</td></tr>';
}
$avg = get_grades_avg($grds);
if(!$mootyper->isexam)
P.S.
This time is named "timetake". In my understanding "Time take" is time from start to end. Probably this field in English must be translated as "Date" or "DateTime".
Suggestion.
Disable escape from exercise by "reload page in browser" or moving to another page. Disable only when exercise "is running" or "ended and not saved" (not pressed continue). Disable escape by browser feature "This page is asking you to confirm that you want to leave...". Same as leaving page with unsaved post in Moodle.
Reproduce:
In total, at least three php modules has no user rights check: owngrades, gview, attrem.
Archive "MooTyper.ru.tar.gz" with ready to use Russian layout can be downloaded from cloud:
https://yadi.sk/d/tIcLQC6Ychbxm
Archive contains:
./lang/ru/mootyper.php
./layouts/Russian.js
./layouts/Russian.php
and some simple lessons in "./lessons/".
Example foto of Russian keyboard:
http://www.nix.ru/autocatalog/keyboards_mitsumi/86403_2245_draft.jpg
(black letters - English, red letters - Russian)
Virtual Russian keyboard:
http://prodtp.ru/virtual_keyboard.html
(consider buttons "Shift" and "Rus/Lat")
File in archive "./lessons/ru - Проверка раскладки.txt" contains all symbols on keyboard.
"Проверка раскладки" = "Check layout".
Expanding MooTyper in Navigation tree leads to error:
"Coding error detected, it must be fixed by a programmer: No further information available for this branch"
During exercise, pressing backspace deletes typed text. This does not affect to exercise results, this is "cosmetic" bug.
The add to log function in eins.php is commented out. It needs to be re-implemented as an event.
a WPM field was added to the mootyper grade table in install.xml but not in the upgrade.php file.
Can you look at doing a test on version number and update the database with the new field.
I have installed Mootyper for the first time and somehow got this error after clicking setup. Is this a bug? I can't configure anything since this error is persistent.
Moodle version: 3.1.1 (Build: 20160711)
MooTyper version: 3.1.3 (Build: 2016101101)
##################################################################
Debug info: ERROR: argument of OR must be type boolean, not type integer
LINE 6: (1))
^
SELECT id, lessonname
FROM mdl_mootyper_lessons
WHERE ((visible = 2 AND authorid = 2) OR
(visible = 1 AND editable <= 2 AND courseid = 48) OR
(visible = 0) OR
(1))
ORDER BY id
[array (
)]
Error code: dmlreadexception
×Stack trace:
line 474 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 244 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 794 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 134 of /mod/mootyper/locallib.php: call to pgsql_native_moodle_database->get_records_sql()
line 125 of /mod/mootyper/mod_setup.php: call to get_mootyperlessons()
#######################################################################
Hi,
Thanks for your work.
I did the translation into /lang/es/mootyper.php just for the strings.
Then I changed spanish.php inside layour folder following the instructions but I am still fighting with spanish.js
I copied the german.js as a base and tried to add letters but I have some problems with Spanish keyboard signs and letter º ª ¿ñ Ñ á é í ó ú
So I need some extra help. Where can I find some extra information? Could you help me?
Thanks for your time
The module eedit.php does not log any events at the present. It would be nice to know who did it if the contents of any exercise is changed.
Enhancement.
In most cases in Moodle listed users are shown as links to their profiles. For exapmle in Participants:
http://MOODLESITE/user/index.php?id=1
example code:
http://git.moodle.org/gw?p=moodle.git;a=blob;f=user/index.php;h=e8875bd16b17fc394ecf8ddaf7bb39b2f6730652;hb=refs/heads/MOODLE_27_STABLE#l766
(line 766)
It would be nice, if MooTyper in grade table will list users as links.
Hi,
Thanks for your work.
I did the translation into /lang/es/mootyper.php just for the strings.
Then I changed portuguese.php inside layour folder following the instructions but I am still fighting with portuguese.js
I copied the english.js as a base and tried to add letters but I have some problems with Portuguese keyboard signs and letter ç ; á é í ó ú ã ão
So I need some extra help. Where can I find some extra information? Could you help me?
Thanks for your time
The module erem.php does not log any events at the present. It would be nice to know who did it if any exercises or categories are removed.
COPYPASTE FROM: https://moodle.org/plugins/view.php?plugin=mod_mootyper
I am using Moodle 2.5.5
I install Mootyper on my moodle after editing version.php.
I change this in version.php:
From:
$module->requires = 2012062500; // Requires this Moodle version
To:
$module->requires = 2013051405; // Requires this Moodle version
Mootyper installed and working fine untill I found this:
When I clicked "To manage exercises and categories click here" there is list of lessons but there is no check box displayed to select them sad
I am not a PHP hardcoder so please help me in this issue...
Some special characters can not be saved in "Manage MooTyper exercises". For example can not be saved: "~`[]".
And there is a bug with newlines:
installed in 2.7... happens when creating a mootyper assignment.
The module mootyper does not define the standard capability mod/mootyper:addinstance
line 3409 of /course/lib.php: call to debugging()
line 1910 of /course/lib.php: call to course_allowed_module()
line 158 of /index.php: call to get_module_metadata()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.