Commit graph

2227 commits

Author SHA1 Message Date
Jean-Michel Vedrine
1ff3389a54 MDL-34808 qformat examview Add phpunit tests to examview import format 2012-08-19 16:35:21 +02:00
Jean-Michel Vedrine
8a8dd7d8c8 MDL-34738 qformat blackboard: blackboard format is broken 2012-08-18 10:55:26 +02:00
Tim Hunt
3e6b27698d 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-17 10:53:13 +01:00
Tim Hunt
423030e7dc 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 16:59:59 +01:00
Eloy Lafuente (stronk7)
4ee439dbc2 Merge branch 'MDL-34862_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-15 03:32:44 +02:00
Tim Hunt
94dd25e03b 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 17:44:17 +01:00
Tim Hunt
0a571db22b 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:29:43 +01:00
Tim Hunt
0b7dfe12ed MDL-34483 qformat_examview: Commit example file.
Supplied by Rick Jerz.
2012-07-30 11:57:29 +01:00
Jean-Michel Vedrine
e3f79e9347 MDL-34483 qformat_examview: handle more questions.
These fixes come from testing with the example file supplied by Rick
Jerz.
2012-07-27 12:20:13 +01:00
Jean-Michel Vedrine
0940ba1f16 MDL-34483 qformat_examview: clean the code to make codechecker happy 2012-07-27 12:20:11 +01:00
Jean-Michel Vedrine
53f2f306dd MDL-34483 qformat_examview: changes required to make it basically work. 2012-07-27 12:20:10 +01:00
Dan Poltawski
b165e64edc Merge branch 'MDL-34251_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-23 14:02:07 +08:00
Tim Hunt
2d7cbf5923 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:46:24 +01:00
Tim Hunt
0288eb2151 MDL-34226 multianswer qtype: basic unit test.
This verifies the previous fix, and gets rid of a rather embarassing TODO.
2012-07-19 12:46:12 +01:00
Tim Hunt
0656c0a403 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:46:11 +01:00
Aparup Banerjee
5f3d7b1949 MDL-26587 Question : fixed restoring shortanswer where answers are missing due to data error in mbz file. 2012-07-16 15:51:11 +08:00
Tim Hunt
69a600a067 MDL-34171 qformat_gift: Fix edge case with special character escaping.
We need to escape \ on export, because it is un-escaped on import.
2012-07-06 10:48:20 +01:00
Tim Hunt
b9c20952a3 MDL-34065 questions: also fix two typos in comments.
Amended to change 2 accordin => according
2012-07-05 13:50:21 +02:00
Tim Hunt
c57fa60f3d MDL-32062 question engine: fixup tests that this change broke.
The test data was wrong, and was triggering the work-around code that
MDL-32062 introduced. I fixed the test data.

Also, I fixed one of the tests, that had been broken.
2012-07-04 19:24:48 +08:00
Sam Hemelryk
848fc30a2d Merge branch 'MDL-32062_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-04 09:53:51 +12:00
Dan Poltawski
f224fd9498 Merge branch 'MDL-30883_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-03 11:01:44 +08:00
Dan Poltawski
9a211c853d Merge branch 'MDL-33780_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-02 16:07:32 +08:00
Aparup Banerjee
b574c078a6 MDL-34096 Installation : Added 2.3 upgrade line to db upgrade scripts. 2012-06-29 11:37:01 +08:00
Tim Hunt
5af6c9676e MDL-33780 question import: strip UTF8 BOM
Previously, if there was a byte-order mark at the start of the file, the
import would just break, which was silly. Much better to just strip it
off.
2012-06-26 10:34:19 +01:00
Tim Hunt
225e058685 MDL-30883 question flags: aria attributes for accessibility
Also, update code to use html_writer, and fix pointer style when not
editable.
2012-06-26 10:31:36 +01:00
Tim Hunt
3d348a3cc7 MDL-32062 question engine: fix re-grading attempts from 2.0
The code to upgrade attempts from before Moodle 2.0 to 2.1 created
attempt data that was not exactly the same as a new attempt created in
2.1+. This did not matter very much - revew and the quiz reports all
worked OK - but it broke on re-grade.

These changes detect the problem data in the re-grade code, an apply a
work-around so that the re-grade gives the correct result.
2012-06-26 10:11:37 +01:00
Dan Poltawski
3248a1e1e4 Merge branch 'MDL-33794' of git://github.com/stronk7/moodle
Conflicts:
	mod/assign/version.php
2012-06-18 16:08:39 +08:00
Eloy Lafuente (stronk7)
c5e783e512 MDL-33794 version.php: Bump all versions, requires and dependencies to 2012061700 2012-06-18 02:37:00 +02:00
Eloy Lafuente (stronk7)
130aed6e7e MDL-33794 version.php: Fix some missing bits before bump. 2012-06-17 19:29:44 +02:00
Tim Hunt
ba6425ab3d MDL-33779 question: code clean-up 2012-06-15 14:02:15 +01:00
Marina Glancy
c469b3963b MDL-33446 Editor form field can filter return types
- Added possibility for editor form field to specify return_types (default FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE)
- For assignment, workshop, quiz essay submissions and form posts do not allow FILE_REFERENCE
- Fixed mod_resource return_types, reset them to default, because filemanager does not know how to work with FILE_EXTERNAL links
2012-06-12 11:03:43 +08:00
Aparup Banerjee
42fd396171 Merge branch 'MDL-33548' of git://github.com/timhunt/moodle 2012-06-11 13:55:20 +08:00
Dan Poltawski
55244f8527 Merge branch 'MDL-33577' of git://github.com/timhunt/moodle 2012-06-07 23:15:45 +08:00
Tim Hunt
b84477000a MDL-33577 qtype_multianswer: Fix strict syntax warning. 2012-06-07 12:32:41 +01:00
Tim Hunt
ee326d5e7d MDL-33548 quiz manual grading: check the grade is in range.
To do this nicely, I refactored some code out of the quiz manual grading
report.
2012-06-06 20:21:33 +01:00
Marina Glancy
2aad62e93c MDL-33467 fixed variable name conflict 2012-06-06 11:17:07 +01:00
Dan Poltawski
995e479067 Merge branch 'wip-MDL-33338-master' of git://github.com/marinaglancy/moodle 2012-05-28 15:43:33 +08:00
Dan Poltawski
830fdc8ce8 Merge branch 'wip-MDL-33356-master' of git://github.com/marinaglancy/moodle 2012-05-28 15:37:31 +08:00
Dan Poltawski
ffec9bc70f Merge branch 'MDL-31393' of git://github.com/timhunt/moodle 2012-05-28 15:23:01 +08:00
Marina Glancy
4c2fcbfc85 MDL-33338 recognising the mimetype for uploaded files
- when file is uploaded in php, the tmpname does not have initial extension and mimetype recognition by extension fails
- another issue is that import form for questions fails with fatal error when it should just say that field is required
2012-05-28 15:19:41 +08:00
Marina Glancy
6adb5f1363 MDL-33356 fixed a regression after function form_filemanager_redner() was deleted 2012-05-28 13:52:32 +08:00
Dan Poltawski
8119141b91 Merge branch 'MDL-33020' of git://github.com/timhunt/moodle 2012-05-25 10:14:17 +08:00
Marina Glancy
559276b153 MDL-32247,MDL-32831,MDL-32900 Use correct url building of file type icons
- function get_mimetypes_array() now contains also information about filetype groups and language strings
- use 'smart' human-readable mimetype description
- never determine filetype group based on filetype icon image! remove function mimeinfo_from_icon()
- get rid of class filetype_parser and file lib/filestorage/file_types.mm, replaced with functions file_get_typegroup(), file_extension_in_typegroup() and file_mimetype_in_typegroup()
- support multiple icon sizes, not only 16 and 32
- retrieve filetype icon only using proper functions file_..._icon() from lib/filelib.php throughout the code
- increase size of repository thumbnails to 90 and icons to 24 (will take effect when new icons exist)
2012-05-21 16:01:04 +08:00
Sam Hemelryk
d5e6fe3ecc Merge branch 'MDL-32727' of git://github.com/timhunt/moodle
Conflicts:
	mod/quiz/db/upgrade.php
2012-05-18 16:07:20 +12:00
Aparup Banerjee
ffa7d1cda0 Merge branch 'MDL-32087' of git://github.com/timhunt/moodle 2012-05-17 17:17:37 +08:00
Dan Poltawski
aa141671a3 Merge branch 'MDL-31814' of git://github.com/timhunt/moodle 2012-05-17 14:11:14 +08:00
Tim Hunt
5ef18d8250 MDL-33020 qtype unit tests: improve failure messages. 2012-05-15 17:55:29 +01:00
Tim Hunt
4267fc5272 MDL-32727 quiz upgrade: sort out potential unique key violations
... before trying to create the unique index that should be there.
The violations may come from old buggy code.

We do two things.
1. First we delete all previews.
2. Then, if there are still problems, we renumber attempts to eliminate
the duplicates.
2012-05-15 15:23:53 +01:00
Tim Hunt
18056cd8dd MDL-32087 question preview: add a help icon to the technical info. 2012-05-14 19:26:06 +01:00
Tim Hunt
05a7d15511 MDL-32087 question preview: update the code to use html_writer. 2012-05-14 19:26:05 +01:00