Minor - format code, update php docs

pull/2458/head
jmontoyaa 8 years ago
parent a681617d2c
commit ad2ac9db43
  1. 3
      main/exercise/ReadingComprehension.php
  2. 3
      main/exercise/UniqueAnswerImage.php
  3. 3
      main/exercise/fill_blanks.class.php
  4. 5
      main/exercise/hotpotatoes.lib.php
  5. 2
      main/exercise/question.class.php
  6. 3
      main/exercise/unique_answer.class.php
  7. 17
      main/exercise/unique_answer_no_option.class.php

@ -1,8 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
/**
* Class ReadingComprehension
*
@ -165,7 +163,6 @@ class ReadingComprehension extends UniqueAnswer
$my_id = isset($_REQUEST['myid']) ? intval($_REQUEST['myid']) : null;
$form->addElement('hidden', 'myid', $my_id);
$form->addRule('questionName', get_lang('GiveQuestion'), 'required');
$isContent = isset($_REQUEST['isContent']) ? intval($_REQUEST['isContent']) : null;
// default values

@ -51,7 +51,8 @@ class UniqueAnswerImage extends UniqueAnswer
$commentTitle = '<th >'.get_lang('Comment').'</th>';
}
$html = '<div class="alert alert-success" role="alert">'.get_lang('UniqueAnswerImagePreferredSize200x150').'</div>';
$html = '<div class="alert alert-success" role="alert">'.
get_lang('UniqueAnswerImagePreferredSize200x150').'</div>';
$html .= '<table class="table table-striped table-hover">
<thead>
<tr style="text-align: center;">

@ -1328,7 +1328,8 @@ class FillBlanks extends Question
* @param string $answer
* @param string $correct
* @param string $feedbackType
* @param bool $resultsDisabled
* @param bool $resultsDisabled
* @param bool $showTotalScoreAndUserChoices
*
* @return string
*/

@ -146,7 +146,10 @@ function WriteFileCont($full_file_path, $content)
{
// Check if this is not an attack, trying to get into other directories or something like that.
$_course = api_get_course_info();
if (Security::check_abs_path(dirname($full_file_path).'/', api_get_path(SYS_COURSE_PATH).$_course['path'].'/')) {
if (Security::check_abs_path(
dirname($full_file_path).'/',
api_get_path(SYS_COURSE_PATH).$_course['path'].'/'
)) {
// Check if this is not an attack, trying to upload a php file or something like that.
if (basename($full_file_path) != Security::filter_filename(basename($full_file_path))) {
return false;

@ -1805,8 +1805,8 @@ abstract class Question
echo '<div class="well">';
echo '<ul class="question_menu">';
foreach ($question_type_custom_list as $i => $a_type) {
// @todo remove require_once classes are already loaded using composer
// include the class of the type
require_once $a_type[0];
// get the picture of the type and the langvar which describes it

@ -57,7 +57,6 @@ class UniqueAnswer extends Question
*/
$feedback_title = '';
if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {
//Scenario
$comment_title = '<th width="20%">'.get_lang('Comment').'</th>';
@ -143,8 +142,6 @@ class UniqueAnswer extends Question
if (isset($answer->destination[$i])) {
$item_list = explode('@@', $answer->destination[$i]);
}
$try = isset($item_list[0]) ? $item_list[0] : '';
$lp = isset($item_list[1]) ? $item_list[1] : '';
$list_dest = isset($item_list[2]) ? $item_list[2] : '';

@ -40,8 +40,9 @@ class UniqueAnswerNoOption extends Question
'Width' => '100%',
'Height' => '125'
];
//this line define how many question by default appear when creating a choice question
$nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 3; // The previous default value was 2. See task #1759.
// This line define how many question by default appear when creating a choice question
// The previous default value was 2. See task #1759.
$nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 3;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
/*
@ -52,7 +53,6 @@ class UniqueAnswerNoOption extends Question
*/
$feedback_title = '';
$comment_title = '';
if ($obj_ex->selectFeedbackType() == 1) {
$editor_config['Width'] = '250';
$editor_config['Height'] = '110';
@ -116,8 +116,6 @@ class UniqueAnswerNoOption extends Question
}
}
$i = 1;
//for ($k = 1 ; $k <= $real_nb_answers; $k++) {
foreach ($new_list as $key) {
$i = $key;
$form->addElement('html', '<tr>');
@ -242,18 +240,12 @@ class UniqueAnswerNoOption extends Question
->freeze();
$form->addElement('hidden', 'position['.$i.']', '666');
$form->addElement('radio', 'correct', null, null, $i, ['class' => 'checkbox', 'disabled' => true]);
$form->addElement('html_editor', 'answer['.$i.']', null, [], $editor_config);
$form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('html_editor', 'comment['.$i.']', null, [], $editor_config);
//$form->addElement('select', 'destination'.$i, get_lang('SelectQuestion').' : ',$select_question,'multiple');
$form
->addElement('text', "weighting[$i]", null)
->freeze();
$form ->addElement('text', "weighting[$i]", null)->freeze();
$form->addHTml('</tr>');
$form->addHtml('</tbody></table>');
@ -335,7 +327,6 @@ class UniqueAnswerNoOption extends Question
{
$destination_str.=$destination_id.';';
}*/
$goodAnswer = ($correct == $i) ? true : false;
if ($goodAnswer) {

Loading…
Cancel
Save