rand_with_prohib Question-level simplify

rand_with_prohib Question-level simplify

by Hiram Bollaert -
Number of replies: 3

A bug? Or did I oversee something?

I created a question with:

a:rand_with_prohib(2,9,[0]);
b: rand_with_prohib(2,9,[0,a]);
c: rand_with_prohib(1,9,[0,a,b]);
d: rand_with_prohib(1,9,[0,a,b,c]);

When Question-level simplify = Yes => no problem

When Question-level simplify = No => I get this error:

The CAS returned the following error(s):b: rand_with_prohib(2,9,[0,a]) caused the following error: apply: subscript must be an integer; found: 1+1 c: rand_with_prohib(1,9,[0,a,b]) caused the following error: apply: subscript must be an integer; found: 1+1 d: rand_with_prohib(1,9,[0,a,b,c]) caused the following error: apply: subscript must be an integer; found: 1+1


Stack version 3.5.0 for Moodle 2.7+ is used

I go back to "'Question-level simplify = Yes" and experiment further smile

Cheers
Hiram

Average of ratings: -
In reply to Hiram Bollaert

Re: rand_with_prohib Question-level simplify

by Hiram Bollaert -

Ha!

Solved it smile

Question-level simplify = No

AND use:

simp: true;
a:ev(rand_with_prohib(2,9,[0]),simp);
...

I'm getting there
Hiram

In reply to Hiram Bollaert

Re: rand_with_prohib Question-level simplify

by Hiram Bollaert -
In reply to Hiram Bollaert

Re: rand_with_prohib Question-level simplify

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hiram,

Thanks for posting a fix.  Actually this is a bug, and I've just committed a fix to it, so sorry about that.  It should filter through to production sites in due course.

Chris