Moodle

cloze question try saving incorrectly formatted categories

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9
  • Fix Version/s: STABLE backlog
  • Component/s: Questions
  • Labels:
    None
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE

Description

Under certain circumstances, on Windows based server editing and saving Cloze question may lead ro an update error such as :

Data truncated for column 'category' at row 1
UPDATE mdl_question SET category = '300,1',parent = '3203',name = 'TEST d......

The problem appears only when editing and saving an existing Cloze questions. The problem does not appears when creating Cloze question or using a Linux environment.

Possible solution:
edit moodle/question/type/questiontype.php, and just before line 284, add the following:

$question->category = array_shift(explode(',', $question->category)); // Category clean

The above hack solved the issue in Windoze boxes, so it is here for Question guru review

Activity

Hide
Pierre Pichet added a comment -

As I am working on other aspects of Cloze,( MDL-14625) I will include this.

Show
Pierre Pichet added a comment - As I am working on other aspects of Cloze,( MDL-14625) I will include this.
Hide
Pierre Pichet added a comment -

Can you tell me what version you have of the moodle/question/type/questiontype.php
i.e something like // $Id: questiontype.php,v 1.76 2007/11/28 12:45:57 tjhunt Exp $
and when did you update your moodle 1.9 ?

Show
Pierre Pichet added a comment - Can you tell me what version you have of the moodle/question/type/questiontype.php i.e something like // $Id: questiontype.php,v 1.76 2007/11/28 12:45:57 tjhunt Exp $ and when did you update your moodle 1.9 ?

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated: