|
|
|
@ -1014,18 +1014,13 @@ class Exercise |
|
|
|
|
|
|
|
|
|
// Adding category info in the category list with question list: |
|
|
|
|
if (!empty($questions_by_category)) { |
|
|
|
|
/*$em = Database::getManager(); |
|
|
|
|
$repo = $em->getRepository('ChamiloCoreBundle:CQuizCategory');*/ |
|
|
|
|
$newCategoryList = array(); |
|
|
|
|
|
|
|
|
|
foreach ($questions_by_category as $categoryId => $questionList) { |
|
|
|
|
$cat = new TestCategory(); |
|
|
|
|
$cat = $cat->getCategory($categoryId); |
|
|
|
|
|
|
|
|
|
$cat = (array)$cat; |
|
|
|
|
$cat['iid'] = $cat['id']; |
|
|
|
|
//*$cat['name'] = $cat['name']; |
|
|
|
|
|
|
|
|
|
$categoryParentInfo = null; |
|
|
|
|
// Parent is not set no loop here |
|
|
|
|
if (!empty($cat['parent_id'])) { |
|
|
|
@ -1074,6 +1069,7 @@ class Exercise |
|
|
|
|
|
|
|
|
|
$result['category_with_questions_list'] = $newCategoryList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1992,33 +1988,20 @@ class Exercise |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (true) { |
|
|
|
|
$option = array( |
|
|
|
|
EX_Q_SELECTION_ORDERED => get_lang('OrderedByUser'), |
|
|
|
|
// defined by user |
|
|
|
|
// Defined by user |
|
|
|
|
EX_Q_SELECTION_RANDOM => get_lang('Random'), |
|
|
|
|
// 1-10, All |
|
|
|
|
'per_categories' => '--------'.get_lang( |
|
|
|
|
'UsingCategories' |
|
|
|
|
).'----------', |
|
|
|
|
|
|
|
|
|
'per_categories' => '--------'.get_lang('UsingCategories').'----------', |
|
|
|
|
// Base (A 123 {3} B 456 {3} C 789{2} D 0{0}) --> Matrix {3, 3, 2, 0} |
|
|
|
|
EX_Q_SELECTION_CATEGORIES_ORDERED_QUESTIONS_ORDERED => get_lang( |
|
|
|
|
'OrderedCategoriesAlphabeticallyWithQuestionsOrdered' |
|
|
|
|
), |
|
|
|
|
EX_Q_SELECTION_CATEGORIES_ORDERED_QUESTIONS_ORDERED => get_lang('OrderedCategoriesAlphabeticallyWithQuestionsOrdered'), |
|
|
|
|
// A 123 B 456 C 78 (0, 1, all) |
|
|
|
|
EX_Q_SELECTION_CATEGORIES_RANDOM_QUESTIONS_ORDERED => get_lang( |
|
|
|
|
'RandomCategoriesWithQuestionsOrdered' |
|
|
|
|
), |
|
|
|
|
EX_Q_SELECTION_CATEGORIES_RANDOM_QUESTIONS_ORDERED => get_lang('RandomCategoriesWithQuestionsOrdered'), |
|
|
|
|
// C 78 B 456 A 123 |
|
|
|
|
|
|
|
|
|
EX_Q_SELECTION_CATEGORIES_ORDERED_QUESTIONS_RANDOM => get_lang( |
|
|
|
|
'OrderedCategoriesAlphabeticallyWithRandomQuestions' |
|
|
|
|
), |
|
|
|
|
EX_Q_SELECTION_CATEGORIES_ORDERED_QUESTIONS_RANDOM => get_lang('OrderedCategoriesAlphabeticallyWithRandomQuestions'), |
|
|
|
|
// A 321 B 654 C 87 |
|
|
|
|
EX_Q_SELECTION_CATEGORIES_RANDOM_QUESTIONS_RANDOM => get_lang( |
|
|
|
|
'RandomCategoriesWithRandomQuestions' |
|
|
|
|
), |
|
|
|
|
EX_Q_SELECTION_CATEGORIES_RANDOM_QUESTIONS_RANDOM => get_lang('RandomCategoriesWithRandomQuestions'), |
|
|
|
|
// C 87 B 654 A 321 |
|
|
|
|
|
|
|
|
|
//EX_Q_SELECTION_CATEGORIES_RANDOM_QUESTIONS_ORDERED_NO_GROUPED => get_lang('RandomCategoriesWithQuestionsOrderedNoQuestionGrouped'), |
|
|
|
@ -2116,37 +2099,7 @@ class Exercise |
|
|
|
|
$form->createElement('radio', 'hide_question_title', null, get_lang('No'), '0') |
|
|
|
|
); |
|
|
|
|
$form->addGroup($group, null, get_lang('HideQuestionTitle')); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
// number of random question |
|
|
|
|
/* |
|
|
|
|
$max = ($this->id > 0) ? $this->selectNbrQuestions() : 10 ; |
|
|
|
|
$option = range(0, $max); |
|
|
|
|
$option[0] = get_lang('No'); |
|
|
|
|
$option[-1] = get_lang('AllQuestionsShort'); |
|
|
|
|
$form->addElement('select', 'randomQuestions',array(get_lang('RandomQuestions'), get_lang('RandomQuestionsHelp')), $option, array('id'=>'randomQuestions')); |
|
|
|
|
|
|
|
|
|
// Random answers |
|
|
|
|
$radios_random_answers = array(); |
|
|
|
|
$radios_random_answers[] = $form->createElement('radio', 'randomAnswers', null, get_lang('Yes'),'1'); |
|
|
|
|
$radios_random_answers[] = $form->createElement('radio', 'randomAnswers', null, get_lang('No'),'0'); |
|
|
|
|
$form->addGroup($radios_random_answers, null, get_lang('RandomAnswers'), ''); |
|
|
|
|
|
|
|
|
|
// Random by category |
|
|
|
|
$form->addElement('html','<div class="clear"> </div>'); |
|
|
|
|
$radiocat = array(); |
|
|
|
|
$radiocat[] = $form->createElement('radio', 'randomByCat', null, get_lang('YesWithCategoriesShuffled'),'1'); |
|
|
|
|
$radiocat[] = $form->createElement('radio', 'randomByCat', null, get_lang('YesWithCategoriesSorted'),'2'); |
|
|
|
|
$radiocat[] = $form->createElement('radio', 'randomByCat', null, get_lang('No'),'0'); |
|
|
|
|
$radioCatGroup = $form->addGroup($radiocat, null, get_lang('RandomQuestionByCategory'), ''); |
|
|
|
|
$form->addElement('html','<div class="clear"> </div>'); |
|
|
|
|
|
|
|
|
|
// add the radio display the category name for student |
|
|
|
|
$radio_display_cat_name = array(); |
|
|
|
|
$radio_display_cat_name[] = $form->createElement('radio', 'display_category_name', null, get_lang('Yes'), '1'); |
|
|
|
|
$radio_display_cat_name[] = $form->createElement('radio', 'display_category_name', null, get_lang('No'), '0'); |
|
|
|
|
$form->addGroup($radio_display_cat_name, null, get_lang('QuestionDisplayCategoryName'), '');*/ |
|
|
|
|
} |
|
|
|
|
// Attempts |
|
|
|
|
$attempt_option = range(0, 10); |
|
|
|
|
$attempt_option[0] = get_lang('Infinite'); |
|
|
|
|