Moodle

Cannot create Random Short Answer

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.1
  • Fix Version/s: 1.9.2
  • Component/s: Questions
  • Labels:
    None
  • Environment:
    WAMP/LAMP
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

Course > Questions > Create New Question: Random Short Answer (you previously created 2 short answer questions in the same category)
Save Changes

=> error message is displayed: "There are no short answer questions in the category that you chose ''. Choose a different category, make some questions in this category."

Issue Links

Activity

Hide
Paul-Andre Chasse added a comment -

At the Universite de Sherbrooke, we had that problem. We made a temporary fix into the source. The file '/moodle/question/type/randomsamatch/edit_randomsamatch_form.php' was modified as follow:

We replaced the following code ( lines 53-57 of file /moodle/...edit_randomsamatch_form.php) :

if (isset($data['usecurrentcat'])){ $category = $data['category']; }else{ $category = $data['categorymoveto']; }

By the following:

if (!isset($data['usecurrentcat']) && isset($data['categorymoveto'])) { $category = $data['categorymoveto']; } } else { $category = $data['category']; } }

Paul-André Chassé

Show
Paul-Andre Chasse added a comment - At the Universite de Sherbrooke, we had that problem. We made a temporary fix into the source. The file '/moodle/question/type/randomsamatch/edit_randomsamatch_form.php' was modified as follow: We replaced the following code ( lines 53-57 of file /moodle/...edit_randomsamatch_form.php) : if (isset($data['usecurrentcat'])){ $category = $data['category']; }else{ $category = $data['categorymoveto']; } By the following: if (!isset($data['usecurrentcat']) && isset($data['categorymoveto'])) { $category = $data['categorymoveto']; } } else { $category = $data['category']; } } Paul-André Chassé
Hide
Ryan Smith added a comment -

Will this be fixed soon? This should not be minor priority, it should be at least major. The Random-Short Answer Matching question type is currently completely broken on the latest cvs of the Moodle 1.9 stable branch.

Thanks for the code Paul-Andre, it does temporarily fix the issue for us.

Show
Ryan Smith added a comment - Will this be fixed soon? This should not be minor priority, it should be at least major. The Random-Short Answer Matching question type is currently completely broken on the latest cvs of the Moodle 1.9 stable branch. Thanks for the code Paul-Andre, it does temporarily fix the issue for us.
Hide
Matthew Davidson added a comment -

This question type is completely broken without the patch. Thank you for the patch Paul...even though it doesn't fix everything...at least it works now if the questions are in the correct category. However, there are some major problems.

When creating the question, you select a category and then select how many questions to check for.

If you have all your questions in subcategories of the category selected, the check will fail...even though the question will draw from those subcategories.

Show
Matthew Davidson added a comment - This question type is completely broken without the patch. Thank you for the patch Paul...even though it doesn't fix everything...at least it works now if the questions are in the correct category. However, there are some major problems. When creating the question, you select a category and then select how many questions to check for. If you have all your questions in subcategories of the category selected, the check will fail...even though the question will draw from those subcategories.
Hide
Tim Hunt added a comment -

Thanks for working out the fix Paul-Andre. I changed it slightly, in order to make the code here closer to default_questiontype::save_question.

Show
Tim Hunt added a comment - Thanks for working out the fix Paul-Andre. I changed it slightly, in order to make the code here closer to default_questiontype::save_question.
Hide
Ryan Smith added a comment -

Tim,

I just tested it and looks like it works properly now. Thanks for the quick fix!

Show
Ryan Smith added a comment - Tim, I just tested it and looks like it works properly now. Thanks for the quick fix!
Hide
Matthew Davidson added a comment -

Check this new related bug... http://tracker.moodle.org/browse/MDL-15433

Show
Matthew Davidson added a comment - Check this new related bug... http://tracker.moodle.org/browse/MDL-15433
Hide
Nicolas Connault added a comment -

Tested and verified. Closing.

Show
Nicolas Connault added a comment - Tested and verified. Closing.

People

Dates

  • Created:
    Updated:
    Resolved: