Skip to content

Commit

Permalink
Merge branch 'master' of github.com:drlippman/IMathAS
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lippman committed Jan 6, 2015
2 parents d1a7ca8 + 20195ce commit afa2540
Show file tree
Hide file tree
Showing 14 changed files with 1,137 additions and 18 deletions.
12 changes: 6 additions & 6 deletions assessment/displayq2.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ function displayq($qnidx,$qidx,$seed,$doshowans,$showhints,$attemptn,$returnqtxt
$laparts = explode("&",$la);
foreach ($anstypes as $kidx=>$anstype) {
$qcol = ($qdata['qtype']=="multipart" && isset($qcolors[$kidx]))?(is_numeric($qcolors[$kidx])?rawscoretocolor($qcolors[$kidx],$answeights[$kidx]):$qcolors[$kidx]):'';
list($answerbox[$kidx],$tips[$kidx],$shanspt[$kidx],$previewloc[$kidx]) = makeanswerbox($anstype,$kidx,$laparts[$kidx],$options,$qnidx+1,$qcol);
list($answerbox[$kidx],$entryTips[$kidx],$shanspt[$kidx],$previewloc[$kidx]) = makeanswerbox($anstype,$kidx,$laparts[$kidx],$options,$qnidx+1,$qcol);
}
} else {
$qcol = isset($qcolors[0])?(is_numeric($qcolors[0])?rawscoretocolor($qcolors[0],1):$qcolors[0]):'';
list($answerbox,$tips[0],$shanspt[0],$previewloc) = makeanswerbox($qdata['qtype'],$qnidx,$la,$options,0,$qcol);
list($answerbox,$entryTips[0],$shanspt[0],$previewloc) = makeanswerbox($qdata['qtype'],$qnidx,$la,$options,0,$qcol);
}
if ($qdata['qtype']=='conditional') {
$qcol = isset($qcolors[0])?(is_numeric($qcolors[0])?rawscoretocolor($qcolors[0],1):$qcolors[0]):'';
Expand Down Expand Up @@ -320,7 +320,7 @@ function displayq($qnidx,$qidx,$seed,$doshowans,$showhints,$attemptn,$returnqtxt
$showanswerloc .= (isset($showanswerstyle) && $showanswerstyle=='inline')?'</span>':'</div>';
} else {
$showanswerloc = array();
foreach($tips as $iidx=>$tip) {
foreach($entryTips as $iidx=>$entryTip) {
$showanswerloc[$iidx] = (isset($showanswerstyle) && $showanswerstyle=='inline')?'<span>':'<div>';
if ($doshowans && (!isset($showanswer) || (is_array($showanswer) && !isset($showanswer[$iidx]))) && $shanspt[$iidx]!=='') {
if ($nosabutton) {
Expand Down Expand Up @@ -446,11 +446,11 @@ function displayq($qnidx,$qidx,$seed,$doshowans,$showhints,$attemptn,$returnqtxt

echo "<div>";

foreach($tips as $iidx=>$tip) {
foreach($entryTips as $iidx=>$entryTip) {
if ((!isset($hidetips) || (is_array($hidetips) && !isset($hidetips[$iidx])))&& !$seqinactive && $showtips>0) {
echo "<p class=\"tips\" ";
if ($showtips!=1) { echo 'style="display:none;" ';}
echo ">", _('Box'), " ".($iidx+1).": <span id=\"tips$qnidx-$iidx\">".filter($tip)."</span></p>";
echo ">", _('Box'), " ".($iidx+1).": <span id=\"tips$qnidx-$iidx\">".filter($entryTip)."</span></p>";
}
if ($doshowans && strpos($toevalqtxt,'$showanswerloc')===false && is_array($showanswerloc) && isset($showanswerloc[$iidx])) {
echo '<div>'.$showanswerloc[$iidx].'</div>';
Expand Down Expand Up @@ -1558,7 +1558,7 @@ function makeanswerbox($anstype, $qn, $la, $options,$multi,$colorbox='') {
if (count($ovar)==0) {
$ovar[] = "x";
}
$vlist = implode("|",$ovar);
$vlist = implode("|",$variables);
$flist = implode('|',$ofunc);
$out .= "<script type=\"text/javascript\">functoproc[$qn] = 1; vlist[$qn]=\"$vlist\"; flist[$qn]=\"$flist\";</script>\n";
if (isset($domain)) {$fromto = explode(",",$domain);} else {$fromto[0]=-10; $fromto[1]=10;}
Expand Down
4 changes: 2 additions & 2 deletions assessment/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function getlastanswer(qn, part) {
}

if ($sessiondata['graphdisp']==1) {
echo "<script src=\"$imasroot/javascript/ASCIIsvg_min.js?v=101314\" type=\"text/javascript\"></script>\n";
echo "<script src=\"$imasroot/javascript/ASCIIsvg_min.js?v=121514\" type=\"text/javascript\"></script>\n";
echo "<script type=\"text/javascript\">var usingASCIISvg = true;</script>";
} else {
echo "<script src=\"$imasroot/javascript/mathjs.js?v=101314\" type=\"text/javascript\"></script>\n";
Expand All @@ -115,7 +115,7 @@ function getlastanswer(qn, part) {
}
</style>
<![endif]-->
<script src="<?php echo $imasroot . "/javascript/AMhelpers_min.js?v=101314";?>" type="text/javascript"></script>
<script src="<?php echo $imasroot . "/javascript/AMhelpers_min.js?v=121514";?>" type="text/javascript"></script>
<script src="<?php echo $imasroot . "/javascript/confirmsubmit.js";?>" type="text/javascript"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
Expand Down
18 changes: 18 additions & 0 deletions assessment/libs/interval_ext.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<html><body>
<h1>Macro Library interval_ext</h1>
Interval functions extension. Version 1.0 November 4, 2014
<BR><ul>
<li><a href="#canonicInterval">canonicInterval</a></li>
<li><a href="#intersection">intersection</a></li>
</ul>
<h3><a name="canonicInterval">canonicInterval</a></h3>
canonicInterval(IntervalString)
<BR>Forms a canonic interval string, consisting of a union of connected intervalls sorted by order
<BR>IntervalString: Union of intervals as string
<BR>Example: canonicInterval("[2,2^2) U (-1,3]")="(-1,2^2)"
<BR><h3><a name="intersection">intersection</a></h3>
intersection(arrayOfIntervals)
<BR>Forms the intersection of unions of intervals in an array
<BR>arrayOfIntervals: array of strings in interval notation, ex: [2,5)
<BR>Example: intersection(array("(-2,0) U (0,2)","[-1,1)"))="[-1,0) U (0,1)"
<BR>
Loading

0 comments on commit afa2540

Please sign in to comment.