Skip to content

Commit

Permalink
Fixed issue #10791: Duplicate subquestion id at arrary-by-column give…
Browse files Browse the repository at this point in the history
…s Javascript error
  • Loading branch information
LouisGac committed May 11, 2016
1 parent 092b734 commit a97176c
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 23 deletions.
28 changes: 5 additions & 23 deletions scripts/admin/subquestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ function code_duplicates_check()

languages=langs.split(';');
var cansubmit=true;
$('#tabpage_'+languages[0]+' .answertable tbody').each(function(){
$('#tabpage_'+languages[0]+' .answertable tbody').each(function()
{
var codearray=[];
$(this).find('tr .code').each(function(){
codearray.push($(this).val().toLowerCase());
Expand All @@ -403,31 +404,12 @@ function code_duplicates_check()
if (theDuplicate !== false)
{

$('.code').each( function() {
if ($(this).val() == theDuplicate) {
var $theDuplicateElement = $(this);

$('#error-modal .modal-body-text').html(duplicatesubquestioncode);
$('#error-modal').modal();

// Tooltip doesn't scroll
/*
$theDuplicateElement.data('toggle', 'tooltip');
$theDuplicateElement.data('title', duplicatesubquestioncode);
$theDuplicateElement.tooltip({
placement: 'left'
})
$theDuplicateElement.tooltip('show');
*/

// Flash the elements that are duplicates
//$theDuplicateElement.fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);

}
});
$('#error-modal .modal-body-text').html(duplicatesubquestioncode);
$('#error-modal').modal();
cansubmit= false;
}
});
console.log('cansubmit: '+cansubmit);
return cansubmit;
}

Expand Down
59 changes: 59 additions & 0 deletions tmp/bipyfyejvhsveen7s2ec
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<document>
<LimeSurveyDocType>Question</LimeSurveyDocType>
<DBVersion>258</DBVersion>
<languages>
<language>de</language>
</languages>
<questions>
<fields>
<fieldname>qid</fieldname>
<fieldname>parent_qid</fieldname>
<fieldname>sid</fieldname>
<fieldname>gid</fieldname>
<fieldname>type</fieldname>
<fieldname>title</fieldname>
<fieldname>question</fieldname>
<fieldname>preg</fieldname>
<fieldname>help</fieldname>
<fieldname>other</fieldname>
<fieldname>mandatory</fieldname>
<fieldname>question_order</fieldname>
<fieldname>language</fieldname>
<fieldname>scale_id</fieldname>
<fieldname>same_default</fieldname>
<fieldname>relevance</fieldname>
<fieldname>modulename</fieldname>
</fields>
<rows>
<row>
<qid><![CDATA[605]]></qid>
<parent_qid><![CDATA[0]]></parent_qid>
<sid><![CDATA[689193]]></sid>
<gid><![CDATA[204]]></gid>
<type><![CDATA[5]]></type>
<title><![CDATA[Frage1]]></title>
<question><![CDATA[<p>
Wie verständlich waren die Erklärungen in der Schulung für Sie?</p>
<p>
 </p>
<p>
1 = sehr verständlich</p>
<p>
bis</p>
<p>
5 = unverständlich</p>
]]></question>
<preg/>
<help/>
<other><![CDATA[N]]></other>
<mandatory><![CDATA[Y]]></mandatory>
<question_order><![CDATA[1]]></question_order>
<language><![CDATA[de]]></language>
<scale_id><![CDATA[0]]></scale_id>
<same_default><![CDATA[0]]></same_default>
<relevance><![CDATA[1]]></relevance>
</row>
</rows>
</questions>
</document>

0 comments on commit a97176c

Please sign in to comment.