version 1.71.4.1, 2017/06/21 19:55:03
|
version 1.72, 2016/05/15 17:40:34
|
Line 449 function callradiostringeval(newval) {
|
Line 449 function callradiostringeval(newval) {
|
return 'onclick="parent.radiostringeval(\''+newval+'\')"'; |
return 'onclick="parent.radiostringeval(\''+newval+'\')"'; |
} |
} |
|
|
|
function lenienteval(newval) { |
|
if (newval == 'weighted') { |
|
if (document.getElementById('lenientweighteddiv')) { |
|
document.getElementById('lenientweighteddiv').style.display='block'; |
|
} |
|
var patternRelWeight = /^\-?[\d.]+$/; |
|
var sform=choices.document.forms.sch; |
|
if ((sform.lenientrelwt.length != 'undefined') && (sform.lenientrelwt.length) != 'null') { |
|
for (var i=0; i<sform.lenientrelwt.length; i++) { |
|
var relweight = sform.lenientrelwt[i].value; |
|
relweight = relweight.replace(/^\s+|\s+$/g,''); |
|
if (!patternRelWeight.test(relweight)) { |
|
if (i<2) { |
|
relweight = '1.0'; |
|
} else { |
|
relweight = '0.0'; |
|
} |
|
} |
|
sform.lenientrelwt[i].value = relweight; |
|
if (i==0) { |
|
svalue = relweight; |
|
} else { |
|
svalue += ','+relweight; |
|
} |
|
} |
|
} |
|
} else { |
|
if (document.getElementById('lenientweighteddiv')) { |
|
document.getElementById('lenientweighteddiv').style.display='none'; |
|
} |
|
svalue=newval; |
|
} |
|
draw(); |
|
} |
|
|
|
function calllenientradioeval(newval) { |
|
return 'onclick="parent.lenienteval(\''+newval+'\')"'; |
|
} |
|
|
function callintervalpmodval() { |
function callintervalpmodval() { |
return 'onclick="parent.intcalc();parent.toggleSecret()"'; |
return 'onclick="parent.intcalc();parent.toggleSecret()"'; |
} |
} |
Line 774 function draw() {
|
Line 813 function draw() {
|
choicewrite('<label><input name="stringval" value="exam"'+ |
choicewrite('<label><input name="stringval" value="exam"'+ |
' type="radio" '+callradiostringeval('exam')); |
' type="radio" '+callradiostringeval('exam')); |
if (svalue=='exam') { choicewrite(' checked="checked"'); } |
if (svalue=='exam') { choicewrite(' checked="checked"'); } |
choicewrite(' /> Exam</label><br />'); |
choicewrite(' /> Bubblesheet Exam</label><br />'); |
// choicewrite('<label><input name="stringval" value="assess"'+ |
// choicewrite('<label><input name="stringval" value="assess"'+ |
// ' type="radio" '+callradiostringeval('assess')); |
// ' type="radio" '+callradiostringeval('assess')); |
// if (svalue=='assess') { choicewrite(' checked="checked"'); } |
// if (svalue=='assess') { choicewrite(' checked="checked"'); } |
Line 809 function draw() {
|
Line 848 function draw() {
|
choicewrite(' /> Library</label><br />'); |
choicewrite(' /> Library</label><br />'); |
} |
} |
if (pscat=='lenient') { |
if (pscat=='lenient') { |
|
var patternLenientStd = /^(yes|no|default)$/; |
|
var patternLenientRel = /^([\-\d\.]+)\,([\-\d\.]+)\,([\-\d\.]+)\,([\-\d\.]+)$/; |
|
var lenientweighted = 'none'; |
|
var relatives = new Array; |
tablestart('Lenient Grading (Partial Credit)'); |
tablestart('Lenient Grading (Partial Credit)'); |
choicewrite('<tr><td>Value:</td><td colspan="2">'); |
choicewrite('<tr><td>Value:</td><td colspan="2">'); |
choicewrite('<label><input name="stringval" value="yes"'+ |
choicewrite('<label><input name="stringval" value="yes"'+ |
' type="radio" '+callradiostringeval('yes')); |
' type="radio" '+calllenientradioeval('yes')); |
if (svalue=='yes') { choicewrite(' checked="checked"'); } |
if (svalue=='yes') { choicewrite(' checked="checked"'); } |
choicewrite(' /> Yes</label><br />'); |
choicewrite(' /> Yes</label><br />'); |
choicewrite('<label><input name="stringval" value="no"'+ |
choicewrite('<label><input name="stringval" value="no"'+ |
' type="radio" '+callradiostringeval('no')); |
' type="radio" '+calllenientradioeval('no')); |
if (svalue=='no') { choicewrite(' checked="checked"'); } |
if (svalue=='no') { choicewrite(' checked="checked"'); } |
choicewrite(' /> No</label><br />'); |
choicewrite(' /> No</label><br />'); |
choicewrite('<label><input name="stringval" value="default"'+ |
choicewrite('<label><input name="stringval" value="default"'+ |
' type="radio" '+callradiostringeval('default')); |
' type="radio" '+calllenientradioeval('default')); |
if (svalue=='default') { choicewrite(' checked="checked"'); } |
if (svalue=='default') { choicewrite(' checked="checked"'); } |
choicewrite(' /> Default (only bubblesheet grading is lenient)</label><br />'); |
choicewrite(' /> Default (only bubblesheet grading is lenient)</label><br />'); |
|
choicewrite('<label><input name="stringval" value="weighted"'+ |
|
' type="radio" '+calllenientradioeval('weighted')); |
|
if (!patternLenientStd.test(svalue) && svalue != '') { |
|
choicewrite(' checked="checked"'); |
|
lenientweighted='block'; |
|
var relatives = svalue.match(patternLenientRel); |
|
} |
|
choicewrite(' />Yes, weighted (optionresponse in checkbox mode)</label><br /><br />'+ |
|
'<div id="lenientweighteddiv" style="display:'+lenientweighted+'">'+ |
|
'<table class="LC_parmsel_table"><tr bgcolor="#C5DB99">'+ |
|
'<th colspan="2">Foil submission status</th><th>Points</th></tr>'); |
|
var lenienttypes = ['Correct (checked)','Correct (unchecked)','Incorrect (checked)','Incorrect (unchecked)']; |
|
for (var i=0; i<lenienttypes.length; i++) { |
|
var j = i+1; |
|
if (relatives[j] == '') { |
|
if (i < 2) { |
|
relatives[j] = '1.0'; |
|
} else { |
|
relatives[j] = '0.0'; |
|
} |
|
} |
|
choicewrite('<tr><td colspan="2">'+lenienttypes[i]+'</td>'+ |
|
'<td><input type="text" name="lenientrelwt" value="'+relatives[j]+'"'+ |
|
' size="3" onblur="parent.lenienteval(\'weighted\')" /></td></tr>'); |
|
} |
|
choicewrite('</table></div>'); |
} |
} |
if (pscat=='discussvote') { |
if (pscat=='discussvote') { |
tablestart('Discussion Voting'); |
tablestart('Discussion Voting'); |