Redo changes after merge.

skala
Julio Montoya 12 years ago
parent 321ce65f18
commit efa6d5008e
  1. 50
      main/exercice/exercise.class.php
  2. 3
      main/exercice/exercise_admin.php
  3. 2
      main/exercice/hotpotatoes.lib.php
  4. 10
      main/exercice/question.class.php
  5. 8
      main/exercice/question_list_pagination_admin.inc.php

@ -11,6 +11,8 @@
* Code
*/
use \ChamiloSession as Session;
use \ChamiloLMS\Transaction\TransactionLog;
use \ChamiloLMS\Transaction\TransactionLogController;
// Page options
define('ALL_ON_ONE_PAGE', 1);
@ -5867,20 +5869,28 @@ class Exercise
//var_dump($categoryList);
$html = '<div class="row">';
$html .= '<div class="span2">';
$html = '<div class="row" id="exercise_progress_block">';
$html .= '<div class="span2" id="exercise_progress_legend">';
$reviewAnswerLabel = null;
if ($this->review_answers) {
$reviewAnswerLabel = Display::label(get_lang('ToReview'), 'warning').'<br />';
$reviewAnswerLabel = Display::label(sprintf(get_lang('ToReviewZ'),'c'), 'warning').'<br />';
}
$currentAnswerLabel = null;
if (!empty($current_question)) {
$currentAnswerLabel = Display::label(get_lang('CurrentQuestion'), 'info');
}
$html .= Display::label(get_lang('Answered'), 'success').'<br />'.Display::label(get_lang('Unanswered')).'<br />'.
$reviewAnswerLabel.$currentAnswerLabel;
$html .= '</div>';
$currentAnswerLabel = Display::label(sprintf(get_lang('CurrentQuestionZ'),'d'), 'info');
}
// Count the number of answered, unanswered and 'for review' questions - see BT#6523
$numa = count(array_flip(array_merge($exercise_result,$remindList)));
$numu = count($questionListFlatten)-$numa;
$numr = count($remindList);
$html .= Display::label(sprintf(get_lang('AnsweredZ'),'a'), 'success').'<br />'.Display::label(sprintf(get_lang('UnansweredZ'),'b')).'<br />'.
$reviewAnswerLabel.$currentAnswerLabel.
'<br /><br />'.
sprintf(get_lang('AnsweredXYZ'),str_pad($numa,2,'0',STR_PAD_LEFT),'a','c').'<br />'.
sprintf(get_lang('UnansweredXYZ'),str_pad($numu,2,'0',STR_PAD_LEFT),'b').'<br />'.
sprintf(get_lang('ToReviewXYZ'),str_pad($numr,2,'0',STR_PAD_LEFT),'c').'<br />'.
'</div>';
$conditions = array();
$conditions[] = array("class" => 'answered', 'items' => $exercise_result);
@ -5888,7 +5898,7 @@ class Exercise
$link = $url.'&num=';
$html .= '<div class="span10">';
$html .= '<div class="span10" id="exercise_progress_bars">';
if (!empty($categoryList)) {
$html .= $this->progressExercisePaginationBarWithCategories($categoryList, $current_question, $conditions, $link);
} else {
@ -6127,8 +6137,8 @@ class Exercise
}
}
$html .= '<div class="row">';
$html .= '<div class="span2">'.$categoryName.'</div>';
$html .= '<div class="span8">';
$html .= '<div class="span2 exercise_progress_bars_cat">'.$categoryName.'</div>';
$html .= '<div class="span8 exercise_progress_bars_cat_items">';
if (!empty($nextValue)) {
if ($wasMedia) {
@ -6673,6 +6683,24 @@ class Exercise
'',
array()
);
$log_transactions_settings = TransactionLog::getTransactionSettings();
if (isset($log_transactions_settings['exercise_attempt'])) {
$transaction_controller = new TransactionLogController();
$transaction = $transaction_controller->loadOne(array(
'action' => 'exercise_attempt',
'branch_id' => TransactionLog::BRANCH_LOCAL,
'item_id' => $exercise_stat_info['exe_id'],
)
);
if (!$transaction) {
$transaction_data = array(
'item_id' => $exercise_stat_info['exe_id'],
);
$transaction = $transaction_controller->createTransaction('exercise_attempt', $transaction_data);
}
$transaction->save();
}
}
// Send notification.

@ -232,7 +232,8 @@ function setFocus(){
$(document).ready(function () {
setFocus();
});
window.onload = advanced_parameters;
//Commented only for Minedu (to show all options upfront)
//window.onload=advanced_parameters;
</script>';
// INIT EXERCISE

@ -417,7 +417,7 @@ function HotPotGCt($folder, $flag, $user_id) {
while (list($key, $val) = each($filelist)) {
if (stristr($val, $user_id.'.t.html')) {
if ($flag == 1) {
my_delete($folder.'/'.$val);
FileManager::my_delete($folder.'/'.$val);
} else {
echo $folder.'/'.$val.'<br />';
}

@ -1499,8 +1499,8 @@ abstract class Question
}
// Level (difficulty).
$select_level = Question::get_default_levels();
$form->addElement('select', 'questionLevel', get_lang('Difficulty'), $select_level);
/*$select_level = Question::get_default_levels();
$form->addElement('select', 'questionLevel', get_lang('Difficulty'), $select_level);*/
// Media question.
@ -1664,8 +1664,12 @@ abstract class Question
if ($a_type[1] != 'FreeAnswer') {
continue;
}
} else {
//Skip other question types, just for minedu
if (!in_array($a_type[1],array('MediaQuestion','UniqueAnswer'))) {
continue;
}
}
// include the class of the type
require_once $a_type[0];
// get the picture of the type and the langvar which describes it

@ -34,8 +34,8 @@ $token = Security::get_token();
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_question_list&exerciseId='.$exerciseId;
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Questions'), get_lang('Type'), get_lang('Category'), get_lang('Difficulty'), get_lang('Score'), get_lang('Actions'));
//$columns = array(get_lang('Questions'), get_lang('Type'), get_lang('Category'), get_lang('Score'));
//$columns = array(get_lang('Questions'), get_lang('Type'), get_lang('Category'), get_lang('Difficulty'), get_lang('Score'), get_lang('Actions'));
$columns = array(get_lang('Questions'), get_lang('Type'), get_lang('Category'), get_lang('Score'));
// Adding filtered question extra fields
$extraField = new ExtraField('question');
@ -64,13 +64,13 @@ $column_model = array(
'align' => 'left',
'sortable' => 'false'
),
array(
/*array(
'name' => 'level',
'index' => 'level',
'width' => '50',
'align' => 'left',
'sortable' => 'false'
),
),*/
array(
'name' => 'score',
'index' => 'score',

Loading…
Cancel
Save