Upload user response from an excel file

Upload user response from an excel file

by Jaswant Tak -
Number of replies: 2
Hello To all,

I have a site for my students, for that I have installed moodle 1.6.2. Now I want to run a quiz like activity but its not online.

I want to take an exam physically i.e. I will give question paper to my students they will mark their answers in answer sheet and submit it to me. Than I will make an excel file with student's id and student's response for all the question like this:

userid question id
response
u1234
1
A
u1234
2
C

After that I want to upload this file in moodle. So that when the student whose id is u1234 logins she can review her response for that specific quiz.

I need your help, If there is difficulty to understand my language please reply.

Thanks,
Jaswant
Average of ratings: -
In reply to Jaswant Tak

Re: Upload user response from an excel file

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Nothing like this currently exists.

If you wanted to try implementing it yourself, I suggest you do it by making a new quiz report. You will find the existing ones in mod/quiz/report/. If you look at the existing ones, you should be able to work out what you have to do. I regret there is no documentation, but the code is not that complicated.

I suggest you don't try to use Excel format. Instead, do Save as CSV from Excel, then import that. I think there is even library code to help with importing CSV. get_records_csv() from lib/filelib.php.

To work out what you need to do with the imported data, look in mod/quiz/attempt.php, particularly the bit after the comment

/// Process form data /////////////////////////////////////////////////

an the key bits there are the calls to question_process_responses(...) and save_question_session(...)
In reply to Tim Hunt

Re: Upload user response from an excel file

by Jaswant Tak -
Thanks Mr. Hunt for your suggestions,

Ok I will try with CSV format and will implement it, but before implementing I was in searching for this feature if somebody has already done it.

Anyway Thanks agian,
Jaswant