8 Commits

Author SHA1 Message Date
David Monllao
242a27b180 MDL-38956 behat: New test
According to MDLQA-92, a teacher can preview
questions in the question bank.
2013-04-15 14:14:31 +08:00
David Monllao
d72a183645 MDL-38957 behat: New test
According to MDLQA-94, a teacher can
sort questions in the question bank.
2013-04-11 17:24:12 +08:00
David Monllao
a97d274c92 MDL-38958 behat: New test
According to MDLQA-91, a teacher can
edit questions in the question bank.
2013-04-11 17:23:08 +08:00
David Monllao
336b5b5914 MDL-38958 behat: Step definition to add questions 2013-04-11 11:47:03 +08:00
Tim Hunt
0a606a2be2 MDL-38538 question auto-save back end.
1. Autosave works in some ways just like a normal save. We ultimately
call $behaviour->process_save() to do the work, and create a new step to
hold the data.

2. However, we come in through a completely different route through the
API, starting with separate auto-save methods. This keeps the auto-save
changes mostly separate, and so reduced the chance of breaking existing
working code.

3. When the time comes to store the auto-save step in the database, we
save it using a negative sequence number.

This is a clever trick that not only distinguises these steps, but also
avoids unique key errors when an auto-save and a real action happen
simultaneously. (There are unit tests for these tricky edge cases.)

4. When we load the data back from the database, most of the time the
auto-save steps are loaded back as if they were a real save, and so the
auto-saved data is used when the question is then rendered.

5. However, before we process another action, we remove the auto-saved
step, so it does not appear in the final history.
2013-03-28 16:51:59 +00:00
Tim Hunt
ba203de1d3 MDL-38582 testing: Let any component have a data generator.
Plus a simple core_question generator to test the concept.
2013-03-22 10:28:24 +00:00
Tim Hunt
cacb8fa08a MDL-34841 error importing questions with long names.
The problem was with the non-UTF-8-safe way that a question name
was being constructed from the question text.

I have done a proper fix with methods in the base class to
carefully construct a question name that is reasonable, and
which will fit in the database column. Then I have changed all
importers to use the new methods.

I also remembered not to break the lesson in the process.
2012-09-11 15:04:00 +01:00
Petr Skoda
603bd00112 MDL-32323 convert question tests
1/ type/match/tests/walkthrough_test.php - tests are failing randomly, looks like some weird randomisation is going on there - see TODOs

2/ type/multianswer/tests/upgradelibnewqe_test.php contains invalid expected value - see TODO
2012-04-10 15:27:11 +02:00