Commit graph

2217 commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
af08f5d0af Merge branch 'MDL-34430' of git://github.com/timhunt/moodle 2012-08-27 18:50:29 +02:00
Eloy Lafuente (stronk7)
d683fcdf98 Merge branch 'MDL-34993' of git://github.com/timhunt/moodle 2012-08-27 18:35:23 +02:00
Eloy Lafuente (stronk7)
4299f5f6a8 Merge branch 'MDL-35026' of git://github.com/timhunt/moodle 2012-08-27 17:53:59 +02:00
Eloy Lafuente (stronk7)
7f7cda07f2 Merge branch 'MDL-35003' of git://github.com/timhunt/moodle 2012-08-27 17:50:55 +02:00
Tim Hunt
19de315e83 MDL-34306 gift question format: allow import of general feedback
This change introduces #### as a separator for general feedback. You need
to add ####General feedback goes here as the last thing inside the {...}.
For example

// question: 123  name: Shortanswer
::Shortanswer::Which is the best animal?{
    =Frog#Good!
    =%50%Cat#What is it with Moodlers and cats?
    =%0%*#Completely wrong
    ####Here is some general feedback!
}

Note that this change is not entirely backwards compatible. It will break
any existing GIFT file where the character sequence #### us used between the
{} as part of the question. This seems highly unlikely.
2012-08-25 14:27:40 +01:00
Tim Hunt
aa9d6e4300 MDL-32464 qformat multianswer: fix missing include.
Also, add a sample file that can be used for testing, and add a unit
test to verify this is working.
2012-08-24 16:56:18 +01:00
Jean-Michel Vedrine
7ace84e069 MDL-25492 Blackboard V6+ question import is broken. 2012-08-24 13:27:45 +02:00
Ankit Agarwal
5fbe2118bc MDL-34549 libraries: Changing strictness of context::instance_by_id() when required 2012-08-24 11:30:35 +08:00
Ankit Agarwal
d197ea4300 MDL-34549 libraries: Replace get_context_instance_by_id() by context::instance_by_id() 2012-08-24 11:30:10 +08:00
Tim Hunt
ca9385682f MDL-34430 qtype essay: upgrade from MDL-31393 needs a progress bar. 2012-08-23 20:08:30 +01:00
Tim Hunt
e7a6779efb MDL-35026 qtype multianswer: misnamed string.
AMOS BEGIN
 MOV [questionnadded,qtype_multianswer],[questionsadded,qtype_multianswer]
AMOS END
2012-08-23 19:28:53 +01:00
Tim Hunt
2b3f70dbad MDL-35023 qtype calculated: fix strict syntax problem. 2012-08-23 19:28:38 +01:00
Tim Hunt
9c2e178e2f MDL-35003 questions: remove stray full stop after correct answer.
In a few situations, this full stop makes things a bit more grammatical,
but there are many other situations where it causes problems. So, on
balance we will remove it.
2012-08-23 19:28:20 +01:00
Tim Hunt
d2acbd1ad4 MDL-34993 questions: convert numeric fields to float on load.
NUMBER(X,Y) typically come back from the DB as strings. If you don't
convert them to float, then when you display them, it appears as
1.0000000, which is not normally what you want.

Also, increase the size of the field on the edit form, so if you
question does have default mark 0.1234567, you can see that!
2012-08-23 19:28:05 +01:00
Tim Hunt
93266d0fe0 MDL-31837 numerical tolerance: better handling of very small tolerances.
The changes between Moodle 1.9 and 2.1 made the marking of very small
answers like 10^-20 almost impossible. This change fixes it.

This fix is almost entirely due the the careful research of Pierre
Pichet, who carefully testing various proposals, and worked out that
this one seemed best.
2012-08-23 19:15:15 +01:00
Jean-Michel Vedrine
7263fd6c53 MDL-34738 fix for the problem found during testing : dat files not accepted on some servers 2012-08-22 15:19:54 +02:00
Dan Poltawski
29e8b15d83 MDL-34808 qformat_examview - increment version 2012-08-21 11:05:22 +08:00
Dan Poltawski
6a721e3ebb Merge branch 'MDL-34808' of git://github.com/jmvedrine/moodle 2012-08-21 11:00:38 +08:00
Dan Poltawski
115728888a MDL-34738 qformat_blackboard - increment version number 2012-08-21 09:56:29 +08:00
Dan Poltawski
2a455e13e7 Merge branch 'MDL-34738' of git://github.com/jmvedrine/moodle 2012-08-21 09:39:50 +08:00
Eloy Lafuente (stronk7)
2bdbe66264 Merge branch 'MDL-34810' of git://github.com/timhunt/moodle 2012-08-21 01:36:15 +02:00
Jean-Michel Vedrine
01ef6c815e MDL-34808 load sample xml file from fixtures in tests 2012-08-20 10:44:34 +02:00
Jean-Michel Vedrine
735702f62c MDL-34738 load sample dat file in tests 2012-08-20 09:41:02 +02:00
Jean-Michel Vedrine
9d06b9eef9 MDL-34808 qformat examview Add phpunit tests to examview import format 2012-08-19 16:30:27 +02:00
Jean-Michel Vedrine
17ab0e74f9 MDL-34738 qformat blackboard: blackboard format is broken 2012-08-18 10:36:02 +02:00
Tim Hunt
be77e9b6a8 MDL-34810 question bank: user prefs for some display options
The options that are remembered persistently are
* Also show questions from sub-categories
* Also show old questions
* Show question text in the question list
* Number of questions per page
2012-08-16 17:13:03 +01:00
Tim Hunt
2ec325c252 MDL-29847 question preview: garbage collect old preview data.
This adds cron code which looks for question previews that have not been
touched for more than 24 hours, and deletes them.

We try to delete previews immediately. For example if the user clicks
start again, then we immediately delete their previous preview. However,
we can't do that if they just close the preview window. Hence we need
some cron code to clean up old preview that have got left lying around.

Normally, this code will not have much to do, so it will be very fast,
so we can afford to run it every cron.

This has been implemented in such a way that in future it will be easy
to add other cron code to the question bank.

Sadly, to make this work on MySQL, we require a horrible hack in the
already hacky delete_usage_records_for_mysql function.
2012-08-16 17:02:01 +01:00
Eloy Lafuente (stronk7)
7ccede7af8 Merge branch 'MDL-34862' of git://github.com/timhunt/moodle 2012-08-15 03:30:56 +02:00
Dan Poltawski
06c548c783 Merge branch 'w33_MDL-34741_m24_yui2in3' of git://github.com/skodak/moodle 2012-08-14 15:33:10 +08:00
Tim Hunt
4c16e191e1 MDL-34862 question preview: improve preview ownership check.
Users should only be able to access their own quetion preview. In the
past, for reasons I can no longer remember, this was enforced
using the session. It is much better to set the question_usage to belong
to the user's context.
2012-08-13 16:53:15 +01:00
Tim Hunt
75d86b6fbc MDL-34807 question bank: navigation loses place.
The symptom is that where we are now is not shown in the settings
navigation. However, the underlying cause is that question/edit.php is
doing some crazy thing of its own to build $PAGE->url, rather than using
the one returned by question_edit_setup.

Not that this patch itentionally removes the returnurl param. It was
added as part of a big change MDL-20276, which I think just got this
detail wrong. That variable is never used.
2012-08-13 11:13:25 +01:00
Petr Škoda
7b66b651da MDL-34741 use 2in3 in question bank 2012-08-11 20:40:09 +02:00
Tim Hunt
453022307e MDL-34483 qformat_examview: Commit example file.
Supplied by Rick Jerz.
2012-07-30 11:57:36 +01:00
Jean-Michel Vedrine
3a24ae8b17 MDL-34483 qformat_examview: handle more questions.
These fixes come from testing with the example file supplied by Rick
Jerz.
2012-07-27 12:13:38 +01:00
Jean-Michel Vedrine
9c3afc5bb6 MDL-34483 qformat_examview: clean the code to make codechecker happy 2012-07-26 18:54:31 +01:00
Jean-Michel Vedrine
2562c138ec MDL-34483 qformat_examview: changes required to make it basically work. 2012-07-26 18:54:30 +01:00
Frederic Massart
21c08c63ca MDL-34458 Librairies: Replaced deprecated get_context_instance() 2012-07-24 16:58:17 +08:00
Dan Poltawski
5082d87c03 Merge branch 'wip-mdl-32940' of git://github.com/rajeshtaneja/moodle 2012-07-24 13:39:59 +08:00
Aparup Banerjee
acb88dbed3 Merge branch 'wip-mdl-32942' of git://github.com/rajeshtaneja/moodle 2012-07-24 12:14:17 +08:00
Rajesh Taneja
61cca0b7fc MDL-32940 libraries: Replaced deprecated PARAM_NUMBER with PARAM_FLOAT 2012-07-23 17:21:05 +08:00
Dan Poltawski
4f22bcbc41 Merge branch 'MDL-34066' of git://github.com/timhunt/moodle 2012-07-23 14:54:46 +08:00
Dan Poltawski
3fb8128fb6 Merge branch 'MDL-34251' of git://github.com/timhunt/moodle 2012-07-23 14:01:59 +08:00
Dan Poltawski
bdaff201bb Merge branch 'MDL-34226' of git://github.com/timhunt/moodle 2012-07-23 13:53:46 +08:00
Dan Poltawski
a5c8e33122 Merge branch 'wip-mdl-32945' of git://github.com/rajeshtaneja/moodle 2012-07-23 13:35:24 +08:00
Dan Poltawski
ed25f64642 Merge branch 'wip-mdl-30651' of git://github.com/rajeshtaneja/moodle 2012-07-23 11:22:06 +08:00
Petr Škoda
c8b3346cfd MDL-33180 delete the last traces of SimpleTest - ciao and thanks 2012-07-21 10:11:50 +02:00
Tim Hunt
dd7aa58386 MDL-34251 question engine: possible infinite loop loading usages
In the case where either a question_attempt had not steps, or a
question_usage had not question_attempts, the load_from_records methods
could get stuck in an infinite loop.

This fix ensures that does not happen, with unit tests to verify it. At
the same time, I noticed an error in the existing tests, which this
patch fixes.
2012-07-19 12:51:00 +01:00
Tim Hunt
be1d8ed194 MDL-34226 multianswer qtype: basic unit test.
This verifies the previous fix, and gets rid of a rather embarassing TODO.
2012-07-19 12:50:47 +01:00
Tim Hunt
c0a912e5ac MDL-34226 multichoice qtype: correct is_complete_response for multianswer
The multianswer qtype uses the multi-choice one, and the way it does its
responses array breaks an assumption that multi-choice was making.
2012-07-19 12:50:47 +01:00
Tim Hunt
a3e6ad77d2 MDL-34066 adaptive behaviour: refactor logic out of renderer.
These changes move the logic to the behaviour class, which is how things
should be.

It also makes it easier to re-use the code that displays the messages
like "Marks for this submission: 1.00/1.00. Accounting for previous
tries, this gives 0.33/1.00." in other places.

To try to make it clearer what is going on, I introduced a new class
qbehaviour_adaptive_mark_details to hold and document the data that the
behaviour needs to return, and the renderer can base its display on.

As far as my testing can tell (and there are new unit tests), this
commit does not change the existing behaviour.

This commit also replaces all the string concatenation that is going on,
which should help translators. At the moment, a few of the old strings
are still in the language file, and are used in the unit tests to verify
that the behaviour has not changed.

Thanks to Oleg Sychev for making a helpful suggestion about the API.
2012-07-19 12:50:17 +01:00