[svn r12832] Re-activated HotPotatoes tests import link

Fixed scores display for HotPotatoes tests
Commented out useless <hr> at bottom of exercices table (a line can still be set with CSS to mark the table bottom)
skala
Yannick Warnier 19 years ago
parent 67ffae4d4c
commit 05477dc114
  1. 61
      main/exercice/exercice.php

@ -441,7 +441,7 @@ if($show == 'test'){
"<img src=\"../img/new_test.gif\" alt=\"new test\" align=\"absbottom\">&nbsp;<a href=\"exercise_admin.php?".api_get_cidreq()."\">".get_lang("NewEx")."</a>", "<img src=\"../img/new_test.gif\" alt=\"new test\" align=\"absbottom\">&nbsp;<a href=\"exercise_admin.php?".api_get_cidreq()."\">".get_lang("NewEx")."</a>",
//"<img src=\"../img/quiz_na.gif\" alt=\"new test\" valign=\"ABSMIDDLE\"><a href=\"question_pool.php\">".get_lang("QuestionPool")."</a> | ", //"<img src=\"../img/quiz_na.gif\" alt=\"new test\" valign=\"ABSMIDDLE\"><a href=\"question_pool.php\">".get_lang("QuestionPool")."</a> | ",
//" | <img src=\"../img/jqz.jpg\" alt=\"HotPotatoes\" valign=\"ABSMIDDLE\">&nbsp;<a href=\"hotpotatoes.php\">".get_lang("ImportHotPotatoesQuiz")."</a>", " | <img src=\"../img/jqz.jpg\" alt=\"HotPotatoes\" valign=\"ABSMIDDLE\">&nbsp;<a href=\"hotpotatoes.php\">".get_lang("ImportHotPotatoesQuiz")."</a>",
"</td>", "</td>",
"<td width=\"50%\" align=\"right\">"; "<td width=\"50%\" align=\"right\">";
} }
@ -776,7 +776,8 @@ if($show == 'test'){
{ {
$ind++; $ind++;
} }
}echo "<tr><td colspan = '5'><hr></td></tr>"; }
//echo '<tr><td colspan="5"><hr /></td></tr>';
} }
} }
@ -852,37 +853,39 @@ if($_configuration['tracking_enabled'])
$NoTestRes = 0; $NoTestRes = 0;
$NoHPTestRes = 0; $NoHPTestRes = 0;
//Print the results of tests
if(is_array($results)) if(is_array($results))
{ {
for($i = 0; $i < sizeof($results); $i++) for($i = 0; $i < sizeof($results); $i++)
{ {
$id = $results[$i][5]; $id = $results[$i][5];
$mailid = $results[$i][6]; $mailid = $results[$i][6];
?> $user = $results[$i][0];
<tr <?php if($i%2==0) echo 'class="row_odd"'; else echo 'class="row_even"'; ?>> $test = $results[$i][1];
<?php if($is_allowedToEdit): ?> $dt = strftime($dateTimeFormatLong,$results[$i][4]);
<td><?php $user = $results[$i][0]; echo $results[$i][0]; ?></td><?php endif; ?> $res = $results[$i][2];
<td><?php $test = $results[$i][1]; echo $results[$i][1]; ?></td> echo '<tr';
<td><?php $dt = strftime($dateTimeFormatLong,$results[$i][4]); echo format_locale_date(get_lang('dateTimeFormatLong'),$results[$i][4]) ?></td> if($i%2==0) echo 'class="row_odd"'; else echo 'class="row_even"';
<td><?php $res = $results[$i][2]; echo $results[$i][2]; ?> / <?php echo $results[$i][3]; ?></td> echo '>';
<td><?php echo $is_allowedToEdit?"<a href='exercise_show.php?user=$user&dt=$dt&res=$res&id=$id&email=$mailid'>".get_lang("Edit")."</a>":"<a href='exercise_show.php?dt=$dt&res=$res&id=$id'>".get_lang('Show')."</a>"?></td> if($is_allowedToEdit)
{
</tr> $user = $results[$i][0];
echo '<td>'.$user.'</td>';
<?php }
echo '<td>'.$test.'</td>';
echo '<td>'.format_locale_date(get_lang('dateTimeFormatLong'),$results[$i][4]).'</td>';
echo '<td>'.$res.' / '.$results[$i][3].'</td>';
echo '<td>'.($is_allowedToEdit?"<a href='exercise_show.php?user=$user&dt=$dt&res=$res&id=$id&email=$mailid'>".get_lang("Edit")."</a>":"<a href='exercise_show.php?dt=$dt&res=$res&id=$id'>".get_lang('Show')."</a>").'</td>';
echo '</tr>';
} }
} }
else else
{ {
$NoTestRes = 1; $NoTestRes = 1;
} }
// Print the Result of Hotpotatoes Tests
// The Result of Tests
if(is_array($hpresults)) if(is_array($hpresults))
{ {
for($i = 0; $i < sizeof($hpresults); $i++) for($i = 0; $i < sizeof($hpresults); $i++)
{ {
$title = GetQuizName($hpresults[$i][1],$documentPath); $title = GetQuizName($hpresults[$i][1],$documentPath);
@ -890,16 +893,16 @@ if($_configuration['tracking_enabled'])
{ {
$title = GetFileName($hpresults[$i][1]); $title = GetFileName($hpresults[$i][1]);
} }
?> echo '<tr>';
<tr> if($is_allowedToEdit)
<?php if($is_allowedToEdit): ?> {
<td class="content"><?php echo $hpresults[$i][0]; ?></td><?php endif; ?> echo '<td class="content">'.$hpresults[$i][0].'</td>';
<td class="content"><?php echo $title; ?></td> }
<td class="content" align="center"><?php echo strftime($dateTimeFormatLong,$hpresults[$i][4]); ?></td> echo '<td class="content">'.$title.'</td>';
<td class="content" align="center"><?php echo $hpresults[$i][2]; ?> / <?php echo $hpresults[$i][3]; ?></td> echo '<td class="content">'.strftime($dateTimeFormatLong,$hpresults[$i][4]).'</td>';
</tr> echo '<td class="content">'.$hpresults[$i][2].' / '.$hpresults[$i][3].'</td>';
echo '<td></td>'; //there is no possibility to edit the results of a Hotpotatoes test
<?php echo '</tr>';
} }
} }
else else

Loading…
Cancel
Save