Non-core contributed modules

New algebraic question type

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.1
  • Fix Version/s: None
  • Component/s: Question type: Algebra
  • Labels:
    None
  • Environment:
    Developed under Moodle 1.9.1 and PHP 5 with MySQL. Will require PHP5 to run.

Description

This is a new question type for algebraic questions. This question type will accept algebraic formulae from students and will compare them against the question's answers. It interprets the responses algebraically so responses like '(x+1)^2', '(1+x)^2' and 'x^2+2x+1' will all be treated as equal which is something not possible with the current question types. In addition each question comes with a display button that will take the current formula in the response box and graphically display it, via the TeX filter, so the student can confirm that the computer has correctly interpreted their text expression.

Documentation is included in the ZIP file on how to install the new question type. In addition to this the edit form has detailed help buttons for the new fields and there is also a test server at http://thwaite.phys.ualberta.ca/moodle-dev/ to try out the code. A brief history of the most recent bug fixes as well as feature suggestions is included under two discussions in the quiz forum. A Danish translation has been provided by Morten Brydensholt and has also been included in the ZIP file.

In addition to the above the code has been adapted to fill the naming convention in the coding guidelines: all classes are prefixed with 'qtype_algebra' so there should not be namespace overlap problems. I am asking that this code be included in the appropriate part of the CVS so if there do need to be changes to the code before this is possible please let me know.

Activity

Hide
Tim Hunt added a comment -

This is certainly a very cool question type. Thank you for writing it.

However, it is quite specialist, and has not had much testing yet, so the appropriate place to put it is in the contrib area of CVS (http://docs.moodle.org/en/Development:contrib), and to add it to the modules and plugins database. That way, people who want it can download and install it easily, and we can track development and decide later whether to add it to the official Moodle release.

I have assigned this bug to Anthony, who is contrib maintainer.

Show
Tim Hunt added a comment - This is certainly a very cool question type. Thank you for writing it. However, it is quite specialist, and has not had much testing yet, so the appropriate place to put it is in the contrib area of CVS (http://docs.moodle.org/en/Development:contrib), and to add it to the modules and plugins database. That way, people who want it can download and install it easily, and we can track development and decide later whether to add it to the official Moodle release. I have assigned this bug to Anthony, who is contrib maintainer.
Hide
Roger Moore added a comment -

Thank you for moving it. I was not intending for it to be in the core code for exactly the reasons you mention. However this is the first contribution I've submitted to Moodle and while the instructions said the 'CONTRIB' section it didn't mention that I had to make this choice at the project level (I was think Moodle->Contrib). So thanks again for fixing it.

Show
Roger Moore added a comment - Thank you for moving it. I was not intending for it to be in the core code for exactly the reasons you mention. However this is the first contribution I've submitted to Moodle and while the instructions said the 'CONTRIB' section it didn't mention that I had to make this choice at the project level (I was think Moodle->Contrib). So thanks again for fixing it.
Hide
Roger Moore added a comment -

I was just wondering what is happening with the creation of a CVS area for me to put the code in. I have a few bugs reported which I need to work on but it is hard to keep the machines I work on synced without CVS. I can setup my own server but I don't want to to that if there is a chance I can get an area on the Moodle contrib server soon?

Show
Roger Moore added a comment - I was just wondering what is happening with the creation of a CVS area for me to put the code in. I have a few bugs reported which I need to work on but it is hard to keep the machines I work on synced without CVS. I can setup my own server but I don't want to to that if there is a chance I can get an area on the Moodle contrib server soon?
Hide
Anthony Borrow added a comment -

Roger - Sorry for the delay in getting to this but I very much appreciate your note alerting me to the urgency you have to get this in CVS. I'm looking at the code now. One of the things I would like to do is change the INSTALL and README files to INSTALL.txt and README.txt. Obviously a minor change but having the extension removes any ambiguity in CVS about the file type. Let me know if you have any objections. Peace - Anthony

Show
Anthony Borrow added a comment - Roger - Sorry for the delay in getting to this but I very much appreciate your note alerting me to the urgency you have to get this in CVS. I'm looking at the code now. One of the things I would like to do is change the INSTALL and README files to INSTALL.txt and README.txt. Obviously a minor change but having the extension removes any ambiguity in CVS about the file type. Let me know if you have any objections. Peace - Anthony
Hide
Anthony Borrow added a comment -

Roger - I also think that the lang and other files all belong in the /question/type/algebra folder. You may have to change a few things with the new locations but ultimately it makes your code more modular. I'll need to check the get_string function to make sure that it is able to find the strings. If not we may have to give it a hint as to where to look by using the $extralocations variable. Peace - Anthony

Show
Anthony Borrow added a comment - Roger - I also think that the lang and other files all belong in the /question/type/algebra folder. You may have to change a few things with the new locations but ultimately it makes your code more modular. I'll need to check the get_string function to make sure that it is able to find the strings. If not we may have to give it a hint as to where to look by using the $extralocations variable. Peace - Anthony
Hide
Anthony Borrow added a comment -

When you get a chance, it would be good to create some of the help files in response to "Help file "comp_algorithm.html" could not be found!"

Show
Anthony Borrow added a comment - When you get a chance, it would be good to create some of the help files in response to "Help file "comp_algorithm.html" could not be found!"
Hide
Anthony Borrow added a comment -

moving to the newly created component QuestionType: Algebra

Show
Anthony Borrow added a comment - moving to the newly created component QuestionType: Algebra
Hide
Anthony Borrow added a comment -

Roger - I think the Algebra question type could use some better documentation (I'm not sure if you have anything in docs.moodle.org). I have bumped your privileges in the tracker so that you can manage issues related to the Algebra question type. I created a component called QuestionType: Algebra so that others can report issues (suggestions, bugs, etc.) and those issues should automatically be assigned to you and notify you via email of the issue. I appreciate your work on developing this code and your generosity in sharing it and commitment to maintaining it. It is that spirit which helps to make Moodle all that it is so thanks for being a contributing member of the community. If you have not done so already, please read http://docs.moodle.org/en/Development:Guidelines_for_contributed_code and make sure that you have covered each of the steps as they each represent a piece of the puzzle in sharing, documenting and maintaining good code. Finally, you will need to apply for CVS access at http://moodle.org/cvs and just reference the tracker number and put the path contrib/plugins/question/type/algebra in the message. Once that is done you should have everything you need. Do not hesitate to let me know if you have any questions. Peace - Anthony

Show
Anthony Borrow added a comment - Roger - I think the Algebra question type could use some better documentation (I'm not sure if you have anything in docs.moodle.org). I have bumped your privileges in the tracker so that you can manage issues related to the Algebra question type. I created a component called QuestionType: Algebra so that others can report issues (suggestions, bugs, etc.) and those issues should automatically be assigned to you and notify you via email of the issue. I appreciate your work on developing this code and your generosity in sharing it and commitment to maintaining it. It is that spirit which helps to make Moodle all that it is so thanks for being a contributing member of the community. If you have not done so already, please read http://docs.moodle.org/en/Development:Guidelines_for_contributed_code and make sure that you have covered each of the steps as they each represent a piece of the puzzle in sharing, documenting and maintaining good code. Finally, you will need to apply for CVS access at http://moodle.org/cvs and just reference the tracker number and put the path contrib/plugins/question/type/algebra in the message. Once that is done you should have everything you need. Do not hesitate to let me know if you have any questions. Peace - Anthony
Hide
Roger Moore added a comment -

Thank you very much for setting this all up. I completely agree about the need for better documentation - I'd been concentrating on documenting the code initially so that others can understand it but I agree that users will need better documentation than is currently available.

I have no objections to the 'txt' extensions - it's a trivial change. I'm sorry about having the lang files in the wrong place - I did not know that they would be found by the system if I put them in the 'algebra' directory but it obviously makes a lot more sense to do that if the system will pick them up from there. There is already a comp_algorithm.html help file in the list above which is why I'm worried about whether the system will pick up help files from the plugin directory. It works fine from the old location in the main lang directory so I'll have to see if I can figure out which directories the help system will search for a plugin.

Thanks again, Roger

Show
Roger Moore added a comment - Thank you very much for setting this all up. I completely agree about the need for better documentation - I'd been concentrating on documenting the code initially so that others can understand it but I agree that users will need better documentation than is currently available. I have no objections to the 'txt' extensions - it's a trivial change. I'm sorry about having the lang files in the wrong place - I did not know that they would be found by the system if I put them in the 'algebra' directory but it obviously makes a lot more sense to do that if the system will pick them up from there. There is already a comp_algorithm.html help file in the list above which is why I'm worried about whether the system will pick up help files from the plugin directory. It works fine from the old location in the main lang directory so I'll have to see if I can figure out which directories the help system will search for a plugin. Thanks again, Roger
Hide
Anthony Borrow added a comment -

Roger - If the help files are there and not being picked up then I think we need to file an issue in the tracker so that Moodle does find them. This would be a great improvement and should not be too difficult to do. If you get the chance to file such a request in the tracker it would be great. Otherwise, I will do it when I have a chance. Peace - Anthony

Show
Anthony Borrow added a comment - Roger - If the help files are there and not being picked up then I think we need to file an issue in the tracker so that Moodle does find them. This would be a great improvement and should not be too difficult to do. If you get the chance to file such a request in the tracker it would be great. Otherwise, I will do it when I have a chance. Peace - Anthony
Hide
Roger Moore added a comment -

Anthony - I've managed to fix the help file issue. Looking through the code when the help system is looking for help files contained in a plugin it strips the plugin type from the name i.e. 'qtype_algebra' becomes 'algebra' when searched for in the plugin directory rather than the core moodle directory. Hence renaming the help file directory from "algebra/lang/en_utf8/help/qtype_algebra" to "algebra/lang/en_utf8/help/algebra" has fixed the problem. I'll update the CVS to reflect this. Thanks again for all the help - having CVS access is very useful! - Roger

Show
Roger Moore added a comment - Anthony - I've managed to fix the help file issue. Looking through the code when the help system is looking for help files contained in a plugin it strips the plugin type from the name i.e. 'qtype_algebra' becomes 'algebra' when searched for in the plugin directory rather than the core moodle directory. Hence renaming the help file directory from "algebra/lang/en_utf8/help/qtype_algebra" to "algebra/lang/en_utf8/help/algebra" has fixed the problem. I'll update the CVS to reflect this. Thanks again for all the help - having CVS access is very useful! - Roger
Hide
Anthony Borrow added a comment -

Roger - I'm glad you were able to track down the issue with the help files and resolve it. Let me know if you need anything else. Thanks again for your efforts in sharing this question type with the community. Peace - Anthony

Show
Anthony Borrow added a comment - Roger - I'm glad you were able to track down the issue with the help files and resolve it. Let me know if you need anything else. Thanks again for your efforts in sharing this question type with the community. Peace - Anthony
Hide
Anthony Borrow added a comment -

Closing all of my resolved issues. Peace - Anthony

Show
Anthony Borrow added a comment - Closing all of my resolved issues. Peace - Anthony

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: