98 Commits

Author SHA1 Message Date
Tim Hunt
a560d636f4 MDL-34399 questions: cache to help load question definitions.
At the moment, it takes several DB queries to load each question definition,
so this cache is potentially a big win.
2012-10-26 11:58:02 +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
Frederic Massart
21c08c63ca MDL-34458 Librairies: Replaced deprecated get_context_instance() 2012-07-24 16:58:17 +08:00
Tim Hunt
76cf77e4d3 MDL-32240 quiz editing: check permissions questions are added.
We also check permissions when removing questions from the quiz, so that
we do not let users make mistakes they cannot immediately undo.
2012-03-29 14:14:12 +01:00
Tim Hunt
51c5e6057c MDL-32239 question bank: wrong cap checks editing/viewing quesitions
None of these problems affect the default roles. They only occur when
the permissions have been edited to allow restricted subsets of the
question capabilities.

In some cases, things that the restriced subset of capabilities should
have allowed were blocked by errors. In other cases, users were allowed
to do more than they should bave been due to failures to check the
right capabilities in the right places.

For full details, see the bug report.

Two of the bugs were previously reported separately as MDL-26395 and
MDL-27232.
2012-03-29 14:14:10 +01:00
Tim Hunt
4bf1be3596 MDL-28437 Question bank pages should all use General type: admin. 2011-07-25 08:50:06 +01:00
Tim Hunt
9c197f4445 MDL-20636 Fix some more codechecker issues. 2011-05-14 22:53:25 +01:00
Tim Hunt
42663bb78e MDL-20636 Fix a bunch of missing strings caused by separating question from quiz. 2011-03-02 17:42:53 +00:00
Tim Hunt
5e8a85aa64 MDL-20636 Massively reduce the number of references to quiz in the question code.
This mostly involves moving lang strings around, but I don't have time to do an AMOS script now.
2011-02-23 18:53:50 +00:00
Tim Hunt
d3603157bf MDL-20636 Add @package and GPL boiler-plate to files in /question. 2011-02-22 19:59:12 +00:00
Tim Hunt
0ff4bd0877 MDL-20636 Fix new stdClass -> stdClass(), and trailing whitespace. 2011-02-21 18:10:19 +00:00
Tim Hunt
a13d4fbd20 MDL-20636 Fix lots of minor quiz editing glitches. 2011-02-11 17:36:30 +00:00
Tim Hunt
06f8ed54fd MDL-20636 More progress. 2011-01-13 18:35:34 +00:00
Tim Hunt
94dbfb3a82 quiz editing MDL-24750 The Add random button should also let you add questions from an existing category.
Also includes a fix for MDL-24749 by Sam Hemelryk. Thanks Sam.

This commit also includes a certain amount of code cleaning up.
2010-11-22 09:52:42 +00:00
Tim Hunt
5d548d3e0a question bank MDL-24995 clean up a lot of deprecated code to do with moving questions around.
This should also fix MDL-25172, MDL-23021 and MDL-23073. In other words, moving questions between categories should now work.
2010-11-11 21:54:22 +00:00
Tim Hunt
fde29fa59c quiz & qbank MDL-24453 some more return URLs that I missed the first time.
Also, fix a double-escaping bug when cancelling the form.
2010-10-18 15:53:54 +00:00
Tim Hunt
fb6dcdab11 quiz & qbank MDL-24453 fix all the ways you can edit a question, so that that returnurl paramterer acutally works.
I hope. Please test thoroughly.
2010-10-18 15:28:59 +00:00
Pierre Pichet
99d671ebd3 MDL-24249 adding an else if ($originalreturnurl && $wizardnow !== '') for multipage question edition 2010-09-17 16:33:23 +00:00
Tim Hunt
e934fa008b question editing MDL-23758 notice on clicking cancel. 2010-08-11 16:37:11 +00:00
Dongsheng Cai
fe6ce23489 MDL-16094 File storage conversion Quiz and Questions 2010-08-10 09:56:48 +00:00
Tim Hunt
90c7912e93 quiz editing MDL-22371 with JS off, clicking add question, then cancel, did not work.
Also, other simpilar issues with other buttons.
And, finally fix the absolute URLs being passed as returnurl. Apache mod_security did not like that.
2010-08-04 19:44:59 +00:00
Rossiani Wijaya
0f56fde284 MDL-20447 - bulk upload: add page heading 2010-06-02 06:13:27 +00:00
Tim Hunt
a27aa5c620 MDL-19967 No validation when adding a question with JS off.
There was no check that a question type had been selected.
2010-05-06 22:33:21 +00:00
Petr Skoda
b9bc201962 MDL-21233 escaped parameter is far more importatnt than the overrideparams in out() method - especially all JS urls should be converted to out(false); also it is possible to create new url with overrided parameters in constructor which might be actually work around the double encoding problems in the url (we should never use the out() in moodle_url constructor itself!) 2010-01-17 09:50:55 +00:00
Petr Skoda
340d461269 MDL-21233 simplifying moodle_url->out() api 2010-01-17 09:18:11 +00:00
Petr Skoda
a685593466 MDL-21233 moodle_url improvemewnts, code simplification, more diagnostics; fixed several regressions 2010-01-16 15:39:56 +00:00
Sam Hemelryk
d8ae33a95c question MDL-21169 removed update_module_button calls from question these are now added by the module extending the navigation if there is a module specified for question pages.
Also fixed bug in moodle_url object coding_error to coding_exception
2009-12-23 02:45:22 +00:00
Tim Hunt
7846a624d5 question editing: MDL-20380 Highlight the last edited question when you cancel the form too. 2009-11-19 17:59:54 +00:00
Petr Skoda
aeb15530b8 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-04 11:57:52 +00:00
samhemelryk
1d58b567be question MDL-19820 Replaced deprecated functions 2009-09-25 04:16:27 +00:00
samhemelryk
b0f4e4e442 questions MDL-20276 Fixed minor issue with URL handling within the paging bar for the question bank 2009-09-16 02:43:58 +00:00
samhemelryk
d412354cc6 question MDL-19820 Updated print_header and build_navigation to OUTPUT and PAGE equivalents 2009-09-07 02:36:39 +00:00
nicolasconnault
fef8f84e4b MDL-19822 Upgraded calls to helpbutton, print_simple_box* and notify 2009-08-18 05:19:00 +00:00
nicolasconnault
9b59580b36 MDL-19820 Converted all print_footer() calls 2009-08-06 14:19:16 +00:00
samhemelryk
7a567a92ba quiz MDL-17730 Fixed issues caused by escaped redirect urls 2009-07-20 06:52:40 +00:00
tjhunt
34a2777ccb themes: MDL-19077 new $OUTPUT->header/footer to replace print_header/footer.
Also, part of the change from weblib.php functions to $OUTPUT-> methods.

This is part of http://docs.moodle.org/en/Development:Theme_engines_for_Moodle%3F

This is a big change, and the result is not perfect yet. Expect some debugging output
on some pages.

The main part of these changes are that $OUTPUT->header now looks for a file
in the theme called layout.php, rather than header.html and footer.html. Also
you can have special templates for certain pages like layout-home.php. There is
fallback code for Moodle 1.9 themes, so they still work.

A few of the old arguments to print_header are no longer supported. (You get an
exception if you try to use them.) Sam H will be cleaning those up.

All the weblib functions that have been replaced with $OUTPUT-> have version in
deprecatedlib, so existing code will go on working for the foreseeable future.
2009-06-26 09:06:16 +00:00
tjhunt
aa9c6ecf02 question bank: MDL-18822 Highlight the last question you edited in the list
Helpful if you need to edit a lot of questions - saves you from losing your place.
Idea and patch by Oleg Sychev.
2009-06-05 08:30:53 +00:00
pichetp
3058e79d22 MDL-19213 testing ifthe wizardpage allows editng the tags 2009-05-21 12:19:45 +00:00
tjhunt
d529807a65 moodle_page: MDL-12212 kill $CFG->pagepath (use $PAGE->set_pagetype)
deprecate $PAGE->get_format_name (use $PAGE->pagetype)
deprecate page_id_and_class (use $PAGE->pagetype)
2009-05-06 08:38:55 +00:00
tjhunt
677f62b67a Update a comment as a test of committing via git. 2009-04-02 07:50:33 +00:00
tjhunt
50da63ebd9 qtypes: MDL-18711 Allow qtype plugins to have custom CSS and JavaScript on the editing page. 2009-03-30 09:15:46 +00:00
tjhunt
8ed358dbca qtype admin: MDL-16412 Enforce the allowed question types when a user tries to create a question. 2009-02-26 06:06:18 +00:00
tjhunt
cd120b2344 quiz editing / question bank: MDL-18355 Convert the add question drop-down to be a button that pops up a YUI dialogue.
That allows us to have a few sentences explanation of each question type, and is also easier to fit into a tight layout.

This commit should also fix MDL-18214 Layout screwed in Safari with long category names.
2009-02-25 07:14:03 +00:00
tjhunt
24e8b9b684 question bank: MDL-12719, MDL-15774, MDL-17105, and MDL-18174
These are all to do with the combination of the $form->category, and $form->categorymoveto fields on the question editing forms since Moodle 1.9. These are now resolved to a single ->category value in question.php, which simplifies the logic for the individual question types.

MDL-15774 and MDL-12719 errors editing Cloze question
MDL-17105 problems with qustion saving logic.
MDL-18174 'Select from subcategories' option not preserved when editing a random question.
2009-02-13 06:11:42 +00:00
tjhunt
c599a68240 question bank: MDL-12787, MDL-17870 field in the question editing form to tag questions, and load and save the tags from the DB. 2009-01-16 08:00:06 +00:00
tjhunt
fa583f5f6e quiz editing: MDL-17285 This is Olli Savolainen's new interface for editing quizzes.
This was started and usability tested as a Finnish Summer of Code project, and then Olli did further work on it in his own time to get it in shape for inclusion in Moodle 2.0. I reviewed all the code. There are a number of minor outstanding issues that will be fixed soon. See the subtasks of MDL-17284 for a list.

The goal of these changes is to:
* help teachers new to Moodle, so when they first see the quiz editing page, they don't go "Huh! What on earth am I supposed to do here?"
* help novice Moodle users understand and learn to use some of the more advanced quiz feature;
* but, without slowing down more experienced quiz users.

Naturally, with ambitous goals like that, we won't have managed to satisy everybody, but I think this change is a big step in the right direction.

There is extensive documentation on this project at http://docs.moodle.org/en/Development:Quiz_UI_redesign.
2008-11-20 06:59:11 +00:00
nicolasconnault
f34488b2e6 MDL-15102 Upgrade to DMLLIB 2.0. Needs further testing and bug-fixing. 2008-06-06 14:43:15 +00:00
dongsheng
0be2c85848 "MDL-14129, fix print_error call" 2008-05-21 07:53:23 +00:00
dongsheng
5a2a53316f MDL-14129, remove all the other error() call 2008-04-04 02:54:20 +00:00
jamiesensei
11a6096775 fixed closing of popup on saving question which was broken and also added closing of popup on cancel. 2007-09-27 08:17:09 +00:00