Feature #747 - Elimination of obsolete code for Tex parsing.

skala
Ivan Tcholakov 15 years ago
parent 6388bd2f00
commit 31c04395b8
  1. 5
      main/exercice/answer_admin.inc.php
  2. 7
      main/exercice/exercice_submit.php
  3. 5
      main/exercice/exercise.lib.php
  4. 7
      main/exercice/exercise_result.php
  5. 10
      main/exercice/exercise_show.php

@ -281,8 +281,10 @@ if($submitAnswers || $buttonBack)
$reponse=str_replace('::','',$reponse);
// we save the answer because it will be modified
$temp=$reponse;
//$temp=$reponse;
$temp = text_filter($reponse);
/* // Deprecated code.
// 1. find everything between the [tex] and [/tex] tags
$startlocations=api_strpos($temp,'[tex]');
$endlocations=api_strpos($temp,'[/tex]');
@ -294,6 +296,7 @@ if($submitAnswers || $buttonBack)
// 2. replace this by {texcode}
$temp=str_replace($texstring,"{texcode}",$temp);
}
*/
// blanks will be put into an array
$blanks=Array();

@ -519,8 +519,10 @@ if ($formSent) {
$answerWeighting = explode(',', $is_set_switchable[0]);
// we save the answer because it will be modified
$temp = $answer;
//$temp = $answer;
$temp = text_filter($answer);
/* // Deprecated code
// TeX parsing
// 1. find everything between the [tex] and [/tex] tags
$startlocations = api_strpos($temp, '[tex]');
@ -531,6 +533,7 @@ if ($formSent) {
// 2. replace this by {texcode}
$temp = str_replace($texstring, '{texcode}', $temp);
}
*/
$answer = '';
$j = 0;
@ -545,9 +548,11 @@ if ($formSent) {
if (($pos = api_strpos($temp, '[')) === false) {
// adds the end of the text
$answer = $temp;
/* // Deprecated code
// TeX parsing - replacement of texcode tags
$texstring = api_parse_tex($texstring);
$answer = str_replace("{texcode}", $texstring, $answer);
*/
$real_text[] = $answer;
break; //no more "blanks", quit the loop
}

@ -150,6 +150,8 @@ function showQuestion($questionId, $onlyAnswers = false, $origin = false, $curre
list($answer) = explode('::',$answer);
// because [] is parsed here we follow this procedure:
$answer = text_filter($answer);
/* // Deprecated code
// 1. find everything between the [tex] and [/tex] tags
$startlocations = api_strpos($answer,'[tex]');
$endlocations = api_strpos($answer,'[/tex]');
@ -159,6 +161,7 @@ function showQuestion($questionId, $onlyAnswers = false, $origin = false, $curre
// 2. replace this by {texcode}
$answer = str_replace($texstring,'{texcode}',$answer);
}
*/
// 3. do the normal matching parsing
// replaces [blank] by an input field
@ -207,9 +210,11 @@ function showQuestion($questionId, $onlyAnswers = false, $origin = false, $curre
*/
/* // Deprecated code
// 5. replace the {texcode by the api_pare_tex parsed code}
$texstring = api_parse_tex($texstring);
$answer=str_replace("{texcode}",$texstring,$answer);
*/
}

@ -685,8 +685,10 @@ foreach ($questionList as $questionId) {
$answerWeighting = explode(',',$is_set_switchable[0]);
// we save the answer because it will be modified
$temp=$answer;
//$temp=$answer;
$temp = text_filter($answer);
/* // Deprecated code.
// TeX parsing
// 1. find everything between the [tex] and [/tex] tags
$startlocations=api_strpos($temp,'[tex]');
@ -698,6 +700,7 @@ foreach ($questionList as $questionId) {
// 2. replace this by {texcode}
$temp=str_replace($texstring,'{texcode}',$temp);
}
*/
$answer='';
$j=0;
@ -714,9 +717,11 @@ foreach ($questionList as $questionId) {
{
// adds the end of the textsolution
$answer=$temp;
/* // Deprecated code.
// TeX parsing - replacement of texcode tags
$texstring = api_parse_tex($texstring);
$answer=str_replace("{texcode}",$texstring,$answer);
*/
$real_text[] = $answer;
break; //no more "blanks", quit the loop
}

@ -634,8 +634,10 @@ if ($show_results) {
//$answerWeighting=explode(',',$answerWeighting);
// we save the answer because it will be modified
$temp=$answer;
//$temp=$answer;
$temp = text_filter($answer);
/* // Deprecated code
// TeX parsing
// 1. find everything between the [tex] and [/tex] tags
$startlocations=api_strpos($temp,'[tex]');
@ -645,6 +647,8 @@ if ($show_results) {
// 2. replace this by {texcode}
$temp=str_replace($texstring,'{texcode}',$temp);
}
*/
$j=0;
// the loop will stop at the end of the text
$i=0;
@ -655,8 +659,10 @@ if ($show_results) {
if (($pos = api_strpos($temp,'[')) === false) {
// adds the end of the text
$answer.=$temp;
/* // Deprecated code
// TeX parsing
$texstring = api_parse_tex($texstring);
*/
break;
}
$temp=api_substr($temp,$pos+1);
@ -703,9 +709,11 @@ if ($show_results) {
if (($pos = api_strpos($temp,'[')) === false) {
// adds the end of the text
$answer.=$temp;
/* // Deprecated code
// TeX parsing
$texstring = api_parse_tex($texstring);
//$answer=str_replace("{texcode}",$texstring,$answer);
*/
break;
}
// adds the piece of text that is before the blank and ended by [

Loading…
Cancel
Save