Default text in new fields?

Default text in new fields?

by Onespace Learning -
Number of replies: 13

We're using a single-field tabular dataforms to create a kind of online word processor in our CV course (for people that can't get their hands on googledocs, Word or OpenOffice).

I'd really like the field to contain our CV template as default when it's created. At the moment, learners have to go to another page and cut'n'paste our template into the Editor box.

Is there a way to set new fields to hold default content.

I don't see any options for specifying default text in the field options, or in the mdl_dataform_fields table (unless it's one of those mysterious "parameter" columns?

My least-bad solution so far is to try to do it with JavaScript, but I'm baaad at JS! And I'd have to read the correct editentry value from $_GET which is a further complication.

Or could I set up something in MySQL so that any new mdl_dataform_contents entries that have the correct field id are updated with the new content when they're created?

The Dataform is my favourite thing on Moodle so far - defaults for field contents would be a wonderful addition!

Average of ratings: -
In reply to Onespace Learning

Re: Default text in new fields?

by Itamar Tzadok -

This is an excellent point of improvement. Some fields already have defaults but this can definitely normalized to all fields where applicable. Please add an improvement issue in the Set: Dataform tracker.

In the meantime, you can user JS to fill out a new entry form with default values. Not sure what you mean by reading the correct editentry value from $_GET though. You should be able to determine dom elements whether the form is for a new entry. Then you can access the target field elements and set their value to the desired one.

hth smile

In reply to Itamar Tzadok

Re: Default text in new fields?

by Mike Carrington -

I would also like to see this implemented:

I am trying to allow individual students to record their practical work in Chemistry A level (UK, 16-18 yrs), as this is going to be a requirement when new specifications come in next year.

I want to provide a template that I can modify for each experiment. Each will have the title, chemicals and apparatus and possibly some other information; students need to be able to edit what I have added to the template. There will be in excess of 12 in total.

I'm afraid that I'm not up to JS modifications, so hope you can find the time to update the database module.

In reply to Mike Carrington

Re: Default text in new fields?

by Itamar Tzadok -

I don't think the database module will be updated in this manner.

With the Dataform module you can already achieve the desired effect to some extent by importing the entries with content (where csv applicable) for the students (you can import the entry author by userid, username or idnumber). The students can then proceed to edit their entries and modify the content. smile

In reply to Itamar Tzadok

Dataform/Database

by Mike Carrington -

Hi Itamar,

Sorry - I hadn't picked up on the Dataform/Database distinction.

Before I spend time investigating the Dataform module, can I ask you if you think I can achieve what I want, given that I have no JS experience.

I would like each of my students to have access to Dataform entries for about 12 different experiments. Each experiment will have the same fields, but with different content.

Students should be able to produce their own personalised record of their practical work by editing the fields, adding images and data. The product should (generally) only be visible to the student and teacher, and it would be very helpful if it could be downloaded as evidence for universities or prospective employers.

Mike

In reply to Mike Carrington

Re: Dataform/Database

by Itamar Tzadok -

Sure.

I would like each of my students to have access to Dataform entries for about 12 different experiments. Each experiment will have the same fields, but with different content.

Not a problem. Each student would have 12 entries each of which is set to 1 of the experiements by means of a designated field. If you trust your students to do that properly, you can let them add the entries on their own. Otherwise you can add the entries for the students. There at least two ways to do that, either by csv import or by adding entries and selecting the entry owner for each one.

If you want to add bulk entries with predefined content you can use the csv import. At least some of the content can be uploaded this way. If you want rich predefined content, you can create one entry and duplicate it. You can bulk duplicate so you can quickly create many copies of the initial entry. You will then have to edit the entries and assign your students as entry authors. You can do bulk editing, that is, edit multiple entries in one go.

Students should be able to produce their own personalised record of their practical work by editing the fields, adding images and data.

Of course. And you can also lock some fields. For instance, you don't want your students to change the experiment id/name in the entry. You lock the field and only you will be able to edit it.

The product should (generally) only be visible to the student and teacher

Set the activity to 'Separate participants' in the activity settings.

, and it would be very helpful if it could be downloaded as evidence for universities or prospective employers.

You can create a designted pdf view and lay out the entry content as desired with a frame, watermark and pdf security if needed. The view allows the user to download a pdf file.


And there are other things you can do. For instance you can create a separate view for each experiment such that the view is already filtered to show only the entries of that experiment. You can create a view for all students where you can show selected experiments without students info. And so on.

hth smile

Average of ratings: Useful (1)
In reply to Mike Carrington

Re: Default text in new Database fields too?

by Clay Burell -

I agree, Mike, it would be nice in Database module. If you started a tracker request, I would vote for it it.

If/until Dataform has documentation and becomes core, it makes little sense to say "use Dataform instead." I've tried, even with Itamar's kind help, but could not finish because it was just too unintuitive for me. Database, however, I got very fast. Its clear and complete documentation helped.

@Itamar, is Database scheduled for the dustbin of Moodle history, to be overthrown by Dataform?

In reply to Clay Burell

Re: Default text in new Database fields too?

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

If/until Dataform has documentation... it seems to me Dataform has a lot of very good documentation smile https://docs.moodle.org/en/Dataform_module

In reply to Mary Cooch

Wow. More Dataform Documentation than I'd found

by Clay Burell -
Hi Mary,

Thanks for the link. Funny thing is, I had searched documentation for Dataform by the numbers--maybe a month or two ago--and found far less. I don't know what to make of that, and only offer it in case there's some anomaly in the Doc structure for Dataform compared to the norm that would explain why I had to turn to messaging Itamar for help (who is kind, and who I do appreciate, just to be clear smile ).

I'll see, given a rare free moment in my school's overheated pace this year, if I can create a Dataform db similar to my current Database instances, and report back (or edit documentation).

Best,

Clay


In reply to Clay Burell

Re: Default text in new Database fields too?

by Itamar Tzadok -

Afaik, at this point there are no plans to replace the Database or add the the Dataform in Moodle core.

The Dataform has many more features and options than the Database. And there are still more exciting features to add or complete. Writing documentation for all these features is a project of its own. Creating text+image tutorials is a lot of work. Even publishing such tutorials requires some consideration and work. If I upload them to the docs wiki I need to upload images one by one (or link to external images which is less preferrable). Same holds for posting such tutorials in a forum.

The good news is that I'm working on tutorials and they should be available fairly soon. I will try to publish them as pdfs so that a complete tutorial could be uploaded/downloaded as one file. By the way, I will be using the Dataform pdf view for generating the pdf files.

I will open a tracker issue for tutorials and you can add there sub-tasks as requests for how-to topics.

smile

In reply to Clay Burell

Re: Default text in new Database fields too?

by Stuart Mealor -
I agree. It is probably very confusing for Teachers using Moodle, and wanting to discuss/understand the core Database module, to find discussion about the Dataform module, a non-standard plugin being discussed so much.
Would it not make sense to move discussion about Dataform to the same area as other non-standard modules?
We could put a link at the top of this Forum for people who are looking for the sort of functionality it provides.
In reply to Stuart Mealor

Re: Default text in new Database fields too?

by Itamar Tzadok -

I don't think that teachers using Moodle are likely to get confused that easily.

We can definitely agree with Clay's remark that it would be nice to have default text in new Database fields too. It is just a question of who if any will commission the work.

We can also agree with Clay's remark that the Database is easier to start working with than the Dataform. There is just so much that you can do with the Database as documented in its docs. And Clay is right. For what you can do with it, the docs are very helpful and most users don't need to come here to ask questions. They do come here when they want go further and do things beyond what is described in the docs. More often than not, the docs are indeed sufficiently complete and the desired functions are indeed not possible without hacking and there is no easy workaround.

The sort of functionality provided by the Dataform is precisely the functionality any user would look for after two weeks of using the Database. I was able to do with the standard Database pretty complex stuff (mainly with all kinds of css tricks, heavy javascript and complex html templates). And even I got to the point where it was just not enough. And so the Dataform was branched off as an alternative for those who need more from the Database.

That is to say, from a thematic point of view, the Dataform belongs here as a natural extension of the Database. If anything, I would change the forum name to Dataform, to resolve once and for all the confusion of many (mainly new) community members who seek help with their DB issues.

smile

In reply to Itamar Tzadok

Re: Default text in new Database fields too?

by Mike Carrington -

Hi Itamar,

A separate forum makes sense - but then people like me might not find out about the extensive functions in Dataform!

Silver linings?

Mike

In reply to Mike Carrington

Re: Default text in new Database fields too?

by Clay Burell -

Can't the Database forum have a line above the responses saying, "Those interested in a more advanced Database possibilities, see Using Dataform forum--and link to it?