Commit graph

1472 commits

Author SHA1 Message Date
Colin Chambers
96fc865427 MDL-46895 qtype_calculated_find_formula_errors not defined causes Calculated question type test to fail 2014-08-22 13:55:44 +01:00
Marina Glancy
6ee21ea1d0 Merge branch 'MDL-18014-master' of git://github.com/damyon/moodle 2014-08-19 16:57:05 +08:00
Damyon Wiese
d32bc7d655 MDL-18014 Atto autosave: Atto requires $PAGE->url be set or debugging is triggered
2 quiz tests are creating forms with text editors manually - they need to ensure a valid
$PAGE->url is set so they don't trigger debugging warnings from $PAGE->url magic method
called by Atto.
2014-08-19 16:02:14 +08:00
Marina Glancy
430529bde8 Merge branch 'MDL-18014-master' of git://github.com/damyon/moodle 2014-08-19 13:50:44 +08:00
Tim Hunt
f276267d93 MDL-44894 question editing: fix validation with odd permissions
For users with edit permissions, but not add permissions, it was
impossible to save the editing form. The validation assuemd this value
was present, but it was not. Other code checks this field too, so I
added it rather than changing the validation and all the other uses.
2014-08-14 11:25:18 +01:00
Damyon Wiese
8593521f4c MDL-18014 Atto autosave: Fix coding style issues 2014-08-14 12:42:46 +08:00
Damyon Wiese
2ba6706d12 MDL-18014 Atto: Autosave text every N seconds. 2014-08-14 12:41:55 +08:00
Tim Hunt
aa4dcee761 MDL-46681 qtype_multichoice: disabled unused options
For questions set to 'One answer only', the 'Clear incorrect responses'
and 'Show the number of correct responses' hint options make not sense,
and are not used. Hence we disableIf them.
2014-08-07 14:20:06 +01:00
Ankit Agarwal
82b3260eab MDL-46148 qtype_calculated: low-level defence against bad formulas
This catches things like:
 * Malicious equations coming from backup files.
 * Malicious equations in old questions in the database.
2014-07-10 17:55:11 +08:00
Tim Hunt
5c6c172033 MDL-46148 qtype_calculatedsimple: fix notice
... when adding a dataset with a formula error.
2014-07-09 13:47:48 +01:00
Tim Hunt
66de66fe6a MDL-46148 qtype_calculated: fix validation when importing.
In order to do this in a sane way, I cleaned up a lot of old mess,
inclduing:

1. Previously, qtype_calcuated used ->answeres when importing, and
->answer when saving the form. This was crazy, so I fixed it, and
stripped out the code that made the alternative variable name work.

2. Similarly, it could handle ->answer being either an array, such as
you would get form the HTML editor, or a simple string, which is what
you get form the form. I simplified that too.

3. Finally, I made import use a transaction around saving each
question, so we don't get half questions in the database when an error
occurs.
2014-07-09 13:35:09 +01:00
Tim Hunt
770d3ce426 MDL-46148 qtype_calculated: removed unused method. 2014-07-09 12:56:18 +01:00
Sam Hemelryk
95d294368f Merge branch 'MDL-46212' of git://github.com/timhunt/moodle
Conflicts:
	question/type/calculated/question.php
2014-07-08 11:43:09 +12:00
Tim Hunt
88ec9f308d MDL-46148 qtype_calculated: validate formulas everywhere. 2014-07-07 14:33:34 +01:00
Tim Hunt
155bc75472 MDL-46148 qtype_calculated: function to validate equations in text. 2014-07-07 14:33:29 +01:00
Tim Hunt
29005a5418 MDL-46148 qtype_calculated: Remove unused function. 2014-07-07 14:33:24 +01:00
Tim Hunt
44f726a7b1 MDL-46148 qtype_calculated: unit tests + fixes for validation 2014-07-07 14:33:20 +01:00
Tim Hunt
f4fe3968a2 MDL-46212 questions: add {} whenver vars are put into "" strings
Having had one subtle bug cased be this, I decided to do a search and
fix all of these.
2014-07-03 14:02:39 +01:00
Tim Hunt
0e30442ca8 MDL-46212 question editing: extra answer fields notice.
It turns out that PHP does not interpret "$field[$key]" the way we were
expecting.
2014-07-03 13:56:11 +01:00
Damyon Wiese
ca4f7f6105 MDL-45763 Question types: Allow saving '0' as question text. 2014-06-11 17:28:52 +08:00
Marina Glancy
5528117324 MDL-45763 question: fix SQL syntax for Oracle 2014-06-11 12:13:19 +08:00
Eric Merrill
516a3ddc76 MDL-45763 question: Correct random question text if set to true or false 2014-06-10 06:05:33 -04:00
Eric Merrill
a871a7a757 MDL-45763 question Random qtype should use '0' or '1' question text.
Some time ago, it when from using '0' for no-subcategories to blank.
Change to properly define '0' or '1', update old questions, and make
sure to fix newly restored questions.
2014-06-02 15:31:23 -04:00
Eloy Lafuente (stronk7)
f94891cc00 MDL-45503 upgrade: add v2.7.0 sep lines 2014-05-28 01:13:42 +02:00
Jean-Michel Vedrine
8974442b72 MDL-45686 qtype_multichoice get_num_selected_choices return wrong result 2014-05-25 09:11:33 +02:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01:00
Eloy Lafuente (stronk7)
538bf99ece MDL-45486 Bump all versions to planned release
This bumps all versions to planned 2.7 release
(2014051200) version and all the dependencies to
current 2.7rc2 (2014050800)
2014-05-09 02:12:28 +02:00
James Pratt
9b604f28d2 MDL-45114 quiz simulate report : multi-choice multi qtype response data
fixing download.
2014-04-19 15:04:16 +07:00
Dan Poltawski
72de455146 Merge branch 'MDL-45003-master' of git://github.com/jamiepratt/moodle 2014-04-15 10:33:30 +08:00
James Pratt
f4555f88c8 MDL-45003 qtype numeric : classify invalid response as no response. 2014-04-11 12:41:23 +07:00
James Pratt
1d75d9fe70 MDL-44981 quiz statistics report : Differentiating '0' and no response
in numeric questions.
2014-04-07 19:13:04 +07:00
Eloy Lafuente (stronk7)
96eead3f6c MDL-24408 Whitespace fix. 2014-04-02 03:14:36 +02:00
Oleg Sychev
92e83e2d0e MDL-24408 extra_question_fields: separate answer data creation code
Now any question using extra_question_fields can overload make_answer
(just as make_hint), instead of overloading whole initialise_question_answers.
2014-03-28 00:27:05 +03:00
Oleg Sychev
f0c6c18189 MDL-24408 extra_answer_fields: save_question_answers function
question_type::save_question_answers function added, supporting
saving answers and extra answer fields. It can be called from
save_question_options function for the questions, using
question_answers table. Special functions created for overloading
so that every question could tune it to it's own form.

Shortanswer qtype save_question_options() converted as a proof of
concept and for testing purposes.
2014-03-28 00:27:03 +03:00
Oleg Sychev
a68207b664 MDL-24408 extra_answer_fields: loading data to the question editing form
Now question_edit_form can load extra answer fields. If a question
type need to do something more complex for particular field, it
can overload added functions without duplicating other code.
2014-03-28 00:27:01 +03:00
Oleg Sychev
6276672854 MDL-24408 extra_answer_fields : get answers even if they miss extra data
Extra answer data may be optional, saving DB space - i.e. not every row in
question_answers will have respective row in extra answers table. Current
implementation of question_type::get_question_options() won't return such
answers at all. This commit fix that, changing join type for db query.

Also fixed coding style violation in the variable name in get_question_options.
2014-03-28 00:26:59 +03:00
James Pratt
49dda8fe6e MDL-44690 core_questions : amending unit tests
to use more human friendly format for submitted question type data.
2014-03-25 14:37:51 +07:00
James Pratt
58794ac948 MDL-44690 core_questions : download of question steps data as csv file 2014-03-21 12:32:00 +07:00
Tim Hunt
8011be189e MDL-33653 fix preview links on calc qtype edit forms.
Also, refactor how we render preview icons, to eliminate duplication.
2014-03-07 19:46:56 +00:00
M Kassaei
7756e2bc85 MDL-33653 questions, a way to save changes and continue editing 2014-03-07 12:42:51 +00:00
Tim Hunt
ccba5b8805 MDL-43749 normalise quiz database structure.
The sequence of questions that made up a quiz used to be stored as a
comma-separated list in quiz.questions. Now the same information is
stored in the rows in the quiz_slots table. This is not just 'better' in
a database design sense, but it allows for the future changes we will
need as we enhance the quiz in the MDL-40987 epic.

Having changed the database structure, all the rest of the code needs to
be changed to account for it, and that is done here.

Note that there are not many unit tests for the changed bit. That is
because as part of MDL-40987 we will be changing the code further, and
we will add unit tests then.
2014-03-02 10:00:40 +01:00
Tim Hunt
dfcaa2450c MDL-44288 qtype_calculatedsimple fix validation notice.
The notice happend if you clicked Save changes before Find the wild
cards {x..} present in the correct answer formulas.
2014-02-20 13:01:47 +00:00
Damyon Wiese
6071a209fe Merge branch 'MDL-44118_2' of git://github.com/timhunt/moodle
Conflicts:
	version.php
2014-02-19 09:08:42 +08:00
Eloy Lafuente (stronk7)
b9b38ea791 MDL-43265 question: incorrect closing parenthesis 2014-02-19 00:10:47 +01:00
Eloy Lafuente (stronk7)
8167063ac1 Merge branch 'MDL-43265_new' of https://github.com/jacks92/moodle 2014-02-18 23:55:52 +01:00
Tim Hunt
30de48d285 MDL-44118 drop old quiz/question attempt data.
This data should all have been upgraded when moving to Moodle 2.1. It
was only kept as a back-up, and now, after 3 years have past, we can
clean it up.
2014-02-18 11:55:26 +00:00
Damyon Wiese
d306807e02 Merge branch 'MDL-43479-master' of https://github.com/jamiepratt/moodle 2014-02-18 10:16:15 +08:00
Eloy Lafuente (stronk7)
f3da891068 Merge branch '44184-27' of git://github.com/samhemelryk/moodle 2014-02-18 01:50:24 +01:00
Sam Hemelryk
37fdd9c051 MDL-44184 qtype_match: fixed @package typo 2014-02-17 08:06:15 +13:00
Jean-Michel Vedrine
93a543938c MDL-27414 Upgrade the randomsamatch qtype to the new question engine
Added XML import/export
Different randomsamatch qtypes in the same quiz can now pick the same
shortanswer question.
Images are not preserved if shortanswer question is deleted after being
used in a randomsamatch attempt.
2014-02-14 16:53:04 +01:00