File:  [LON-CAPA] / loncom / interface / spreadsheet / default_assesscalc
Revision 1.6: download - view: text, annotated - select for diffs
Fri Dec 13 16:36:34 2002 UTC (21 years, 5 months ago) by matthew
Branches: MAIN
CVS tags: version_0_99_3, version_0_99_2, version_0_99_1, version_0_99_0, version_0_6_2, version_0_6, conference_2003, HEAD
Use multiline format to reduce the number of ternary operators.
Handle excused status - if stores_0_solved is 'excused, the available
points and awarded points fields are set to 0.
This should be a part of version 0.6

<field col=A row=0>
if ([stores_0_solved] eq 'excused') {
    'excused';
} elsif (M0) { 
    if(K0) {
        if (K0 == M0) {
            "correct";
        } else {
            K0.'/'.M0.' correct';
        }
    } else {
        "incorrect";
    }
} else {
    '';
}
</field>

<field col=B row=0>'Tries:'</field>
<field col=C row=0>
if (M0) {
    [&EXPANDSUM(PART;stores_PART_tries)]/M0;
} else {
    '';
}
</field>

<field col=D row=0>'Timestamp:'</field>
<field col=E row=0>[timestamp]</field>
<field col=F row=0>
if ([timestamp]>100000000) { 
    $tmp = localtime([timestamp]); 
    $tmp =~ s/\s/&nbsp;/g;
    $tmp;
} else {
    '';
}
</field>

<field col=G row=0>'Duedate:'</field>
<field col=H row=0>[parameter_0_duedate]</field>
<field col=I row=0>
if ([parameter_0_duedate]>100000000) { 
    $tmp = localtime([parameter_0_duedate]); 
    $tmp =~ s/\s/&nbsp;/g;
    $tmp;
} else {
    '';
}
</field>

<field col=J row=0>'Attempted Parts:'</field>
<field col=K row=0>[&EXPANDSUM(PART;(stores_PART_solved?1:0))]</field>

<field col=L row=0>'Solved Parts:'</field>
<field col=M row=0>[&EXPANDSUM(PART;(stores_PART_awarded?1:0))]</field>

<field col=W row=0>'Available Points:'</field>
<field col=X row=0>
if (([stores_0_solved]) eq 'excused') { 
    0 
} else { 
    [&EXPANDSUM(PART;parameter_PART_weight)];
}
</field>

<field col=Y row=0>'Awarded Points:'</field>
<field col=Z row=0>
if (([stores_0_solved]) eq 'excused') { 
    0 
} else { 
    [&EXPANDSUM(PART;parameter_PART_weight*stores_PART_awarded)]
}
</field>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>