Applied fixed from FlintCI

pull/2459/head
root 8 years ago
parent c756bdf1cc
commit cc066c3a13
  1. 4
      plugin/test2pdf/config.php
  2. 2
      plugin/test2pdf/install.php
  3. 4
      plugin/test2pdf/plugin.php
  4. 2
      plugin/test2pdf/src/download-pdf.php
  5. 3
      plugin/test2pdf/src/index.test2pdf.php
  6. 41
      plugin/test2pdf/src/test2pdf.lib.php
  7. 12
      plugin/test2pdf/src/test2pdf_plugin.class.php
  8. 2
      plugin/test2pdf/src/view-pdf.php
  9. 2
      plugin/test2pdf/start.php
  10. 2
      plugin/test2pdf/uninstall.php

@ -2,9 +2,9 @@
/* For licensing terms, see /license.txt */
/**
* Config the plugin.
*
*
* @package chamilo.plugin.test2pdf
*
*
* @author Jose Angel Ruiz <desarrollo@nosolored.com>
*/
require_once __DIR__.'/../../main/inc/global.inc.php';

@ -3,7 +3,7 @@
/**
* This script is included by main/admin/settings.lib.php and generally
* includes things to execute in the main database (settings_current table).
*
*
* @package chamilo.plugin.test2pdf
*/
/**

@ -3,11 +3,11 @@
/**
* This script is a configuration file for the date plugin. You can use it as a master for other platform plugins (course plugins are slightly different).
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins).
*
*
* @package chamilo.plugin.test2pdf
*/
/**
* Plugin details (must be present)
* Plugin details (must be present).
*/
require_once __DIR__.'/config.php';
$plugin_info = Test2pdfPlugin::create()->get_info();

@ -52,7 +52,7 @@ if ($_GET['type'] == 'question' || $_GET['type'] == 'all') {
if (!empty($infoQuestion['description'])) {
$pdf->WriteHTML(removeQuotes($infoQuestion['description']));
}
$infoAnswer = getAnswers($courseId, $value);
foreach ($infoAnswer as $key2 => $value2) {
$pdf->SetFont('Arial', 'I', 10);

@ -1,6 +1,7 @@
<?php
/* For license terms, see /license.txt */
/**
* Index of the Test to pdf plugin courses list
* Index of the Test to pdf plugin courses list.
*
* @package chamilo.plugin.test2pdf
*/

@ -2,7 +2,7 @@
/* For license terms, see /license.txt */
/**
* Functions.
*
*
* @package chamilo.plugin.test2pdf
*/
@ -10,13 +10,13 @@ $letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n'
/**
* List exercises.
*
*
* @param int $courseId Course ID
* @param int $sessionId Session ID
*
*
* @throws Exception
*
* * @return array Results (list of exercice details)
*
* @return array Results (list of exercice details)
*/
function showExerciseCourse($courseId, $sessionId = 0)
@ -39,14 +39,15 @@ function showExerciseCourse($courseId, $sessionId = 0)
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
/**
* List quiz details.
*
*
* @throws Exception
*
*
* @return array Results (list of quiz details)
*/
function getInfoQuiz($courseId, $id)
@ -58,14 +59,15 @@ function getInfoQuiz($courseId, $id)
die("Error Database $tableQuiz");
}
$row = Database::fetch_assoc($res);
return $row;
}
/**
* List question_id.
*
*
* @throws Exception
*
*
* @return array Results (list question ID)
*/
function getQuestions($courseId, $quizId, $sessionId = 0)
@ -74,7 +76,7 @@ function getQuestions($courseId, $quizId, $sessionId = 0)
$tableQuestion = Database::get_course_table(TABLE_QUIZ_QUESTION);
$tableQuiz = Database::get_course_table(TABLE_QUIZ_TEST);
$conditionSession = api_get_session_condition($sessionId, true, true, 'q.session_id');
$sql = "SELECT a.question_id AS question_id
FROM $tableQuizQuestion a
INNER JOIN $tableQuestion b ON a.question_id = b.iid
@ -98,7 +100,7 @@ function getQuestions($courseId, $quizId, $sessionId = 0)
* List question details.
*
* @throws Exception
*
*
* @return array Results (list of question details)
*/
function getInfoQuestion($courseId, $id)
@ -113,14 +115,15 @@ function getInfoQuestion($courseId, $id)
die("Error Database $tableQuestion");
}
$row = Database::fetch_assoc($res);
return $row;
}
/**
* List answer details.
*
*
* @throws Exception
*
*
* @return array Results (list of answer by question_id)
*/
function getAnswers($courseId, $id)
@ -137,14 +140,15 @@ function getAnswers($courseId, $id)
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
/**
* Remove all html tag.
*
*
* @param string $string The string to be stripped of HTML
*
*
* @return string clean of html tag
*/
function removeHtml($string)
@ -188,15 +192,15 @@ function removeHtml($string)
$txt = str_replace("&uuml;", 'ü', $txt);
$txt = str_replace("&Uuml;", 'Ü', $txt);
$txt = str_replace("&uml;", '¨', $txt);
return $txt;
}
/**
* Remove all html tag.
*
*
* @param string $string The string to be stripped of accents
*
*
* @return string clean of html tag
*/
function removeQuotes($string)
@ -230,5 +234,6 @@ function removeQuotes($string)
$txt = str_replace("&uuml;", 'ü', $txt);
$txt = str_replace("&Uuml;", 'Ü', $txt);
$txt = str_replace("uml;", '¨', $txt);
return $txt;
}

@ -1,15 +1,15 @@
<?php
/**
* Plugin class for the Test2Pdf plugin.
*
*
* @package chamilo.plugin.test2pdf
*
*
* @author Jose Angel Ruiz <desarrollo@nosolored.com>
*/
class Test2pdfPlugin extends Plugin
{
public $isCoursePlugin = true;
protected function __construct()
{
parent::__construct(
@ -20,14 +20,14 @@ class Test2pdfPlugin extends Plugin
]
);
}
/**
* @return StaticPlugin
*/
public static function create()
{
static $result = null;
return $result ? $result : $result = new self();
}
@ -38,7 +38,7 @@ class Test2pdfPlugin extends Plugin
{
//Installing course settings
$this->install_course_fields_in_all_courses();
$srcfile1 = __DIR__.'/../resources/img/64/test2pdf.png';
$srcfile2 = __DIR__.'/../resources/img/64/test2pdf_na.png';
$srcfile3 = __DIR__.'/../resources/img/22/test2pdf.png';

@ -2,7 +2,7 @@
/* For license terms, see /license.txt */
/**
* Configuration script for the Test to Pdf plugin.
*
*
* @package chamilo.plugin.test2pdf
*/
/**

@ -3,7 +3,7 @@
/**
* This script initiates a test2pdf plugin.
*
*
* @package chamilo.plugin.test2pdf
*/
require_once __DIR__.'/../../vendor/autoload.php';

@ -4,7 +4,7 @@
* This script is included by main/admin/settings.lib.php when unselecting a plugin
* and is meant to remove things installed by the install.php script in both
* the global database and the courses tables.
*
*
* @package chamilo.plugin.test2pdf
*/
/**

Loading…
Cancel
Save