Quiz UI redesign - development

From MoodleDocs

Back to Quiz_UI_redesign


Before migration

  • DONE Make sure lines are short enough
  • DONE PHPDoc all files, preferably all functions
    • mod/quiz/addrandom.php Innapropriate copy-and-pasted comment at the top of this file.
  • DONE (2h) quiz edit view in case of attempted exam
    • DONE All buttons related to manipulating the exam are now disabled. They are not removed since we need to keep the user interface as predictable to the users as possible.
      • A violation to this rule are the module_specific_controls() module_specific_buttons() functions: I was not sure if it is OK to add the $hasattempts parameter to these functions since this callback seemed similar to an interface that should not be changed just like that.
        • quiz_question_list(): //TODO: is it OK to not show any module specific buttons if there are attempts?
        • quiz_question_list(): //is it ok to have this quiz-specific variable here in the first place?
          • DONE Tim> I think that the right way to do this is to add a $cmoptions paramter to question_showbank and question_list, that is then passed on to module_specific_buttons. That way the quiz can pass in anything it wants and get it back, without the question bank having to know about anything quiz-specific. / Repaginating is safe when there are attempts - for exmaple ti is safe to have attempts that radomise the order of questions. / It is just that repaginating will only affect new attempts that are started. Once an attempts is started, the order of the questions is fixed.
  • DONE CRITICAL What exactly does it prevent the user from doing to a quiz when it has attempts? Should repaginating the quiz be allowed if there are attempts? At this moment it is possible in the new ui.
    • Attempts only remove the possibility to add or remove questions: enable all other controls
  • DONE TODO: How to strip html tags the Moodle way, instead of strip_tags()? Need to do that in question bank window from $category->info. Perhaps found in format_text? stripping is necessary to keep the size of the display somehow controlled (no line breaks etc).
    • //TODO: in case of REALLY long question texts, find a reasonable number of characters to truncate to so that it is still enough to fill the tooltip? what function to use for truncating?
    • Tim Hunt> If you get data from a Moodle form, it should already be sufficiently cleaned up. However, if you get is as PARAM_RAW, then you have to output it using format_text to make sure it is properly cleaned. / This page attempts to explain the rules for outputting stuff: https://docs.moodle.org/en/Development:Output_functions / For the other part of your question, there is a shorten_text function in Moodlelib.php that should be HTML aware.
    • Olli Savolainen> that is good to know, too, though I will also need to strip_tags in order to not have
      s out, too...
  • DONE The hack in print_header needs to go. Acutally see (and vote for!) MDL-16151, which is something that has been needed for ages. weblib.php:2473
    • DONE, but crashes IE in the reordering tab
      • actually IE crashed as a result of a
        in a div, replaced that with
        and everything works
    • As soon as there is agreement about how JS should be included in Moodle 2.0, determine the appropriate locations for them in moodle 2.0
    • remove the hack to load css via javascript to hide the repaginating form
      • DONE The default stylesheet shows the repaginate form on the page. This needs to be hidden in javascript IN HEAD so that the code to change the CSS is loaded before the page is rendered - otherwise the form will flicker on each page load


  • DONE most critical issues here
  • DONE migration-time changes
    • DONE make CSS comply with moodle themes and UI guidelines; HTML/CSS design; work to get UI elements into the Moodle theming system or, when feasible, use what is already there. See also: [https://tracker.moodle.org/browse/CONTRIB-534 CONTRIB-534]
      • DONE Tim> mod/quiz/edit_redesign.css If this code gets released as part of Moodle 2.0, these styles need to be put into theme/standard, with its annoying division of CSS into different files for layout, colours and fonts, and separate files for browser-specific hacks.
        • Clean out old quiz CSS if it is in conflict?
    • DONE the strings in lang files should be sorted alphabetically, although I understand why you wanted to keep all the new strings separate while this was a patch.
  • DONE start migration from Moodle 1.9 to HEAD Moodle 2.0.

After migration: when the code is in HEAD

  • MOVED MDL-17409 change $string['questionsperpageselected'], $string['shufflequestionsselected'] to use $a for quiz settings
  • MOVED MDL-17294 quiz_print_singlequestion: //TODO: this should be a call to quiz_question_tostring, right? echo $questiontext;
  • DONE (it calls function quiz_questions_in_quiz()) quiz_number_of_questions_in_quiz: clean up the code, remove page breaks before counting
  • MOVED DONE MDL-17361 getting the default category and context for making categories for random questions. Currently works only if $mform->hardFreeze('parent'); is commented out in category_form_randomquestion.php.
  • MOVED MDL-17415 rights management: work with Tim to ensure nothing gets through which should not, and nothing that should get through is blocked
  • MOVED MDL-17397 CRITICAL There should be a link back to the current quiz from question bank (and a corresponding link to question bank on quiz in the same position on the screen, easily enough found). See also: Quick switch proposition
  • MOVED MDL-17417 (4h) Logging of every page view, operations, verify what else: addrandom.php, ...
  • MOVED MDL-17409 Is there something that should be taken into account for right-to-left languages?
  • MOVED MDL-17416 Clean up quiz layouts with extra page breaks for usage in a quiz: any in the beginning of a layout or consequent page breaks anywhere in a layout
  • MOVED MDL-17333 "Add new pages after selected questions" is tricky to express, it should really be "start new pages..." since it only creates really NEW pages if there already was a page break after the selected question

Delegate: Tasks not part of this project, no action required

Create bugs into tracker where appropriate.

  • DELEGATE/report a bug (ask Tim): if quiz has been attempted, make the choices available automated as possible for the user, as follows. I think this would be of tremendous benefit, as also various messages in the quiz forum show this is a real issue: see Quiz_Usability_portal/Attempted_quiz_enabling
  • (1d) No. 27
    • Issue: The user was unsure of whether the random question actually randomizes between the questions, since single question preview for random questions was broken
    • Even if the random question has only two multiple choice questions, it still is broken, so the but is not about essay questions. the preview window displays an sql error.
    • Solution: fix preview for random questions; this may be related to the quiz having empty questions
      • Olli> I noticed that there is no single question preview for random questions in the old UI, and thus I gather that random question preview not working in the new UI is not an issue of the new UI but something that never existed. It is absolutely crucial to get this working to keep the UI consistent and to help users understand how random questions work (-> add a button in the popup saying "Refresh (randomly select another question)", but it I am not the one to fix this since I don't know the underlying issues. Tim?
  • question/category_class.php question/category_form_randomquestion.php A lot of these changes are related to the quiz UI, although they are also related to random questions. Do they really belong here, or would they be better somewhere in the quiz?
    • question/category_form_randomquestion.php can probably be moved, but do you mean changing question/category_class.php by extending the class and moving that inherited class to mod/quiz?
    • delegated to Tim to work on separately
  • 'If we are talking redesign, I would really like to see the "Description" question type renamed to "Label" as this is the standard Moodle term in courses for this functionality. It is one less thing teachers would need to learn as they know what Labels do already.'
    • Indeed, this seems to be a source of confusion for many. What would be the "procedure" for changing something like this?
  • Tim> On the quiz settings form, we should change the "Questions per page" caption to "Automatic page breaks" with options "Never", "After every question", "Every 2 questions", ... I don't think we need to give every single option up to 50, either! -> OK, so "Automatically start a new page"
  • "The current 1.9.2 version and earlier ones had a nasty habit of making quiz items inaccessible to other quizzes if they were created within a quiz, rather than using the Question link in the admin panel. That seems to have been cleared up with this revision. Wonderful!"
    • I have no idea? This may be a bug covering another bug? Does someone know something about the reasons behind this kind of behaviour in 1.9.2?
      • DONE by Tim already in 2.0 HEAD to settings form (update this quiz)

Remaining questions

  • DONE, IT'S OK. quiz_print_randomquestion, quiz_print_randomquestion_reordertool:
    • TODO: I am bad with contexts so I left this out from the below get_record call:, 'contextid', $contextid
  • DONE quiz_process_randomquestion_formdata:Tim: print errors here..? -> see http://tracker.moodle.org/browse/MDL-17294
  • //TODO: Tim? remove showbreaks since it is no longer used (the parameter in quiz_print_question_list())
  • DONE, YES. Tim: After the code is in HEAD, will all changes need to be related to individual bug reports in the tracker?
  • Since it seems that in more recent versions of moodle question editing in an attempted quiz has been made possible, so I don't see the purpose for the elseif part of the following?
            if (question_has_capability_on($question, 'edit', $question->category) || question_has_capability_on($question, 'move', $question->category)) {
                echo "<a title=\"$stredit\" href=\"".$questionurl->out()."\">".question_tostring($question,false).'<span class="editicon">'
            } elseif (question_has_capability_on($question, 'view', $question->category)){
                echo "<a title=\"$strview\" href=\"".$questionurl->out(false, array('id'=>$question->id))."\">".
    • Tim said: There is a separate view page
      • why is it needed in addition to preview?

Changes based on usability testing


  • DONE No. 16
    • Issue: While trying to add questions to random question, the user made a new random question with a parent category of the previous random question
    • Solution: Make the random question dialog select the top-level category by default, not the currently selected category of the question bank window.


  • could probably just use unset($array[$i]) in many places in edit.php where it now uses array_split or array_splice (still using that one somewhere?)
  • (1h) Enlarge the basic ideas of quiz -help text link

  • DONE Issue: The user seemed to assume that the different controls for adding different types of questions are related to the same operation.
    • Solution: clearly separate from the two other buttons the title, dropdown and possible button of creating single questions by grouping them together?
    • Solved by MDL-18355 , hopefully

  • DONE (1d) No. 21
    • Issue: The user tried to move the YUI dialog window in order to make sure what the category was s/he was trying to add a random question into (that is, the user thought s/he needs to add a random question in the existing random question category in order to get questions in there.)
    • Solution: Make the YUI dialogs movable.
      • BUG: the option for making movable has been enabled and drag and drop module works by itself on the page, but the dialog still is not movable
        • Apparently was a bug in Moodle 1.9 or the YUI version therein, since in Moodle 2.0 dNd works

  • DONE (in English): (1h) No. 35
    • Issue: The user did not understand the concept of quiz pages, but wondered if the paging was for making the quiz printable
    • Note: The user also commented that s/he was searching for a general help where s/he could look up such a concept of a page
    • Solution: Document the paging in “Basic ideas” help dialog

DONE * No. 36

    • Issue: The color of the reorder text box was misleading, the user did not identify as text box.
    • Solution: change colouring, make a select dropdown?
    • Related: 42

  • No. 47
    • Issue: After the user saw the "add new pages after selected questions" button s/he selected all the questions, thinking that a page will be added only after the last of them.
    • Solution: change the wording. this issue may only be there in finnish.

  • No. 51 - TODO: make ticket
    • The user clicked the "Lisää uusi sivu valittujen kysymysten jälkeen" button without selecting any questions
    • Solution: Either add a notification that you have to select some questions, or add a new page anyway at the end?
    • Or, could you just use JavaScript to disable the button until something is selected?--Tim Hunt 21:46, 23 September 2008 (CDT)
      • You could, though there is a risk that the user does not understand what is the state of the application that causes the button to be disabled.--Olli Savolainen 05:24, 26 September 2008 (CDT)

  • No. 52
    • Issue: The user selected all questions except the first one and clicked "järjestä kysymykset" ([re]order questions), causing no reaction by the application (except reordering questions. s/he said s/he expects the, to be moved to the page 2.
    • Solution:
      • If user tries to move questions from a page to the same page, do not alter the order.
      • DONE Separate the functionalities (buttons) of reordering and moving on different pages.

See also: Quiz_UI_redesign/usability_testing_of_August_2008/Summary_of_solutions


Blockers of migration

  • DONE complete the status bar to have what's relevant from quiz settings (it is full but more could be needed)
    • DONE exam total points
  • DONE quiz grade display and changing
  • DONE repaginate
    • hide the repaginate dialog button for non-js users
  • DONE (2d) Tim> By the way, the new interface for adding a random question to the quiz does not work for me. The form appears, but I get an error when I click submit.
    • I can reproduce this now. the submit button does not work, it gives a strange "H is undefined" error, both in add random question and the new repaginating dialog --Olli Savolainen 09:08, 26 September 2008 (CDT)
      • FIXED: it seems the default way of submitting forms for the YUI dialog is an asynchronous ajax call, and that is what is was trying. Added 'postmethod: "form",' to the form attributes and now it seems to work, though on IE/Opera the dialogs are still broken.
  • DONE repaginate: should NOT set the questions per page to true OR should be labeled the same and have a clear cancel other than the dialog itself.
    • FIXED: uncoupled the settings: repaginate does NOT set questions per page - otherwise, you could repaginate the quiz, move some questions on other pages and find that the quiz has not registered your changes, and the reason is not obvious, since you did not command it to stick with the questions per page, you just issued an one-time command to repaginate.
    • FIXED: questions per page set -> repaginate disabled
      • added an additional notice to the paging tab if the application is in this state


  • if user has edited a form in the page but then presses the submit button of another form, confirm? In what form should this confirmation be?
  • MOVED MDL-18837 tooltips - firefox 3 shows long tooltips by default, do we still want advanced js tooltips? probably.
    • add tooltip: the category of a single question in quiz
    • quiz_question_tostring(): //TODO: add tooltips to show the full size name and text (and other content, such as multiple choice options?)* No. 40 Quiz_UI_redesign/usability_testing_of_August_2008/Issues
    • tooltip (or question mark help popup link icon) to assist users in using the reorder functionality by writing numbers in text fields
  • Issue: The user commented that it would be easier if s/he could move the questions like other elements are moved in moodle course front page
    • Solution: Do it, this is important for Moodle's internal consistency
  • communicate all error states to user
    • with command buttons that operate on checkbox-selected questions, add a javascript check + alert if no questions are selected
    • add a quiz-wide notice to the quiz edit ui status bar to notify if any question is in a nonfunctional state
    • ABSCRITICAL (copied) a random question category has fewer questions than there are questions in quiz
    • when category does not contain questions usable for random questions, instead of just hiding the random question adding UI in the question bank window, add a note "Category contains no questions that can be used for random questions."
    • when deleting questions from a random question, add an additional warning in case a random question becomes unusable due to this
      • since empty random questions can now be added though straight to a quiz, this behavior (disabling adding random questions) makes the UI inconsistent in the first place.
    • "the question you tried to add is already in the quiz"
      • add instructions: "if you want to duplicate a question, ..."
      • preferably disable the add question link altogether for questions that cannot be added to quiz since they are there already.
    • move selected questions to page x: "the page you entered does not exist in quiz"
    • repaginating tool: as the questions have been reordered in the settings, this tool has no effect
    • warnings for 0,1,2 questions in random question's category
    • in the edit UI, add an error message for each random question, the category of which contains insufficient questions for the quiz (include question types that cannot be used for random questions in this count)
      • remove this warning from the quiz preview and quiz attempt itself
    • if the Shuffle answers/Shuffle within questions setting is set, have a warning in the question box of every question this affects in the edit tab
    • Making sure that "unfinished states" of quiz are handled correctly:
      • ABSCRITICAL an empty page in the middle of a quiz,
      • an empty random question,
      • questions with dysfunctional states (multiple choices with no choices etc.)
    • quiz_print_randomquestion(): TODO: the category may have questions, which are unusable, which do not show among the questions in the list. This should still be reflected in the broken state of the random question and thus, the entire quiz, and communicated to the user.
    • a random question category has fewer questions than there are questions in quiz


  • add a skip link above the question bank since in the html source order it comes before actual content (quiz)
  • (4h) keyboard usage
  • consider changing question editing links consistently to only edit icons and not, after all, links with content as the question name+text:
    • PRO: consistency: edit icon is widely used in quiz and also moodle (?)
    • PRO: currently, the edit tab and the question bank has links, but the question bank also has a form so the <label>s which are at the same time links do not work as labels. if the link were removed,
    • CON: for disabled users, all links should have contain information about where exactly they point, and if the content for the icon is only an edit icon, the link is not self-contained but the user has to depend on context - which is not always available - to determine where the link goes.
      • Solution: the alt text for the edit icon should have the question name and part of the question text
    • CON: the link is arguably the most basic element on the web and is very recognisable. For moodle novices, the edit icon is not obvious and will take a while to find
      • Having the edit icon in the tab label alleviates this, as users can associate the icon with the concept of editing already when looking at the tab label
  • turns out that a hidden version of a submit button makes the browser treat it as the default submit button if the user presses the enter key. the user has no reason to press the enter key except in the text fields related to the "savechanges" button, so that is what we will use TODO: reportedly this does not work on IE7 so would require javascript; http://blog.aujava.com/?p=28 <- convert this to YUI, please, OR http://p2p.wrox.com/topic.asp?TOPIC_ID=27961 http://www.devx.com/vb2themax/Tip/18846
  • MOVED Verify that the subtabs really are more clearly visible in the default theme in Moodle 2.0
  • quiz edit sisältö oikeinpäin: negative margins tai YUI grid


  • if there are different question types in a random question category, report this
  • add a save all grades -button in edit tab
  • DONE empty random questions: add link to open question bank if question bank is not open: "you can add questions to the category in the question bank >>"
  • (4h) //TODO: add javascript quick hiding/showing question bank menu by adding the now-html-commented id's to the elements - requires submitting the GET parameter accordingly in the background and returning false for the link so the browser does not actually GET it
    • http://developer.yahoo.com/yui/connection/
    • TODO: add javascript quick hiding/showing question bank menu by adding the now-html-commented id's to the elements requires submitting the GET parameter accordingly in the background and returning false for the link so the browser does not actually GET it and adding an entry to the browsing history or just taking the get parameter out of the url so bookmarking won't hurt? and perhaps add a get parameter to tell the server to not send a reply page -- the benefits of all this work are starting to seem neglible.. DONE: make make hiding possible without javascript
    • quiz_question_tostring(): TODO: determine if there are more complicated error states for some question types, i.e. multiple choice needs to have some number of options to work, and report about them here.
  • edit_redesign.css: TODO: why isn't the underline showing for single question edit links?
  • edit_redesign.css: TODO: add a class so that the modifications to main CSS won't go on any other pages
  • edit_redesign.css: TODO: test for IE writing-mode: tb-rl; filter: flipH flipV; for div.quizpage span.pagetitle, div.editq span.pagetitle
  • add link to question bank when random question has more than the questions shown in the random question box: Total of [link]19 questions[/link] in category
  • in question bank, if the question name is long (and it does not have to be very long) question text won't be shown.

Missing other changes


  • If the user has set "Questions per page" in the settings (update this quiz),
    • DONE the functionality for paging should be disabled (greyed out)
    • DONE a warning should be shown on the reorder&paging page explaining why paging cannot be edited
    • the paging displayed also on the edit page should be according to that setting
  • If the user has set "Shuffle questions " in the settings (update this quiz)
    • DONE the ordinals of the questions (implying specified order) should not be shown but a * in their place
    • DONE (only "Reorder questions" disabled) the functionality for moving questions should be disabled (greyed out)
    • a warning should be shown on the reorder&paging page explaining why question order cannot be edited
  • There should be at least some level of consistency with the actual question bank and quiz edit tab/question bank window.
  • help-icons: Add help icons in appropriate places; add labels to icons where testing shows it is required; write further relevant documentation to Docs
    • bring back contextual help icons where appropriate


  • Feedback about reordering, grading questions
  • (1d) separate the buttons for reordering questions and moving to other pages
  • 8. You probably need to change your print_box_start(); call around line 570 of edit.php to print_box_start('generalbox clearfix');
  • Empty random questions: it should be an error in the editing interface, and invisible in the actual quiz when it is being taken/attempted: that is, as you can create a random question right into the new category, as long as there would be such empty random questions, there would be visible warnings that the quiz is in an unfinished state in the editing UI - but this should not have any negative effect in quiz taking, the question should just be absent (except perhaps in teacher preview, where the difference with the teacher preview and the actual quiz should then be made extremely obvious)
  • reordering/paging tab: color selected questions with javascript
  • add a semantic CSS class to the edit icons in reorder tab (or remove the preview css class and change it to something more general like "questioncontrols")
  • question bank: if the question name is long, the question text is not visible
  • increase default width for page numbers so it is same for all pages
  • add cancel button in YUI dialogs
  • grey out select all / none texts in disabled form due to $hasattempts
  • add phpdocs in new functions
  • quiz_print_randomquestion(): TODO: optimize: simple_question_list could perhaps just return questioncount instead of checking db separately
  • TODO: make the page number visible the add random question dialog so that the user knows the state of the app: which page s/he is adding a random question on. both javascript and non-javascript dialogs.
  • make the strings for question count and total of grades use $a in language strings
    • include the mention that the question count includes descriptions
  • shorten random question name in random question box to 1-2 rows worth of characters/words
  • make quiz_print_randomquestion() use $a in the string fromcategory
  • http://tracker.moodle.org/browse/MDL-17296 the quiz status box should be semantical html, that is, an unordered list styled with CSS.
    • the wording of the quiz opening status is in some cases too long. give it a line of its own?
  • random question dialog launch button: TODO: can't use print_single_button since YUI implementation requires ids for form and submit button and a class for addonpage_form hidden element
    $CFG->wwwroot."/question/question.php", array(addonpage_form=>$pagecount,cmid=>$quiz->cmid,courseid=>$quiz->course,returnurl=>$pageurl->out(true),"appendqnumstring"=>"addquestion", "category"=>$categorystring,"qtype"=>"description"),
    ,'get','_self', false, '', false, '',
    'addrandomdialoglaunch_'.$pageco Total of grades:  15 |  Questions: 16  |  This quiz is open.
Update this Quiz: Shuffle questions: No | Questions per page: 1 unt,'randomquestionform');


Blockers of migration

  • DONE delete selected questions deletes wrong questions
  • DONE handling cases where the layout only has empty pages
  • DONE In IE, overflow:hidden; white-space: nowrap; does not work.
  • DONE In IE, single questions have wrong cursor.
  • DONE - still needs to be incorporated to the actual moodle ie CSS file (added IE-specific CSS to hide the icons) IE css: tab icons break the layout


  • the question bank window does not preserve category when switching from edit view to reorder view
  • storing operational parameters in url is a fatal usability error: a user may reload a page after deleting a question and, without realizing it, delete another question from the quiz. - partially fixed, by forwarding if $significantchangesmade
    • //TODO: make redirect independent of whether a form was submitted or not - if there are any consequential GET parameters in the url, they need to be cleared from the url
    • //TODO: redirect to this page with no operational GET params (test if bookmark delete bug exists) - should we redirect in other cases too besides $significantchangemade?
    • //TODO: there should be a get parameter to notify the users of what changes were made but that might be bookkmarked? so POST? or sessionvar?! always redirect after successful action so that accessing bookmarked page or reloading won't result in accidentally redoing the action. of course a reload is kinda inefficient...
    • It seems that the markup/css for building the tabs is buggy on IE since it does not allow the icons. The purpose for the icons in the tabs is to allow users to unobtrusively learn the meanings of icons used also elsewhere in the UI
  • DONE (). It still lets me add questions even though the "You cannot add or remove questions because there are attempts." message is displayed. Also, when that message is displayed, the stylesheet is not used so the layout is messed up.
  • DONE Adding a page on edit tab can add two pages at once
    • This seems to have been caused somehow by the error reporting in debug mode. Once the database errors at the beginning of the page were fixed, this got fixed too. I do not know why the error reporting produced this bug, possibly because the page reloading/redirecting worked differently?
  • DONE Opera9.27 YUI order&paging dialog broken, fallback disabled
  • DONE add random question fallback has PHP errors


  • DONE IE6 YUI dialog broken: fallback works
  • DONE Opera9.27 YUI add random question dialog broken: fallback works
  • DONE 80 characters/row, 8 spaces before extended lines
  • DONE SQL error new question_category_object()
  • DONE 3. Line 249 of mod/quiz/edit.php (an example of a line that is too long!) refers to $param->..., but I can't see where this is defined. Looking at the code being called, these parameters don't seem to be used. Oh ... 4. I did not know about the PHP compact function. It looks dangerous to me, because it makes it hard to see where a variable like $currentcat is used. I would stick to the more verbose array('currentcat' => $currentcat, 'contexts' => $contexts); 5. And it is this undefined variable that is giving me SQL errors like
  • DONE In random question adding dialog: "Create a category for a new random question" -> "Create a category for the new random question"
  • Random questions's preview icon in reorder view go out of size when viewport size is less than 1000px if question bank window is open


Blockers of migration

  • DONE make sure the labels on the add random question fallback page are identical with the actual dialog
  • DONE tabs -> spaces
  • DONE In popup_form, the line "$submitvalue=$go;" should be outside the inner if statement.
  • DONE (but CSS will need to be migrated to moodle 2.0 code)7. The way to get extra stuff, like links to stylesheets, included in <head>, is to pass extra HTML as the 5th ($meta) parameter to print_header_simple.
  • DONE new essay icon in project directory
  • DONE (moved to a separate patch, bug forthcoming maybe) print_paging_bar - are these changes really relevant to the current project? If they are a separate thing, probably better to file a separate tracker bug and patch for these.
  • DONE mod/quiz/addrandom.php - You have an unnecessary ?><?php near the end.
  • DONE mod/quiz/edit_redesign.css I note that you have comments in here for things that need to be tested. That would need to be done before 2.0
  • DONE mod/quiz/edit_redesign.css You should normally be able to avoid using !important by using appropriate selectors.
  • DONE mod/quiz/edit_redesign.css You have some empty rules, which should be cleaned up.


  • //TODO: Clean out extra HTML clutter from here; create a weblib wrapper function(s) for hideable side_block?

Under consideration

  • Create new category in quiz edit screen's question bank window
  • Possibly, moving questions between categories (not sure yet if this needs to be supported in the Quiz editing screen)
  • Tim> Is drag-and-drop reordering on the todo list? and have you looked at how re-ording activities on the course front page works? Again, changing that may be something for the future.
  • Tim> I am not convinced by the repeated IU elements at the top and bottom of the reordering page. They look silly on very short quizzes, and are not really enough on very long quizzes.
    • Olli> Any ideas?
  • ask Tim: the question deleting md5 check still unclear http://moodle.org/mod/forum/discuss.php?d=102062
  • in random questions added directly to quiz, what should we choose as a value for recurse?
    • should this be an option in the random question dialog?
    • paging of items if there are >30 (Fluid allows to "Allow users to break up long lists of items into separate pages" - try this out?)
    • how to make string changes go upstream?
      • (As it says in the Moodle coding guidelines) you should never change langauge strings. This is because the same language packs are used for all versions of Moodle. If you need a different string, create a new one.--Tim Hunt 08:41, 2 July 2008 (CDT)
        • Hm the thing is, if a translation does not make sense in a specific language, or if I know that a string is indeed intended for this specific button, but usability-wise/grammatically it is not the best choice? Still just create new ones?--Olli Savolainen 12:31, 2 July 2008 (CDT)
  • (2d) Issue: The user did not notice that the question bank category changed when s/he selected the random question
    • Solution: Make the toolbox react to changes more noticeably. Show a "loading" animation in the question bank window if it changes. This might be done perhaps even with an absolutely positioned div with a partially transparent animated GIF. The problem is to only show the loading animation when the category is changed, not on every page load. Events to react to: changing category from the bank window or by selecting random question from quiz, adding a question to a category...
  • If the user clicks add a random question before the page has finished loading, the javascript may not have been activated yet and thus the fallback of going to the separate page is activated. This brings inconsistency to the user experience.
  • when adding a question from a quiz directly a category is not and should not be specified by default, but the user should be made to select a category in the question edit screen. they may select default for everything and it is not much of a hassle, but they will be at least faintly aware of the existence of categories. (for now the default category is selected by default)


  • Random questions
    • is it possible to have an empty random question in quiz?
      • Basically no, or at least it is possible, but it leads to an error. This situation can be represented in the database, and you can even create it through the current UI (add a random question from a category, then delete all the questions in that category). However, this will lead to an error when you run the quiz.--Tim Hunt 08:41, 2 July 2008 (CDT)
        • Thanks Tim. What I am thinking is it should be an error in the editing interface, and invisible in the quiz: that is, as you can create a random question right into the new category, as long as there would be such empty random questions, there would be visible warnings that the quiz is in an unfinished state in the editing UI - but this should not have any negative effect in quiz taking, the question should just be absent (except perhaps in teacher preview, where the difference with the teacher preview and the actual quiz should then be made extremely obvious)?--Olli Savolainen 09:41, 2 July 2008 (CDT)
        • That is: do you think we (I) should a) Modify the current empty randomquestions to notify of their state appropriately or b) create a new structure that stores the states of empty random questions in the new editing UI and then only create actual random questions when the user adds questions to them. This brings us to the question: what would then happen if the user again removes all the question from a random question category?--Olli Savolainen 04:35, 3 July 2008 (CDT)
    • replace tabs with 4 spaces, eclipse PDE seems to not obey this very well
  • More: project tracker: http://tracker.moodle.org/browse/CONTRIB-528


  • New question bank window
  • keep cmid ALWAYS along in the urls (?)? -done
  • add page count -done
  • Storing the question bank window - completed, using set_user_preference()
  • //TODO: make the actual question bank hiding possible without javascript - done, currently only without javascript
  • question box layout: ensure line breaks don't break the layout unusable -- done, css overflow:hidden;white-space:nowrap;
  • add correct parameters (no id) to add question form from quiz -was bug, fixed
  • Find out about $pagevars, do I need to extend them, where's the documentation?
  • abstract random question category creating into a function which both the AJAX-style and the traditional version can use
  • even if there are no questions, show an empty page to which add questions
  • different presentations for random questions and other questions
  • Paging and reordering tab
    • Add: Repaginate with N questions per page
    • clean up the old tabs
    • add delete page 'X' -> "Are you sure? There is no undo for this." DONE (added deleting pages only for empty pages, no confirmation)
    • make forms functional: question scoring, new question/randomq/description formslib
    • add help dialog: basic concepts of quiz
      • //TODO: something in the javascript broke and questions are being added not on the right page, but to the end

No action required, settled in October 2008

  • CRITICAL Deleting/hiding questions: In the old quiz UI's question bank column, there are the checkboxes with the delete button and the "X" links to delete individual questions. I had assumed that they do the same thing: delete the question. But no, the link
    • only hides (archives?) the question
    • a question deleted this way can be restored only if the "show old [archived? hidden?] questions" is set, using the restore [undelete? unhide?] link that is in the place of the "X" link for "old questions".
      • alas, if there is any discussion/documentation/faint memories about how this came to be the situation, I would like to hear about them, as to make the decision which one the new UI should use, or should it for some reason have both the ways? in any case, the labeling is currently so inconsistent that something has to be changed.
      • I was mistaken. Only questions that are in use and cannot be deleted are preserved, and they cannot be deleted. The behaviour between the two delete functionalities is consistent, after all. This is advanced functionality related to the question bank more than to the quiz and thus it is optimal to just have a single delete functionality
  • is it being planned to upgrade YUI js libs to the latest version or at least 2.5.2 which I am using? the dialogs produce a js error with the older version moodle 1.9 still uses, although the functionality itself still works.
    • Tim confirmed, it is upgraded
  • Unless the bug that makes random essay questions not work is fixed for Moodle 2.0, add a warning about it: MDL-8648
    • Will be fixed if technically possible, high priority for Tim
  • Should there be paging in quiz edit page after all? It is getting long but I am not sure if it is long enough.
    • the same number of questions should be visible in also order and paging, or none at all, or just separate setting?
  • TODO: are $category->name and $category->info have been cleaned up when being entered, before inserting to database? Just to make sure.
  • TODO: should we save the layout to db whenever it is changed by the quiz_clean_layout function, to make sure the commands issued the current page are in harmony with the structure in the db? that is: if the layout is invalid but fixed here for display, and the user issues a delete command, the delete command may be issued on a different question than intended since the actual quiz layout isn't like it is displayed? or should quiz_clean_layout be issued also BEFORE each command is processed?

Relevant development links in docs