MantisBT - ATutor
View Issue Details
0003544ATutorTests/Surveyspublic2008-08-26 07:332010-09-22 11:50
harris 
harris 
normalfeaturealways
closedfixed 
 
2.0 
SVN
0003544: One button to add points to all questions
If all questions shares the same points, use a button to add the desire points to all the questions instead of going through all individually.

For example, 100 multiple choices with point 1.
No tags attached.
Issue History
2008-08-26 07:33harrisNew Issue
2008-08-26 07:33harrisAffects version => SVN
2008-08-26 09:49IndieRectNote Added: 0003151
2010-04-24 13:17PyrrhonNote Added: 0004173
2010-05-02 14:49gregStatusnew => assigned
2010-05-02 14:49gregAssigned To => harris
2010-05-04 11:59harrisStatusassigned => resolved
2010-05-04 11:59harrisResolutionopen => fixed
2010-05-04 11:59harrisNote Added: 0004235
2010-05-13 08:29harrisStatusresolved => assigned
2010-05-13 08:29harrisStatusassigned => resolved
2010-05-13 08:29harrisFixed in Version => 2.0
2010-09-22 11:50gregStatusresolved => closed

Notes
(0003151)
IndieRect   
2008-08-26 09:49   
Got that feature recently implemented here in the TSTU. See if that suits you.
It also works when questions don't necessarily have the same points.

1. In tools/tests/questions.php, right after

<form action="<?php echo $_SERVER['PHP_SELF']; ?>?tid=<?php echo $tid; ?>" method="post" name="form">

Add:

    <div class="input-form">
        <div class="row">
            <?php echo _AT('set_all_weights_tstu'); ?>
        </div>
        <div class="row">
            <label for="all_weights"><?php echo _AT('points') . ':'; ?></label>
            <input type="text" id="all_weights" name="all_weights" size="2">
        </div>
        <div class="row">
            <input type="button" name="set_all_weights" value="<?php echo _AT('set'); ?>" onclick="setAllWeights()">
        </div>
    </div>


2. Then add somewhere:

<script type="text/javascript">
//<!--
function setAllWeights() {
    for (var i=0; i<document.form.elements.length;i++) {
        var e = document.form.elements[i];
        if ((e.type == 'text') && (e.name.substring(0, 7) == 'weight[')) {
            e.value = document.form.all_weights.value;
        }
    }
}
//-->
</script>


3. We had to change also

    echo '<input type="submit" value="'._AT('update').'" name="submit" /> </td>';

To

    echo '<input type="submit" value="'._AT('save').'" name="submit" /> </td>';

as the necessity of clicking two buttons instead of one wasn't obvious to our instructors, and the purpose of "Update" button wasn't understood well in such situation.
(0004173)
Pyrrhon   
2010-04-24 13:17   
Another way would be to give 1 point to all questions as default.
(0004235)
harris   
2010-05-04 11:59   
svn: 9886

Used IndieRect's suggestion.


Pyrrhon: You can use the button to set 1 point to all the questions.