Fix classes

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 26e5f86310
commit 0d7ff4b6e7
  1. 5
      main/exercise/Draggable.php
  2. 2
      main/exercise/MatchingDraggable.php
  3. 9
      main/exercise/UniqueAnswerImage.php
  4. 41
      main/exercise/exercise_reminder.php
  5. 4
      main/exercise/exercise_submit_modal.php
  6. 4
      main/exercise/fill_blanks.class.php
  7. 4
      main/exercise/freeanswer.class.php
  8. 4
      main/exercise/global_multiple_answer.class.php
  9. 20
      main/exercise/hotspot.class.php
  10. 4
      main/exercise/matching.class.php
  11. 4
      main/exercise/multiple_answer.class.php
  12. 4
      main/exercise/multiple_answer_combination.class.php
  13. 6
      main/exercise/multiple_answer_combination_true_false.class.php
  14. 4
      main/exercise/multiple_answer_true_false.class.php
  15. 6
      main/exercise/oral_expression.class.php
  16. 5
      main/exercise/unique_answer.class.php
  17. 5
      main/exercise/unique_answer_no_option.class.php

@ -8,8 +8,8 @@
*/
class Draggable extends Question
{
static $typePicture = 'ordering.png';
static $explanationLangVar = 'Draggable';
public static $typePicture = 'ordering.png';
public static $explanationLangVar = 'Draggable';
/**
* Class constructor
@ -17,7 +17,6 @@ class Draggable extends Question
public function __construct()
{
parent::__construct();
$this->type = DRAGGABLE;
$this->isContent = $this->getIsContent();
}

@ -9,7 +9,7 @@
class MatchingDraggable extends Question
{
public static $typePicture = 'matchingdrag.png';
static $explanationLangVar = 'MatchingDraggable';
public static $explanationLangVar = 'MatchingDraggable';
/**
* Class constructor

@ -9,13 +9,14 @@
*/
class UniqueAnswerImage extends UniqueAnswer
{
public static $typePicture = 'uaimg.png';
public static $explanationLangVar = 'UniqueAnswerImage';
static $typePicture = 'uaimg.png';
static $explanationLangVar = 'UniqueAnswerImage';
/**
* UniqueAnswerImage constructor.
*/
public function __construct()
{
//this is highly important
parent::__construct();
$this->type = UNIQUE_ANSWER_IMAGE;
$this->isContent = $this->getIsContent();

@ -1,5 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* Exercise reminder overview
* Then it shows the results on the screen.
@ -57,8 +60,9 @@ if (empty($exerciseId)) {
}
if (empty($objExercise)) {
if (!empty($_SESSION['objExercise'])) {
$objExercise = $_SESSION['objExercise'];
$exerciseInSession = Session::read('objExercise');
if (!empty($exerciseInSession)) {
$objExercise = $exerciseInSession;
} else {
$objExercise = null;
}
@ -173,7 +177,7 @@ $attempt_list = Event::getAllExerciseEventByExeId($exe_id);
$remind_list = $exercise_stat_info['questions_to_check'];
$remind_list = explode(',', $remind_list);
$exercise_result = array();
$exercise_result = array();
foreach ($attempt_list as $question_id => $options) {
foreach ($options as $item) {
@ -204,11 +208,10 @@ foreach ($question_list as $questionId) {
unset($objQuestionTmp);
// creates a temporary Question object
$objQuestionTmp = Question :: read($questionId);
$quesId = $objQuestionTmp->selectId();
$check_id = 'remind_list['.$questionId.']';
$attributes = array('id'=>$check_id, 'onclick'=>"save_remind_item(this, '$questionId');");
$objQuestionTmp = Question:: read($questionId);
$quesId = $objQuestionTmp->selectId();
$check_id = 'remind_list['.$questionId.']';
$attributes = array('id' => $check_id, 'onclick' => "save_remind_item(this, '$questionId');");
if (in_array($questionId, $remind_list)) {
$attributes['checked'] = 1;
@ -217,9 +220,8 @@ foreach ($question_list as $questionId) {
$label_attributes['class'] = 'checkbox';
$label_attributes['for'] = $check_id;
$label_attributes['class'] = "checkbox";
$checkbox = Display::input('checkbox', 'remind_list['.$questionId.']', '', $attributes);
$url = 'exercise_submit.php?exerciseId='.$objExercise->id.'&num='.$counter.'&reminder=1';
$checkbox = Display::input('checkbox', 'remind_list['.$questionId.']', '', $attributes);
$url = 'exercise_submit.php?exerciseId='.$objExercise->id.'&num='.$counter.'&reminder=1';
$counter++;
if ($objExercise->type == ONE_PER_PAGE) {
@ -232,14 +234,23 @@ foreach ($question_list as $questionId) {
if (!in_array($questionId, $exercise_result)) {
$question_title = Display::label($question_title, 'warning');
}
$question_title = Display::tag('label', $checkbox.$question_title, $label_attributes);
$table .= Display::div($question_title, array('class'=>'exercise_reminder_item'));
$question_title = Display::tag('label', $checkbox.$question_title, $label_attributes);
$table .= Display::div($question_title, array('class'=>'exercise_reminder_item'));
} // end foreach() block that loops over all questions
echo Display::div($table, array('class'=>'question-check-test'));
$exercise_actions = Display::url(get_lang('EndTest'), 'javascript://', array('onclick'=>'final_submit();', 'class'=>'btn btn-warning'));
$exercise_actions .= '&nbsp;'.Display::url(get_lang('ReviewQuestions'), 'javascript://', array('onclick'=>'review_questions();','class'=>'btn btn-success'));
$exercise_actions = Display::url(
get_lang('EndTest'),
'javascript://',
array('onclick' => 'final_submit();', 'class' => 'btn btn-warning')
);
$exercise_actions .= '&nbsp;'.
Display::url(
get_lang('ReviewQuestions'),
'javascript://',
array('onclick'=>'review_questions();','class'=>'btn btn-success')
);
echo Display::div('', array('class'=>'clear'));
echo Display::div($exercise_actions, array('class'=>'form-actions'));

@ -1,10 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* @package chamilo.exercise
* @author Julio Montoya <gugli100@gmail.com>
*/
use \ChamiloSession as Session;
require_once '../inc/global.inc.php';
api_protect_course_script(false);

@ -10,8 +10,8 @@
**/
class FillBlanks extends Question
{
static $typePicture = 'fill_in_blanks.png';
static $explanationLangVar = 'FillBlanks';
public static $typePicture = 'fill_in_blanks.png';
public static $explanationLangVar = 'FillBlanks';
const FILL_THE_BLANK_STANDARD = 0;
const FILL_THE_BLANK_MENU = 1;

@ -10,8 +10,8 @@
*/
class FreeAnswer extends Question
{
static $typePicture = 'open_answer.png';
static $explanationLangVar = 'FreeAnswer';
public static $typePicture = 'open_answer.png';
public static $explanationLangVar = 'FreeAnswer';
/**
* Constructor

@ -6,8 +6,8 @@
*/
class GlobalMultipleAnswer extends Question
{
static $typePicture = 'mcmagl.png';
static $explanationLangVar = 'GlobalMultipleAnswer';
public static $typePicture = 'mcmagl.png';
public static $explanationLangVar = 'GlobalMultipleAnswer';
/**
*

@ -12,13 +12,16 @@
**/
class HotSpot extends Question
{
static $typePicture = 'hotspot.png';
static $explanationLangVar = 'HotSpot';
public static $typePicture = 'hotspot.png';
public static $explanationLangVar = 'HotSpot';
/**
* HotSpot constructor.
*/
public function __construct()
{
parent::__construct();
$this -> type = HOT_SPOT;
$this->type = HOT_SPOT;
}
public function display()
@ -91,17 +94,20 @@ class HotSpot extends Question
*/
class HotSpotDelineation extends HotSpot
{
static $typePicture = 'hotspot-delineation.png';
static $explanationLangVar = 'HotspotDelineation';
public static $typePicture = 'hotspot-delineation.png';
public static $explanationLangVar = 'HotspotDelineation';
function __construct()
/**
* HotSpotDelineation constructor.
*/
public function __construct()
{
parent::__construct();
$this -> type = HOT_SPOT_DELINEATION;
}
function createForm (&$form, $fck_config=0)
function createForm(&$form, $fck_config=0)
{
parent::createForm ($form, $fck_config);
}

@ -14,8 +14,8 @@
*/
class Matching extends Question
{
static $typePicture = 'matching.png';
static $explanationLangVar = 'Matching';
public static $typePicture = 'matching.png';
public static $explanationLangVar = 'Matching';
/**
* Constructor

@ -12,8 +12,8 @@
**/
class MultipleAnswer extends Question
{
static $typePicture = 'mcma.png';
static $explanationLangVar = 'MultipleSelect';
public static $typePicture = 'mcma.png';
public static $explanationLangVar = 'MultipleSelect';
/**
* Constructor

@ -13,8 +13,8 @@
**/
class MultipleAnswerCombination extends Question
{
static $typePicture = 'mcmac.png';
static $explanationLangVar = 'MultipleSelectCombination';
public static $typePicture = 'mcmac.png';
public static $explanationLangVar = 'MultipleSelectCombination';
/**
* Constructor

@ -12,9 +12,9 @@
**/
class MultipleAnswerCombinationTrueFalse extends MultipleAnswerCombination
{
static $typePicture = 'mcmaco.png';
static $explanationLangVar = 'MultipleAnswerCombinationTrueFalse';
var $options;
public static $typePicture = 'mcmaco.png';
public static $explanationLangVar = 'MultipleAnswerCombinationTrueFalse';
public $options;
/**
* Constructor

@ -11,8 +11,8 @@
*/
class MultipleAnswerTrueFalse extends Question
{
static $typePicture = 'mcmao.png';
static $explanationLangVar = 'MultipleAnswerTrueFalse';
public static $typePicture = 'mcmao.png';
public static $explanationLangVar = 'MultipleAnswerTrueFalse';
public $options;
/**

@ -11,9 +11,8 @@
*/
class OralExpression extends Question
{
static $typePicture = 'audio_question.png';
static $explanationLangVar = 'OralExpression';
public static $typePicture = 'audio_question.png';
public static $explanationLangVar = 'OralExpression';
private $sessionId;
private $userId;
private $exerciseId;
@ -21,7 +20,6 @@ class OralExpression extends Question
private $storePath;
private $fileName;
private $filePath;
public $available_extensions = array('wav', 'ogg');
/**

@ -14,15 +14,14 @@
**/
class UniqueAnswer extends Question
{
static $typePicture = 'mcua.png';
static $explanationLangVar = 'UniqueSelect';
public static $typePicture = 'mcua.png';
public static $explanationLangVar = 'UniqueSelect';
/**
* Constructor
*/
public function __construct()
{
//this is highly important
parent::__construct();
$this->type = UNIQUE_ANSWER;
$this->isContent = $this->getIsContent();

@ -12,15 +12,14 @@
*/
class UniqueAnswerNoOption extends Question
{
static $typePicture = 'mcuao.png';
static $explanationLangVar = 'UniqueAnswerNoOption';
public static $typePicture = 'mcuao.png';
public static $explanationLangVar = 'UniqueAnswerNoOption';
/**
* Constructor
*/
public function __construct()
{
//this is highly important
parent::__construct();
$this -> type = UNIQUE_ANSWER_NO_OPTION;
$this -> isContent = $this-> getIsContent();

Loading…
Cancel
Save