Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Calculated question actual 1.7 interface summary.

Calculated question actual 1.7 interface summary

From MoodleDocs

currently editingPierre Pichet 21:41, 17 August 2006 (WST)

Calculated question step1 of 3
Definition of general questions parameters and common options

  • Name
  • Question text
  • Answer formula and correcting parameters (units, tolerance etc.)
  • General feedback

Creating a new question

Click in Save changes

Editing a question

Click in Save changes

Making a copy of a question
Click on SAVE AS A NEW

Moving a question to another category

Click on Move to

NOTHING is saved in the database,
the data is transfered in the SESSION parameter ( the cookie)

Data saved in database Create a new question and save a copy of the data in database Change the category_id of the question

Calculated question step 2 of 3

Verify if there is at least on calculated parameter (ex {length}, {a1)) in the Answer formula
Defining for each of the calculated parameters if it will be

  • Specific and only used by this question
OR
  • Used an existing sharable parameter already present in THIS CATEGORY or create a sharable parameters useable by other questions in THIS CATEGORY

New default parameter defined but
NOT is saved in the database,
the definition is transfered in the SESSION parameter ( the cookie)

Parameter saved in the database New default parameter saved in the database

There is a bug:

The calculated parameters remain in the initial category so you have to recreate them from scratch and if you move back in the initial category the original data still there

It would be nice to find a solution to this bug. Below is my suggestion.

Calculated question step 3 of 3

  • Modify the calculated parameters dataset ( Minimum, maximum, distribution)
  • Add either new dataitems or precedingly removed items or remove dataitems

Modifications stored in Session items.

Adding a first series of dataitems, the question is saved using ALL the preceeding data stored in the SESSION parameters.

After this addition everything is similar to editing a question (column at right)

Modifications to the datasets are not stored UNLESS you click to ADD.

If you click to REMOVE (a dataitem) or exit trough back to quiz editing without having clicked on Add you loss the dataset modifications done!!

 You need to reconstruct all the datasets and dataitems  You need to reconstruct all the datasets and dataitems

Tim's suggestion

What about if, when you are moving questions from one category to another, it searches the database to see whether

  1. The dataset is only used by questions that are being moved to the new category now; or
  2. It is used by other questions.

In case 1, move the dataset to the new category with the questions. If 2, display a warning with the choices 'cancel', 'move all the questions depending on these datasets', or 'move question and copy datasets'.

When you need to copy datasets, I think it should copy the dataset definitions automatically, to save the user having to recreate them. Then they only need to recreate the dataset items.

Pierre's comments

Your suggestion is mostly what I was planning and I am beginning to work on. However because of the academic year beginning next week, it won't be ready for testing until the end of september.Most of the problem is related to the datasets that are used by more than one question. The other datasets just follow the question because they are not category dependent.This imply also that category moving should be done by default question functions not by just modifying the question->category parameter. Calculated_question_development#Moving_calculated_questions_to_another_category