Giter VIP home page Giter VIP logo

moodle_mod_mootyper's People

Contributors

canx avatar drachels avatar jl2035 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle_mod_mootyper's Issues

New Moodle 2.7.13 gives multiple debug warnings when clicking MooTYper in Activities block

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()

Seconds in column "Time"

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.

Statistics are not updated when exercise ends

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.

Exercise ends:
testend

Grades:
testgrades

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

Missing Language strings

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 are not localized

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.

Error on "Manage exercises"

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

Field "grade" does not exist in table "mootyper"

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.

"Test Date" is not localized

"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>&nbsp;</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".

Disable exercise escape

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.

Privileges violation

Reproduce:

  • login as student (has not teacher rights)
  • go to MooTyper activity
  • student have no link to "View all grades", but...
  • click "View my grades" (this opens url: http://SITE/mod/mootyper/owngrades.php?id=1&n=1)
  • replacing in address bar "owngrades" to "gview" will open page with all grades
  • in addition, it this table student can click "Remove" and delete results of other students

In total, at least three php modules has no user rights check: owngrades, gview, attrem.

Russian layout

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".

Expand tree

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"

Backspace deletes typed text

During exercise, pressing backspace deletes typed text. This does not affect to exercise results, this is "cosmetic" bug.

WPM database field is not added to upgrade.php

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.

Error reading database

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.

screen shot 2017-01-20 at 3 29 57 pm

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()

#######################################################################

Spanish Layout

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

Broken grades table in Chrome

Client OS: Ubuntu 12.04
Browser: Google Chrome 38.0.2125.111

ChromeGradesTable

In FireFox this table is shown normal. Bug only in Chrome.

Portuguese Laytout

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

Manage exercises on Moodle 2.5.5

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...

Edit exercise with special characters

Some special characters can not be saved in "Manage MooTyper exercises". For example can not be saved: "~`[]".

And there is a bug with newlines:

  • save exercise with newlines
  • open this exercise for edit
  • newlines are shown as "\n" instead of newlines

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.