Sum of numbers in a column

Sum of numbers in a column

by Dave Foord -
Number of replies: 6
Picture of Particularly helpful Moodlers

I am trying to design a dataform to act as a log of their coaching practice, and for the course they have to have a total of 50 hours of coaching. I have created the form which looks as per the image below, and am using a number field called 'Duration' to record the number of minutes. Each student would add multiple entries.

How do I add up all the numbers in the Duration column below and display this as a total?

Students only see their own entries anyway, so hopefully this would only display their total by default, and tutors when looking at this would filter by name to only show one learner at a time, and again I am hoping the sum would alter accordingly.

Thanks in advance.


Average of ratings: -
In reply to Dave Foord

Re: Sum of numbers in a column

by Hartmut Scherer -
Hi Dave,

The attached preset of a case study can give you an idea for your dataform activity. Just add a new dataform activity in a test course, save the activity, select presets and then "upload preset from file." Choose the attached file, click on "Add" and apply this preset to the dataform activity. After you have updated the due date of the activity in "Edit settings" you will be able to run a test with a dummy student. 

With kind regards,
Hartmut
In reply to Hartmut Scherer

Re: Sum of numbers in a column

by Dave Foord -
Picture of Particularly helpful Moodlers
Thank you Hartmut for responding, it is very much appreciated. This doesn't directly work for me here - as I will have an unknown number of entries that need to be summed, and entries added as multiple different records over many months. (whereas you have a defined number of entries - in this case 8 entered into a single record).

However, I do like what you have done, and can certainly use that ideology in other areas of my work.

Thanks again.
In reply to Dave Foord

Re: Sum of numbers in a column

by sian jones -

Hi Dave, did you resoldve this? I am looking to do almost exactly the same as you. Create a form where students record the hours they have spent on self learning that is summed.


In reply to sian jones

Re: Sum of numbers in a column

by Dave Foord -
Picture of Particularly helpful Moodlers
Hi Sian, yes I did solve this (well, I paid someone else to solve it), which was achieved by using some javascript I believe. The screenshot below shows the end product.

The person that did this for me is called Oliver who owns https://teruselearning.co.uk/ - it was relatively simple to achieve so cost hardly anything - if you contact Oliver and mention my name - he should be able to re-use some of the code that he used for my situation.

screenshot showing the sum of the duration column
In reply to Dave Foord

Re: Sum of numbers in a column

by Kevin Waters -

If you need to sum column or row of numbers, let Excel do the math for you. Select a cell next to the numbers you want to sum, click AutoSum on the Home tab, press Enter, and you're done.



https://mypennmedicine.me/