Browse Source

Merge branch '1.9.x' of github.com:chamilo/chamilo-lms into nuevo

Julio Montoya 11 years ago
parent
commit
37628d5f8e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      main/exercice/export/aiken/aiken_import.inc.php

+ 2 - 0
main/exercice/export/aiken/aiken_import.inc.php

@@ -43,6 +43,7 @@ function aiken_display_form($msg = '') {
     $form .= $msg;
     $form_validator  = new FormValidator('aiken_upload', 'post',api_get_self()."?".api_get_cidreq(), null, array('enctype' => 'multipart/form-data') );
     $form_validator->addElement('header', $name_tools);
+    $form_validator->addElement('text', 'total_weight', get_lang('totalWeight'));
     $form_validator->addElement('file', 'userFile', get_lang('DownloadFile'));
     $form_validator->addElement('style_submit_button', 'submit', get_lang('Send'), 'class="upload"');
     $form .= $form_validator->return_form();
@@ -298,6 +299,7 @@ function aiken_parse_file(&$exercise_info, $exercisePath, $file, $questionFile)
         }
     }
     $total_questions = count($exercise_info['question']);
+    $total_weight = (!empty($_POST['total_weight'])) ? intval($_POST['total_weight']) : 20;
     foreach  ($exercise_info['question'] as $key => $question) {
         $exercise_info['question'][$key]['weighting'][current(array_keys($exercise_info['question'][$key]['weighting']))] = $total_weight / $total_questions;
     }