database activity vs XMLDB Editor

database activity vs XMLDB Editor

Little Sunday -
回帖数:6

Hi

I'm a newbie in Moodle 2.9 and I would like to learn a bit more.

I need to know how can I build personal tables/fields through the database editor or the XMLDB Editor. With the first I've already done some tests and worked out well but it seems to be limited because I can't do personal "sql selects" to the tables where the information is kept. So I think the best choice/way is to create/implement tables through the XMLDB Editor.

What do you advice me?

Besides this I would like to know if it is possible to apply CSS responsive in the template editor of the database activity?

Can you help/guide me please?

Best Regards
Richard

回复Little Sunday

Re: database activity vs XMLDB Editor

William Lu -

Hi Richard,

...if it is possible to apply CSS responsive in the template editor of the database activity?

If you mean to add CSS to each template separately, then Yes.

I don't know the XMLDB, but like to know what you may find out.

Thanks.

回复William Lu

Re: database activity vs XMLDB Editor

Little Sunday -
Hi William

I want to add the following Responsive CSS3 Horizontal Application Style Form Fields because I want to display the fields like that and not like a table (it stays prettier!).

http://blog.templatemonster.com/2014/12/15/responsive-css3-form-fields-tutorial/

How can I do that?

Best Regards
回复Little Sunday

Re: database activity vs XMLDB Editor

William Lu -

Hi Little,

The the page you linked has detailed instruction.

I believe it is doable.

Have you got your Database fields already? If so, attach your preset here and I will try to add CSS for you.


Regards

William


BTW: Don't post same question in 2 locations, it will distract helpers. 



回复William Lu

Re: database activity vs XMLDB Editor

Little Sunday -
Hi William

I've already got the fields.

Nº OM            Number
Name            Text Field
Birth Date        Date
Photo            Picture
Address            Text Area
Phone Number        Text Field
Mobile            Text Field
email            Text Field
University        Menu
Other Academic Degree    Text Field
Internal Course        Number
Work Nº            Number
Teacher            Menu
Formation Local        Menu
Reassign #1        Menu
Reassign #2        Menu
Direção de internato    Menu
Reference Hospital #1    Menu
Reference Hospital #2    Menu
End Preview        Date
End Internal        Date
Academic Note        Number
Exame Note        Number
Job Type        Text Field

Thank You Very Much
回复William Lu

Re: database activity vs XMLDB Editor

Little Sunday -

Hi William

Can you give me an hand on this please?


Thanks

Richard

回复Little Sunday

Re: database activity vs XMLDB Editor

William Lu -

Hi Richard,

I did checked the linked page which your referred. It has many CSS styles, which might not be able to reproduce in Moodle. 

Itamr may have some tricks on this.

From my point of view, many form fields are not suitable for ‘Horizontal’ layout.

For example, the ‘File’, ‘Image’, ‘Textarea’ and ‘url’, need wider column size, better displayed in a separate row.

If you can make sure you have same number of choice in ‘Radio button’, ‘Checkbox’, you can put them in to same row.

‘Multi-select Menu’ can share a row with other ‘Multi-select Menu’s.

Below are the fields which are suitable to share a row:

  1. ‘Number’
  2. ‘Text’
  3. ‘Date’
  4. ‘Menu’

Of course, we need a piece of JavaScript to reduce the width of text field.

I created an example Database for you, as attached preset. You can find the extra code in the Add template. Feel free to modify it and please share your achievement here if you could find a better way to do this. Make sure you keep the HTML edit disabled when you are editing the template.

View the ‘Add entry’ form on a Desktop PC:


 

View the ‘Add entry’ from on a smaller screen:

 

 

 

HTH

 

William