Issue Details (XML | Word | Printable)

Key: CONTRIB-157
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mike Churchward
Reporter: Joseph Rézeau
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.
Non-core contributed modules

Edit Questionnaire mode faulty navigation

Created: 10/Apr/07 06:02 PM   Updated: 06/Nov/07 02:02 PM
Component/s: None
Affects Version/s: 1.8.2
Fix Version/s: None

Participants: Joseph Rézeau and Mike Churchward
Security Level: None
Affected Branches: MOODLE_18_STABLE


 Description  « Hide
In Edit Questionnaire mode, the following sequence results in faulty navigation:

Go to Re-order question screen
Click Preview... button
Close or do not close the popup Preview window (does not matter).
Come back to the Questionnaire Edit window.
Click either on the Add Section Break, the Edit (one question), the Remove (one question) buttons
-> instead of the desired action, the program takes you to Edit Questions screen !!!

Diagnostic.- The preview action changes some of the form parameters and does not reset them correctly

Proposed solution.-
In file /questionnaire/manage_survey.php about line 175, add the following test

/// 'q' comes from the question editor as a submit, and can be from the reorder form.
} else if (isset($formdata->q)) {
+ if ($formdata->dst == 1 || is_numeric($formdata>q) || $formdata->src || $formdata->addbreak ) { + $formdata->tab = 'order'; + $formdata->sid = $formdata->instance + 1; + }
if ($formdata->tab == 'order' && empty($formdata->q)) {

Please test and commit to CVS if proved reliable.
Thanks
Joseph



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Joseph Rézeau added a comment - 12/Apr/07 10:17 PM
Oops! Got it wrong... Upon further testing I found out that I misunderstood the function of the $sid variable (it's the survey id). I propose this new solution (tested in Moodle 1.6 and 1.7):

In file /questionnaire/manage_survey.php about line 175, add the following test lines

/// 'q' comes from the question editor as a submit, and can be from the reorder form.
} else if (isset($formdata->q)) {
+ if ($formdata->sid == 0) { + $formdata->sid = $SESSION->questionnaire_survey_id; + $sid = $formdata->sid; + }
+ if ($formdata->tab != 'questions') { + $formdata->tab = 'order'; + }
if ($formdata->tab == 'order' && empty($formdata->q)) {

Joseph


Joseph Rézeau added a comment - 12/Jun/07 05:31 AM
This bug has been fixed in current CVS contrib version of Questionnaire.
Closing bug,
Joseph