Moodle

Ajaxify the question bank window

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Quiz
  • Labels:
    None
  • Difficulty:
    Difficult
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

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

Issue Links

Activity

Hide
Olli Savolainen added a comment -

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.

Show
Olli Savolainen added a comment - 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.
Hide
Olli Savolainen added a comment -

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.

Show
Olli Savolainen added a comment - 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.
Hide
Tim Hunt added a comment -

(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.

Show
Tim Hunt added a comment - (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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: