Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Javascript-interface for repeat elements function: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 6: Line 6:
'''TASK''': The main task is development of JavaScript-interface for repeat_elemens function. Other task is make ADD, REMOVE and MOVE actions without page reloading. If JavaScript is not available in user's browser this actions must work with page reloading, like it works now.
'''TASK''': The main task is development of JavaScript-interface for repeat_elemens function. Other task is make ADD, REMOVE and MOVE actions without page reloading. If JavaScript is not available in user's browser this actions must work with page reloading, like it works now.


# ''Where it will be.''
 
== Where it will be. ==
 
This core patch will work on this pages(default configuration and modules list):
This core patch will work on this pages(default configuration and modules list):
* Course editing -> Adding a new Choice - Adding fields to form;
* Course editing -> Adding a new Choice - Adding fields to form;
Line 23: Line 25:
http://imglink.ru/pictures/21-09-10/f85258328f02d65164e6a15644e5d8a9.jpg
http://imglink.ru/pictures/21-09-10/f85258328f02d65164e6a15644e5d8a9.jpg
[[Image:7.jpg]]
[[Image:7.jpg]]
#''Adding new blanks''
 
== Adding new blanks ==
 
Adding new blanks realize by pushing "Add blanks for SMTH" button.  
Adding new blanks realize by pushing "Add blanks for SMTH" button.  
It will initiate AJAX request to the server, and will call repeat_elements function and it's result will be displayed on users screen.
It will initiate AJAX request to the server, and will call repeat_elements function and it's result will be displayed on users screen.
#''Removing blanks''.
 
== Removing blanks. ==
 
It's possible to remove only 'Empty' blanks. Empty blank is that blank, where all key-fields are empty or have default values.
It's possible to remove only 'Empty' blanks. Empty blank is that blank, where all key-fields are empty or have default values.
List of elements, which will be check:
List of elements, which will be check:
Line 47: Line 53:
Blank's removing realize by pushind remove button(see screenshot) and confirming your choise.
Blank's removing realize by pushind remove button(see screenshot) and confirming your choise.
If blank's removing isn't possible user will get allert with reason.
If blank's removing isn't possible user will get allert with reason.
[screenshot remove button]
[[Image:remove.jpg]]
#Moving blanks
 
== Moving blanks ==
 
Blanks moving is available by dragging them with move button
Blanks moving is available by dragging them with move button
[screenshot move button]
[[Image:move.jpg]]
At any moment you can set all your blanks in default positions, using button "Restore order"
At any moment you can set all your blanks in default positions, using button "Restore order"

Revision as of 06:52, 2 October 2010

GOAL: improve usability by using dynamic form editing.

At this moment form editing, especially adding new blank answers, units, choices and fields requires page reloading. Editing blanks order or blank removing is not possible without page reloading.

TASK: The main task is development of JavaScript-interface for repeat_elemens function. Other task is make ADD, REMOVE and MOVE actions without page reloading. If JavaScript is not available in user's browser this actions must work with page reloading, like it works now.


Where it will be.

This core patch will work on this pages(default configuration and modules list):

  • Course editing -> Adding a new Choice - Adding fields to form;
  • Course editing -> Adding a new Quiz - Adding new feedback fields;
  • Course editing -> Editing Quiz-> Editing a calculated question - Adding Blanks for choices;
  • Course editing -> Editing Quiz-> Editing a calculated question - Adding Blanks for Units;
  • Course editing -> Editing Quiz-> Editing a Calculated Multichoice question - Adding Blanks for choices;
  • Course editing -> Editing Quiz-> Editing a Simple Calculated question - Adding Blanks for choices;
  • Course editing -> Editing Quiz-> Editing a Simple Calculated question Adding Blanks for Units;
  • Course editing -> Editing Quiz-> Editing a Matching question - Adding Blanks for choices;
  • Course editing -> Editing Quiz-> Editing a Multiple choice question - Adding Blanks for choices;
  • Course editing -> Editing Quiz-> Editing a Numerical question - Adding Blanks for choices;
  • Course editing -> Editing Quiz-> Editing a Numerical question - Adding Blanks for choices;
  • Course editing -> Editing Quiz-> Adding a short answer question - Adding Blanks for choices;

This core patch will add new buttons to the form interface. http://imglink.ru/pictures/21-09-10/f85258328f02d65164e6a15644e5d8a9.jpg 7.jpg

Adding new blanks

Adding new blanks realize by pushing "Add blanks for SMTH" button. It will initiate AJAX request to the server, and will call repeat_elements function and it's result will be displayed on users screen.


Removing blanks.

It's possible to remove only 'Empty' blanks. Empty blank is that blank, where all key-fields are empty or have default values. List of elements, which will be check:

  • FILE.

File upload input box with browse button. Empty, when filepath is empty.

  • FILEPICKER

General replacement of file element in Moodle 2.0 . Empty, when filepath is empty.

  • HTMLEDITOR

Empty when it doesn't contains eny content.

  • PASSWORD and PASSWORDUNMASK

A password element. Empty, when it doesn't contains any text.

  • TEXT

Simple text input element. Empty, when it doesn't contains any text.

  • TEXTAREA

A textarea element. Empty, when it doesn't contains any text.

Other form elements like DATEPICKER, RECAPTCHA, SELECT, HIDDEN and others can contain's any values, becuse they won't be check.

Blank's removing realize by pushind remove button(see screenshot) and confirming your choise. If blank's removing isn't possible user will get allert with reason. remove.jpg

Moving blanks

Blanks moving is available by dragging them with move button move.jpg At any moment you can set all your blanks in default positions, using button "Restore order"