Skip to content

Commit

Permalink
Latest fixes from Thomas Robb - thanks Thomas!
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jul 29, 2003
1 parent 46213aa commit 48705c8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mod/quiz/format/missingword.php
Expand Up @@ -36,7 +36,7 @@ function readquestion($lines) {
$question = NULL;
///$comment added by T Robb
$comment = NULL;
$text = implode($lines, " ");
$text = implode(" ", $lines);

/// Find answer section

Expand Down Expand Up @@ -102,15 +102,14 @@ function readquestion($lines) {
default:
$question->qtype = MULTICHOICE;

#$answers = swapshuffle($answers);
foreach ($answers as $key => $answer) {
$answer = trim($answer);

// Tom's addition starts here
$answeight = 0;
if (strspn($answer,"1234567890%") > 0){
//Make sure that the percent sign is the last in the span
if (strpos($answer,"%") == strspn($answer,"1234567890%")) {
if (strpos($answer,"%") == strspn($answer,"1234567890%") - 1) {
$answeight0 = substr($answer,0,strspn($answer,"1234567890%"));
$answeight = round(($answeight0/100),2);
$answer = substr($answer,(strspn($answer,"1234567890%")));
Expand All @@ -130,7 +129,7 @@ function readquestion($lines) {
$comment = addslashes(substr(($answer),$hashpos+1));
$answer = substr($answer,0,$hashpos);
} else {
$comment = "";
$comment = " ";
}
// End of Tom's addition

Expand Down

0 comments on commit 48705c8

Please sign in to comment.