Skip to content

Commit

Permalink
Fixed issue #6001: Assessment creation when there is no question group
Browse files Browse the repository at this point in the history
  • Loading branch information
dklischies committed May 15, 2012
1 parent 403c56f commit 1442f71
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

.project
/upload/surveys/*
/styles/gringegreen/images/Thumbs.db
1 change: 1 addition & 0 deletions application/controllers/admin/assessments.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ private function _showAssessments($iSurveyID, $action, $surveyLanguage, Limesurv

private function _collectGroupData($iSurveyID)
{
$aData = array();
$groups = Groups::model()->findAllByAttributes(array('sid' => $iSurveyID));
foreach ($groups as $group) {
$groupId = $group->attributes['gid'];
Expand Down
23 changes: 16 additions & 7 deletions application/views/admin/assessments_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,22 @@
if (isset($editdata) && $editdata['scope'] == "G") {echo " checked='checked' ";} ?>/>
<label for='radiogroup'><?php $clang->eT("Group");?></label></li>
<li><label for='gid'><?php $clang->eT("Question group");?></label>
<select name='gid' id='gid'>
<?php
foreach ($groups as $groupId => $groupName) {
echo '<option value="' . $groupId . '"'.($editId == $groupId ? ' selected' : '').'>' . $groupName . '</option>';
}
?>
</select></li>
<?php
if (isset($groups))
{ ?>
<select name='gid' id='gid'>
<?php
foreach ($groups as $groupId => $groupName) {
echo '<option value="' . $groupId . '"'.($editId == $groupId ? ' selected' : '').'>' . $groupName . '</option>';
}
?>
</select>
<?php
}
else
echo $clang->eT("No question group found.");
?>
</li>
<li><label for='minimum'><?php $clang->eT("Minimum");?></label><input type='text' id='minimum' name='minimum' class='numbersonly'<?php
if (isset($editdata)) {echo " value='{$editdata['minimum']}' ";} ?>/></li>
<li><label for='maximum'><?php $clang->eT("Maximum");?></label><input type='text' id='maximum' name='maximum' class='numbersonly'<?php
Expand Down

0 comments on commit 1442f71

Please sign in to comment.