MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003544ATutorTests/Surveyspublic2008-08-26 07:332010-09-22 11:50
Reporterharris 
Assigned Toharris 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version2.0 
Summary0003544: One button to add points to all questions
DescriptionIf 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.
TagsNo tags attached.
Affects versionSVN
SVN Revision#
Attached Files

- Relationships

-  Notes
(0003151)
IndieRect (reporter)
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 (reporter)
2010-04-24 13:17

Another way would be to give 1 point to all questions as default.
(0004235)
harris (developer)
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.

- Issue History
Date Modified Username Field Change
2008-08-26 07:33 harris New Issue
2008-08-26 07:33 harris Affects version => SVN
2008-08-26 09:49 IndieRect Note Added: 0003151
2010-04-24 13:17 Pyrrhon Note Added: 0004173
2010-05-02 14:49 greg Status new => assigned
2010-05-02 14:49 greg Assigned To => harris
2010-05-04 11:59 harris Status assigned => resolved
2010-05-04 11:59 harris Resolution open => fixed
2010-05-04 11:59 harris Note Added: 0004235
2010-05-13 08:29 harris Status resolved => assigned
2010-05-13 08:29 harris Status assigned => resolved
2010-05-13 08:29 harris Fixed in Version => 2.0
2010-09-22 11:50 greg Status resolved => closed


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker