Apply data edit and add new to separate sections in a Data Form

Apply data edit and add new to separate sections in a Data Form

by Jason Allshorn -
Number of replies: 1

First of all, I think this plug in is totally awesome, and I can't believe how easy it is to use and how customizable it helps to make Moodle. 

Here is my query: 

Is there are way to break up a Data Form so that "Add Entry" or "Edit Entry" only applies to one section at a time? 

My form needs to be divided into 5 sections. The first section contains images in a grid, which I can edit and add individually. 

The second through the fifth sections are to be text areas, which need to be edited individually, but don't need to be added or deleted. 

In other words, is there some sort of identifying code which allows me to edit just one part of the form/data field at a time?


Here is a screen shot of what I'm aiming for. 


Screen Shot

Average of ratings: -
In reply to Jason Allshorn

Re: Apply data edit and add new to separate sections in a Data Form

by Itamar Tzadok -

You can do that with views.

Fields

  • Image1
  • Image2
  • Image3
  • Image4
  • Image5
  • Textarea1
  • Textarea2
  • Textarea3
  • Textarea4

Views

  • AllSections
  • Section1
  • Section2
  • Section3
  • Section4
  • Section5

The AllSections view contains all fields but no submission buttons are enabled so that it does not allow entry editing in it. In each section in the template you can add an edit button to the target section view. Use the entryactions edit pattern for designated view

EAC:edit:viewname 

(see Dataformfield_entryactions).

You can set the section views to return after submission to the main view (in the submission settings.

As a slightly different approach you can omit the AllSections view and design all the session views to show all the fields. In each session view you can make certain fields read-only by prefixing the field pattern with !. For example (redundant spaces between brackets should be removed):

[ [!TextArea1] ]

Use the edit entry action for designated views as described above. In this approach the user will move seamlessly between views when editing sections in the entry.

hth smile