Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save a Single Question as csv #1408

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

hamza221
Copy link
Contributor

Signed-off-by: hamza221 hamzamahjoubi221@gmail.com

@hamza221 hamza221 added enhancement New feature or request php PHP related ticket javascript Javascript related ticket low Low priority 3. to review Waiting for reviews feature: 📊 responses & statistics labels Nov 13, 2022
lib/Controller/ApiController.php Outdated Show resolved Hide resolved
lib/Controller/ApiController.php Outdated Show resolved Hide resolved
lib/Controller/ApiController.php Outdated Show resolved Hide resolved
lib/Db/AnswerMapper.php Show resolved Hide resolved
lib/Db/QuestionMapper.php Outdated Show resolved Hide resolved
lib/Service/SubmissionService.php Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 15, 2022

Codecov Report

Merging #1408 (4c1b378) into main (7a147d9) will decrease coverage by 8.38%.
Report is 23 commits behind head on main.
The diff coverage is 0.00%.

❗ Current head 4c1b378 differs from pull request most recent head bde8b86. Consider uploading reports for the commit bde8b86 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1408      +/-   ##
============================================
- Coverage     43.96%   35.58%   -8.38%     
+ Complexity      646      523     -123     
============================================
  Files            58       49       -9     
  Lines          2550     2043     -507     
============================================
- Hits           1121      727     -394     
+ Misses         1429     1316     -113     

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Only 1 nitpick: When you download the question CSV of multiple questions, it’s not really possible to distinguish, not even from a full responses download. Instead of the current

Formname (responses).csv

What would be nicer for the individual questions is:

Formname (responses - questionname).csv

I guess the question name has to be stripped of some special characters as well – just like we do for Formname I assume.

@jancborchardt
Copy link
Member

And also as discussed, we should probably remove the (responses) part from the export file cause it can mess with import and translations. cc @Chartman123 @jotoeri

@come-nc
Copy link

come-nc commented Nov 17, 2022

Can you also add tests? Codecov is unhappy.

@jotoeri
Copy link
Member

jotoeri commented Nov 17, 2022

Ok - sorry for kicking in here with a bad comment, but that should probably be discussed before putting too much more work into this:
Where is the benefit of having a single question exported as csv? Csv is a pure data representation, not being intended for direct reading by a user. As such, it will in 90% of the cases anyways be used with a certain data-handling / table-calculation software or alike, so the effort of deleting unused questions from the data is not very much.
So overall i currently don't see the benefit of having only one question on a pure data-export, while coding-wise and UI-wise it just adds more complexity. As i always have the 'Simple forms app'(!) in mind, i would currently vote against adding a feature with such less really new functionality. But i'm open to get convinced if there is a real need for this. 😉

(An export of the single questions summary-graphics would e.g. be a different thing! Then one could see the benefit of quickly having a human-readable representation of the summary.)

@gerazo
Copy link

gerazo commented Nov 24, 2022

I fully agree from the technical perspective with you @jotoeri to keep things simple. However, NC was recently started to be used extensively as a complete backoffice solution for no-code office process management. This is very good news, because this means that it can completely replace the other, proprietary online offices, but it also means that some functionality cannot be simple unfortunately. The controlled data collection, surveying inside a company via Forms is also a crucial feature in other office solutions. So unfortunately, this contradicts with your "simple forms" vision.
What I can tell from my experience is that it is quite common that the form creator monitors the incoming answers as they come and continuously manages partial data in her/his own calc sheet. This is definitely made much easier if getting an answer and pasting it is just two clicks instead of copying several fields by hand. This feature would help this case.

@jancborchardt
Copy link
Member

jancborchardt commented Dec 1, 2022

@gerazo note that right now this pull request implements the export of a single Question and its answers. But I think what you are referring to is the exporting of a single Response, correct?

@hamza221 and I talked about it and yeah, it does make sense. @jotoeri @Chartman123 what do you think? That is, having export in both the Summary and the Responses view on individual questions and responses.

Exporting question like via this PR Where exporting individual responses could go
image image

@susnux susnux added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Mar 20, 2023
@hamza221 hamza221 added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 6, 2023
Copy link
Collaborator

@Chartman123 Chartman123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some comments. Please add the new API endpoints to the documentation, too :)

And currently one can only download the CSV file. I think it would be nice to be able to save it to the cloud just like for all submissions.

appinfo/routes.php Outdated Show resolved Hide resolved
appinfo/routes.php Outdated Show resolved Hide resolved
lib/Controller/ApiController.php Outdated Show resolved Hide resolved
@hamza221 hamza221 force-pushed the feat/save-single-question branch 2 times, most recently from 0917573 to b56b7eb Compare December 9, 2023 15:58
Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request feature: 📊 responses & statistics javascript Javascript related ticket low Low priority php PHP related ticket
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants