31 Commits

Author SHA1 Message Date
Safat Shahin
f9fc355ec7 MDL-71679 mod_quiz: Updates for new qbank api
This implementation will introduct changes to
the mod_quiz to implement the new qbank api
for view. Major changes are introduced in
the custom view and also all the legacy points
to the old qbank are changed to qbank plugins
where needed. It also deprecated and deletes
classes and scripts which were kept not to
break mod_quiz for the new api implementation.
2021-10-04 15:44:25 +11:00
Safat Shahin
0d55b26da8 MDL-71614 qbank_previewquestion: Add Preview question plugin to core
This implementation will introduce a qbank plugin "previewquestion"
which will view the preview question action in the question bank
actions by replacing the core classes, scripts and yui modules.
This plugin will also replace the preview option in the edit
question form. Having this plugin will give users the
flexibility of enabling or disabling this feature from
the question bank view.
This change will also allow other qbank plugins to add
elements or information in the preview question page
by implementing a callback. It also changes the pop
up to page redirect from base view page to make sure
any changes in preview reflects in the base view, for
example, comments added and the number of comments in
the comments colum changes while back from the preview
page. Other locations like edit and qtype plugins where
the preview is implemented, stays the same.

Co-Authored-By: Guillermo Gomez Arias <guillermogomez@catalyst-au.net>
Co-Authored-By: Safat Shahin <safatshahin@catalyst-au.net>
2021-09-08 16:21:06 +10:00
Tim Hunt
64207dab65 MDL-67183 questions: get_question & get_behaviour only init if required
This reviews all the code code, and sets $requirequestioninitialised
whenever possible in these calls, which should improve performance.
2020-05-19 20:52:07 +01:00
Shamim Rezaie
197e074eba MDL-53140 question: Support localised floats when previewing a question 2019-05-01 12:10:32 +10:00
Simey Lameze
10810f421b MDL-65050 core: move function code to question_preview_cleanup_task
This commit also deletes the legacy question_preview_cron() function.
2019-04-01 12:57:05 +08:00
Tim Hunt
29034c3eb3 MDL-57199 question preview: make HTML ids unique 2016-11-29 18:31:53 +00: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
2443f3d21d MDL-38490 question preview, variant is attempt (not display) option 2013-03-14 17:21:16 +00:00
Dan Poltawski
01dcd9d770 Merge branch 'MDL-35793' of git://github.com/timhunt/moodle 2013-01-15 12:56:51 +08:00
Tim Hunt
016a651578 MDL-37431 question preview: cron performance problem.
This query was performing badly. The solution seems to be to add a
redundant JOIN and WHERE to the subquery.

I renamed the table aliases in the subquery to avoid name collisions
elsewhere. I am afraid that makes the diff rather unhelpful. The
    AND subq_qu.component = :qubacomponent2
line is new. The other lines have just had subq_ added.
2013-01-11 13:18:21 +00:00
Tim Hunt
4125ded139 MDL-35793 question preview: config for the display options.
The settings control the display options used when a user
first previews a question in the question bank. Once a
user has previewed some questions, these are stored as user
preferences.

It may not seem worth making this configurable, but acutally
it is important when training new users to get them started
off using the right opitions.
2012-12-22 17:38:37 +00:00
Thanh Le
599cc731e3 MDL-35792 question preview: way to update options without restarting.
It is useful, and possible, to update the display options without
restarting the question. You now only have to restart if you are
changing the maximum mark or the behaviour.
2012-12-22 17:38:30 +00:00
Tim Hunt
97f1137a61 MDL-36806 question files: fix unnecessary require_login call.
quiz_question_pluginfile later does the correct check. Doing this
other check first means you get an error about changing $PAGE->context.
2012-11-23 15:54:58 +00: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
Rajesh Taneja
61cca0b7fc MDL-32940 libraries: Replaced deprecated PARAM_NUMBER with PARAM_FLOAT 2012-07-23 17:21:05 +08:00
Marina Glancy
2aad62e93c MDL-33467 fixed variable name conflict 2012-06-06 11:17:07 +01:00
David Mudrak
7a00d4385d MDL-32471 preview thumbnails support for other component types
This commit affects mostly qtypes. Other standard components either do
not have pluginfile handler or have been already updated to the new API.
2012-04-24 14:29:44 +02:00
Dongsheng Cai
d2b7803e5a MDL-30973 Files API, check and update DocBlock 2012-02-15 12:48:57 +08:00
Tim Hunt
079caafc16 MDL-31102 question preview: fix HTML validation errors. 2012-01-12 12:10:54 +00:00
Tim Hunt
7664182d7f MDL-29493 questions should be createable with defaultmark a float. 2011-09-23 12:55:01 +01:00
Tim Hunt
56a4ae4673 MDL-28074 question preview should set context/course/cm properly.
1. We need this so that, for example, when previewing a question from
the quiz editing page, the preview uses the filter settings, theme and
language set for that quiz and course.
2011-06-29 21:25:56 +01:00
Tim Hunt
612106b3a4 MDL-20636 fix URL handling for previews to always use Moodle URL.
Also, make the preview window big enough. #367
2011-05-27 11:49:23 +01:00
Tim Hunt
c014b989ba MDL-27649 Convert the calculated question types to use the new variants mechanism. 2011-05-26 21:53:47 +01:00
Tim Hunt
9c197f4445 MDL-20636 Fix some more codechecker issues. 2011-05-14 22:53:25 +01:00
Tim Hunt
f7970e3ca7 MDL-20636 Eliminate integer and boolean in PHPdoc comments. should be int and bool. 2011-02-23 16:25:25 +00:00
Tim Hunt
a17b297d60 MDL-20636 Add missing defined('MOODLE_INTERNAL') || die(); 2011-02-23 16:00:20 +00:00
Tim Hunt
7a7197482d MDL-20636 Fix if the use of the File API so images work in questions. 2011-01-13 18:35:57 +00:00
Tim Hunt
c76145d3e4 MDL-20636 Previewing a truefalse question in deferred feedback mode now works. 2011-01-13 18:35:43 +00:00
Tim Hunt
06f8ed54fd MDL-20636 More progress. 2011-01-13 18:35:34 +00:00
Petr Skoda
6bdfef5da9 MDL-24321 switching to standard stdClass() 2010-09-21 08:54:01 +00:00
Dongsheng Cai
fe6ce23489 MDL-16094 File storage conversion Quiz and Questions 2010-08-10 09:56:48 +00:00