Is there a way the import module could support upload of Aiken format multi choice questions WITH marks on them. Editing manually the marks for each of them after a bulk import is painfull. I did try some update on Database which failed, I would put that in a seperate support request. I think import can take marks for true/false questions but i am afraid its not there for multichoice questions. I could see only Feedback.

CommentFileSizeAuthor
#8 AikenFormatSample.txt304 bytesBerenice22

Comments

turadg’s picture

I'm not sure what "marks" means here. I don't see that term in the [[http://docs.moodle.org/en/Aiken_format|Aiken spec]].

Do you mean the "ANSWER" field? (i.e. the correct response) That should be working and if it isn't then we have a bug.

srikanthlogic’s picture

@turadg

Thanks for response. I do not mean the "ANSWER" field. I wish there is a way to update the score for each choice while uploading it in aiken format. I vaguely remember seeing some example file uploaded by sivaji talking of this, but somehow not able to find it now. Even that did not work when i tried.

My requirement is to import a set of questions like these.

What is the correct answer to this question?
A. Is it this one? [[negative 1 mark]]
B. Maybe this answer? [[negative 1 mark]]
C. Possibly this one? [[negative 1 mark]]
D. Must be this one! [[positive 5 mark]]
ANSWER: D

I referred the aiken spec now and it does not talk about updating the score. But i guess feedback for each option is part of aiken format, but i require scores to updated for each option. Currently i achieve this by using the importer to only import the questions and then go to the backend and updating through a query like
update quiz_multichoice_answers set score_if_chosen = 5 where id in (p,q,r,etc the choice-ids.) which is not the ideal way of doing things. I wish if import can take this, it will eliminate these kind of backend updates which could possibly corrupt if done carelessly.

When i see aiken_example.txt i understand the long answer and short answer questions have the option of updating the score during the import, but multichoice has only feedback option.

With my limited knowledge of php i looked into questions_import.admin.inc function _questions_import_moodle_create_node , for multichoice the import looks like this

 case 'multichoice':
   $node->alternatives = array();
// whether user can make multiple selections
   $node->choice_multi = ! $mq->single; 
// Add answer alternatives
   foreach ($mq->answer as $index => $answer) {
      $node->alternatives[] = array(
      // answer, answer_format, feedback_if_chosen, feedback_if_chosen_format,
      // feedback_if_not_chosen, feedback_if_not_chosen_format,
      // score_if_chosen, score_if_not_chosen
      'answer' => $answer,
      'answer_format' => $node->format,
      'feedback_if_chosen' => $mq->feedback[$index],
      'feedback_if_chosen_format' => $node->format,
      'feedback_if_not_chosen' => '',
      'feedback_if_not_chosen_format' => $node->format,
      'score_if_chosen' => $mq->fraction[$index],
      'score_if_not_chosen' => 0,
); 

So it does use some value during the import to set for 'score_if_chosen', but am not sure what it uses and can that value be passed on from the aiken file somehow is where i need some help.

Thanks

turadg’s picture

Ah, I understand now.

This feature request, in some ways, amounts to three requests:
1) add score per m/c item to the Aiken spec
2) update the Moodle code we're using to parse that score
3) update the Quiz module to use that data when creating the m/c question node

I would be reluctant to do #3 without #1-2, and those require getting Moodle to make changes. Though maybe they're interested in doing that. You could try Moodle.org.

Otherwise, I would recommend either of these two to you:
a) import from Moodle XML which supports score per answer (http://docs.moodle.org/en/Moodle_XML#Multiple_choice)
b) submit a patch (or organize others to write one) to parse the Aiken format with the extensions you need. I think Sivaji wrote an Aiken parser before we had the one from Moodle. It was buggy but it could be a helpful start.

srikanthlogic’s picture

@turadg Thanks for the reply.

I am primarily using Drupal for conducting an exam and not trying to import any stuff from moodle. Since i have a huge set of questions, I thought of using import feature instead of manually creating online and Aiken was plain and simple.Aiken was also easier to use for my question setters(non-technical folks). Thanks for the Moodle XML pointer, i could atleast try writing a custom XML generator which can generate XML from an Aiken file with scores in it.

But how can i use this Moodle XML and import? My drupal shows only 4 options. Aiken,GIFT,Learnwise,WebCT.

I would check with moodle.org if they can include this in Aiken format spec. Let me try if could make sense and write a patch but i guess it requires quite an effort from my side. Otherwise i got to manually update the back end be content with it. But that is insane way of doing things and I hate it.

turadg’s picture

I thought the Moodle XML was an option in the importer, but it wasn't. I just added it now: #740866: Support importing from Moodle XML format

falcon’s picture

Version: 6.x-4.x-dev » 6.x-5.x-dev
falcon’s picture

Project: Quiz » Quiz EI
Version: 6.x-5.x-dev » 6.x-4.0-alpha1
Component: Code - Import/Export » Code
Berenice22’s picture

StatusFileSize
new304 bytes