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

missing thirdpartylibs.xml file. #3

Closed danmarsden closed 1 year ago

danmarsden commented 1 year ago

When including an external library in your plugin, you must include a thirdpartylibs.xml file that includes the name, location and license of the library. More information on this is here: https://docs.moodle.org/dev/Plugin_files#thirdpartylibs.xml And here: https://docs.moodle.org/dev/Plugin_with_third_party_libraries

One of the other advantages of using this is that Moodle's codechecker automatically ignores any files included in the location specificed in the thirdpartylibs.xml file.

Please note - this is typically a blocker for approval in the plugins db.

thoriqadillah commented 1 year ago

Thanks for the feedback. I have some question Is the library that needs to be included in thirdpartylibs.xml only library from PHP or...? Because the SVD implementation (https://github.com/thoriqadillah/moodle-qtype_essaysimilarity/blob/639230baaaad7c98bebcfb74c777ae574c330ac1/nlp/transformer/svd.php) was taken from JAMA, which is from Java. It was a translation from java to php. Should I included it too?

And the stemmer algorithm (https://github.com/thoriqadillah/moodle-qtype_essaysimilarity/blob/639230baaaad7c98bebcfb74c777ae574c330ac1/nlp/stemmer/id/id.php was taken from a person's project repo , not actually a library. Should I include it too?

danmarsden commented 1 year ago

The important thing is to have nlp listed - you don't need to list everything that nlp has inside it.

thoriqadillah commented 1 year ago

I have a bit of confusion here So, the code that I wrote in nlp folder are just copy and paste from the library, not importing from the library itself. But some of it has modification of the implementation to make the logic suit my needs. This is because I have no idea why when I make a custom class with psr-4 that has namespace and import it with use keyword, it doesn't work, so I just rewrite it myself and import it with require_once.

The question:

danmarsden commented 1 year ago

in terms of the thirdpartylibs - the important thing is that you list NLP in there.

If the NLP folder has specific changes for your plugin to work - I'd suggest you drop a readme.txt file into the nlp folder that describes what you've done to modify the library - it might help you to remember next time you try to update the NLP library code with a new release and will help if anyone wants to review/understand the changes you've made.

In terms of other methods to include libraries - best to ask in the moodle community fourms (I don't really have enough time to help with this - my main focus is on approval blockers in the plugins db.) :-)

thanks!

thoriqadillah commented 1 year ago

I'm sorry if I misunderstood something, but the NLP folder is not library. It has some function that I rewrite from certain library. For example, the cosine_similarity.php is rewrite from this because I have no idea to make it work with psr-4. So, the library that should I list is the PHP NlpTools right? Not the nlp folder

But, according to https://docs.moodle.org/dev/Plugin_with_third_party_libraries, I need to download it and place it somewhere in the plugin. And if I understood correctly, if I download the plugin, then I should use it by importing it as well, because why I download it but not use it, right?

If I understood you correctly, I should download it, and not use it, and continue with my code as is. But, I need to write readme to tell people and myself the decision that I make. Is it correct?

danmarsden commented 1 year ago

ah - yes it would be a lot cleaner if you had a folder that only contained the nlp library and you put the other files somewhere else in a different folder - but as that file is based on an existing nlp file it's probably fine to leave as-is in the folder where it is now. up to you - not going to block approval based on that. you could add a readme in that folder to make it clear what is original nlp code and what code is modified, but again I'm not going to block approval based on that - it's just an advisory :-)

thoriqadillah commented 1 year ago

Ok, thanks. May be best to make a readme in that folder. You are the second person to assume that the nlp folder is library haha