Issue Details (XML | Word | Printable)

Key: MDL-17362
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Tim Hunt
Reporter: Olli Savolainen
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-17284

Ajaxify the question bank window

Created: 23/Nov/08 01:54 AM   Updated: 23/Nov/08 09:47 AM
Return to search
Component/s: Quiz
Affects Version/s: 2.0
Fix Version/s: 2.0

Issue Links:
Relates
 

Participants: Olli Savolainen and Tim Hunt
Security Level: None
Difficulty: Difficult
Resolved date: 23/Nov/08
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
Make the question bank window of /mod/quiz/edit.php open/collapse via javascript, and save its state via javascript.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Olli Savolainen added a comment - 23/Nov/08 01:54 AM
Tim Hunt: "Look at print_collapsible_region_start in lib/weblib.php. In particular the calls to user_preference_allow_ajax_update and get_user_preferences, and then the calls to set_user_preference from the collapsible_region code in lib/javascript-static.js"

I tried using the print_collapsible_region_start directly, but

  • I have my doubts about the usability of having just a triangle after the text instead of a show/hide title.
  • it is not an option to have the window visible always when the user has no javascript, so that would need to still be worked around
  • when the question bank window is opened, quizwhenbankcollapsed class needs to be added to the div with id quizcontentsblock, to make the quiz contents expand to full width

The other option then, would be just to call JS set_user_preference() from the current implementation with PHP user_preference_allow_ajax_update() added.

In addition, the use cases of the question bank window suggest that collapsing and showing the window is not a frequent task at all, and thus it should not matter much if it is as slow as a new page load.


Olli Savolainen added a comment - 23/Nov/08 02:36 AM
See /mod/quiz/edit.js revision 1.1 for the old code that is related to doing this, removed in 1.2. The first functional version after 1.1 is 1.4, due to screwups.

Tim Hunt added a comment - 23/Nov/08 09:47 AM
(I already commented on this in MDL-17294, before I spotted this separate issue.)

I agree with your analysis that this is an infrequent action that does not need to be ajaxified.