General developer forum

 
 
Picture of Philippe Blain
[Calculated question type] difference between get_formula_errors and qtype_calculated_find_formula_errors
 

Hi, 

I'm developing a new question type that extends the calculated question type.
I noticed that two functions used by the calculated question type are exactly the same : the get_formula_errors method of class qtype_calculated_variable_substituter (in question.php) and the qtype_calculated_find_formula_errors function that is at the end of questiontype.php.

Using the Find usage function of NetBeans, I found that the get_formula_errors function is not used anywhere in the code, it is only declared. Does this mean that it has been replaced by qtype_calculated_find_formula_errors and not deleted yet ? 

Or is the opposite, get_formula_errors is supposed to replace qtype_calculated_find_formula_errors eventually but it hasn't been done yet ?

I would like to know because I need to modify this function a bit for my question type.

Thanks,
Philippe.

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: [Calculated question type] difference between get_formula_errors and qtype_calculated_find_formula_errors
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Certainly looks like a mistake. Please file a tracker issue so we can fix it. I'm pretty sure that  get_formula_errors is the one that should be deleted.

 
Average of ratings:Useful (1)
Picture of Philippe Blain
Re: [Calculated question type] difference between get_formula_errors and qtype_calculated_find_formula_errors
 

Hi, I just filed a issue in the tracker, https://tracker.moodle.org/browse/MDL-40311.

If get_formula_errors is the one that should be deleted, why is it that qtype_calculated_find_formula_errors is not part of any class ? It seemed weird to me because almost all the code I had looked at in the question and quiz modules were object-oriented...

 
Average of ratings: -