thoriqadillah / moodle-qtype_essaysimilarity

Is a moodle question type plugin that compares the similarity between student's answer and teacher's answer key using machine learning (natural language processing), and uses the similarity to auto grade the answer. The automatic grade can be manually overridden by the teacher
https://thoriqadillah.github.io/cat-n-code/projects/essay-similarity/#demo
GNU General Public License v3.0
2 stars 3 forks source link

update stopword.php #1

Closed hafriz closed 1 year ago

hafriz commented 1 year ago

Warning: include(../stemmer/stemmer.php): failed to open stream: No such file or directory

thoriqadillah commented 1 year ago

Is the original include('./../stemmer.php'); in stemmer/en/en.php and include('../stemmer/stemmer.php'); in stopword/stopword.php throwing error? Is the include('./../stemmer.php'); in stemmer/id/id.php throwing error too?

hafriz commented 1 year ago

Yes, it throwing error, and i found en.php also throwing error.

What moodle version this plugin compatible with? I'm testing it on moodle 4.1

On Tue, 31 Jan 2023, 5:43 pm Thoriq Adillah, @.***> wrote:

Is the original include('./../stemmer.php'); in stemmer/en/en.php and include('../stemmer/stemmer.php'); in stopword/stopword.php throwing error? Is the include('./../stemmer.php'); in stemmer/id/id.php throwing error too?

— Reply to this email directly, view it on GitHub https://github.com/thoriqadillah/essaysimilarity/pull/1#issuecomment-1410050157, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKUNJYLUN2MSIKZPCK4JNLWVDNEFANCNFSM6AAAAAAUMBXBNE . You are receiving this because you authored the thread.Message ID: @.***>

thoriqadillah commented 1 year ago

4.1 should be fine. This plugin developed on v4.0 It's pretty weird because i have no problem with the include. I even try it without using include whatsoever and the stopword and stemmer is still working. What OS are you using? I'm using linux

Can you try on your machine to change the include both on stopword and stemmer with the following code?

global $CFG;
require_once($CFG->dirroot.'/question/type/essaysimilarity/nlp/preprocessing/stemmer/stemmer.php');

If that's working, I might change the include to require_once with absolute path instead of relative path

hafriz commented 1 year ago

I made the change to the code, and there are no longer any warning errors. I try to preview the question this warning error came out

Warning: Undefined array key "format" in /question/type/essaysimilarity/question.php on line 136

On Tue, 31 Jan 2023 at 18:36, Thoriq Adillah @.***> wrote:

4.1 should be fine. This plugin developed on v4.0 It's pretty weird because i have no problem with the include. I even try it without using include whatsoever and the stopword and stemmer is still working. What OS are you using? I'm using linux

Can you try on your machine to change the include both on stopword and stemmer with the following code?

global $CFG;require_once($CFG->dirroot.'/question/type/essaysimilarity/nlp/preprocessing/stemmer/stemmer.php');

If that's working, I might change the include to require_once with absolute path instead of relative path

— Reply to this email directly, view it on GitHub https://github.com/thoriqadillah/essaysimilarity/pull/1#issuecomment-1410122425, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKUNJ2M7J4EZ4PIKICXXHDWVDTJBANCNFSM6AAAAAAUMBXBNE . You are receiving this because you authored the thread.Message ID: @.***>

thoriqadillah commented 1 year ago

Can you give me the steps to reproduce the error?

hafriz commented 1 year ago

hi, I have updated the code with the correct variable, in question.php it should use answerformat

also in renderer.php line 186, there is another missing variable $plagiarism

Now all the warnings and the plugin seem to be working accordingly. I will do some more tests on the plugins.

the step to reproduce the error :

You just need to create the question, preview it and then try to submit the answer. once submit the warning error will show. (need to enable moodle debug mode)

On Wed, 1 Feb 2023 at 11:48, Thoriq Adillah @.***> wrote:

Can you give me the steps to reproduce the error?

— Reply to this email directly, view it on GitHub https://github.com/thoriqadillah/essaysimilarity/pull/1#issuecomment-1411421437, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKUNJ224HD46QTSMHE6SD3WVHMKBANCNFSM6AAAAAAUMBXBNE . You are receiving this because you authored the thread.Message ID: @.***>

thoriqadillah commented 1 year ago

Woops, a typo for sure. I thought it was $response['format'] instead of $response['answerformat']. Yep, thanks. Don't forget to remove the comment from the code Can you update the include in the stemmer for id.php like before as well, please? I will test it later. Thanks