Skip to content

Commit

Permalink
Hide link to assessment w "0(IP)" grade on "immediately" show answer …
Browse files Browse the repository at this point in the history
…setting
  • Loading branch information
drlippman committed Apr 29, 2018
1 parent d99e02e commit 88926e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
16 changes: 9 additions & 7 deletions course/gbtable2.php
Original file line number Diff line number Diff line change
Expand Up @@ -1069,11 +1069,7 @@ function gbtable() {
if (isset($GLOBALS['includelastchange']) && $GLOBALS['includelastchange']==true) {
$gb[$row][1][$col][9] = $l['endtime'];
}
if (in_array(-1,$scores)) {
$IP=1;
} else {
$IP=0;
}

/*
Moved up to exception finding so LP mark will show on unstarted assessments
if (isset($exceptions[$l['assessmentid']][$l['userid']])) {
Expand Down Expand Up @@ -1114,7 +1110,13 @@ function gbtable() {
}
$gb[$row][1][$col][10] = $canuselatepass;

if ($canviewall || $sa[$i]=="I" || ($sa[$i]!="N" && $now>$thised)) { //|| $assessmenttype[$i]=="Practice"
if (in_array(-1,$scores) && ($thised>$now || !empty($GLOBALS['alwaysshowIP'])) && (($timelimits[$i]==0) || ($timeused < $timelimits[$i]*$timelimitmult[$l['userid']]))) {
$IP=1;
} else {
$IP=0;
}

if ($canviewall || ($sa[$i]=="I" && ($pts>0 || $IP==0)) || ($sa[$i]!="N" && $now>$thised)) { //|| $assessmenttype[$i]=="Practice"
$gb[$row][1][$col][2] = 1; //show link
} /*else if ($l['timelimit']<0 && (($now - $l['starttime'])>abs($l['timelimit'])) && $sa[$i]!='N' && ($assessmenttype[$k]=='EachAtEnd' || $assessmenttype[$k]=='EndReview' || $assessmenttype[$k]=='AsGo' || $assessmenttype[$k]=='Homework')) ) {
//has "kickout after time limit" set, time limit has passed, and is set for showing each score
Expand All @@ -1137,7 +1139,7 @@ function gbtable() {
$gb[$row][1][$col][3] = 1; //no credit
$pts = 0;
}
} else if ($IP==1 && ($thised>$now || !empty($GLOBALS['alwaysshowIP'])) && (($timelimits[$i]==0) || ($timeused < $timelimits[$i]*$timelimitmult[$l['userid']]))) {
} else if ($IP==1) {
$gb[$row][1][$col][0] = $pts; //the score
$gb[$row][1][$col][3] = 2; //in progress
$countthisone =true;
Expand Down
13 changes: 10 additions & 3 deletions help.html
Original file line number Diff line number Diff line change
Expand Up @@ -2519,7 +2519,10 @@ <h3><a name="function">Function</a></h3>
<p><b>Required Variables</b><BR>
<dl>
<dt>$answer = string </dt>
<dd>Defines the answer function, entered as a string. For example, $answer="2sin(x)"</dd>
<dd>Defines the answer function, entered as a string. For example, $answer="2sin(x)". You can
specify multiple acceptable answers by separating with a comma, like $answer="x^2 or x^4"<br/>
Note: The system will accept any algebraically equivalent answer. To only allow answers of a
specific format, you'll also need to define $requiretimes (see below).</dd>
</dl>
</p>
<p><b>Optional Variables</b><BR>
Expand All @@ -2542,15 +2545,19 @@ <h3><a name="function">Function</a></h3>
Include "ignore_case,false" to make the search case sensitive.
Include "ignore_symbol,$" (or some symbol other than $) at the beginning of the $requiretimes to ignore that symbol in the answer<br/>
Note that commas are ignored by default with Function type, and a basic exponent like x^(-3) is converted to x^-3 before the check.</dd>
<dt>$answerformat = "equation" or "toconst" </dt>
<dt>$answerformat = "equation" or "toconst" or "nosoln" or "nosolninf" (can combine, like "equation,nosoln")</dt>
<dd>By default, the student answer is expected to be an expression, and be equivalent (at points) to the specified answer. This option changes
this behavior.<br/>
"equation": Specifies that the answer expected is an equation rather than an expression. The given
answer should also be an equation. Be sure to specify all variables in the equation in $variables. This may fail
on equations that are near zero for most values of the input; this can often be overcome by changing the $domain<br/>
"toconst": Specifies that the answer provided by the student is allowed to differ from the specified answer by a constant
for all inputs. Appropriate for comparing antiderivatives. This may fail on expressions that evaluate to very large
values or raise numbers to very large powers.</dd>
values or raise numbers to very large powers.<br/>
"nosoln" or "nosolninf" adds a list radio buttons for "no solutions" and optionally "infinite solutions".
$ansprompt can override the default statements like this:
$ansprompt = "One function, f(x)=;No such function exists"
</dd>
<dt>$formatfeedbackon = true</dt>
<dd>Turns on "right answer, wrong format" feedback on the question</dd>
<dt>$reltolerance = a decimal value </dt>
Expand Down

0 comments on commit 88926e3

Please sign in to comment.