Skip to content

Commit

Permalink
Fixed issue #6690: Question type 'File upload' doesn't work appropria…
Browse files Browse the repository at this point in the history
…tely when used on the same page with ranking question type
  • Loading branch information
c-schmitz committed Oct 17, 2012
1 parent 9dcfe14 commit 32bc454
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
24 changes: 0 additions & 24 deletions application/helpers/frontend_helper.php
Expand Up @@ -327,30 +327,6 @@ function checkconfield($value)

$scenario = $scenariorow['scenario'];
$currentcfield="";
$query = "SELECT {{conditions}}.*, {{question_types}}.clas "
. "FROM {{conditions}}, {{questions}} "
. "WHERE {{conditions}}.cqid={{questions}}.qid "
. "AND {{questions}}.tid={{question_types}}.tid "
. "AND {{conditions}}.qid=$value_question->id "
. "AND {{conditions}}.scenario=$scenario "
. "AND {{conditions}}.cfieldname NOT LIKE '{%' "
. "ORDER BY {{conditions}}.qid,{{conditions}}.cfieldname";
$result=dbExecuteAssoc($query) or safeDie($query."<br />"); //Checked
$conditionsfound = $result->count();

$querytoken = "SELECT {{conditions}}.*, 'Display' as class "
. "FROM {{conditions}} "
. "WHERE "
. " {{conditions}}.qid=$value_question->id "
. "AND {{conditions}}.scenario=$scenario "
. "AND {{conditions}}.cfieldname LIKE '{%' "
. "ORDER BY {{conditions}}.qid,{{conditions}}.cfieldname";
$resulttoken=dbExecuteAssoc($querytoken) or safeDie($querytoken."<br />"); //Checked
$conditionsfoundtoken = $resulttoken->count();
$conditionsfound = $conditionsfound + $conditionsfoundtoken;

foreach($resulttoken->readAll() as $Condrow)
{
$sConditionsQuery1 = "SELECT {{conditions}}.*, {{questions}}.type "
. "FROM {{conditions}}, {{questions}} "
. "WHERE {{conditions}}.cqid={{questions}}.qid "
Expand Down
2 changes: 1 addition & 1 deletion application/modules/RankingQuestion.php
Expand Up @@ -95,7 +95,7 @@ public function getAnswerHTML()
}
$answer .= "<script type='text/javascript'>\n"
. " <!--\n"
. "var translt = {
. "var aRankingTranslations = {
choicetitle: '{$choice_title}',
ranktitle: '{$rank_title}'
};\n"
Expand Down
8 changes: 4 additions & 4 deletions scripts/ranking.js
Expand Up @@ -16,18 +16,18 @@ function doDragDropRank(qID, showpopups, samechoiceheight, samelistheight) {
// Actually a table : move it to a list is a good idea, but need reviewing template a lot.
var htmlCode = '<div class="dragDropTable"> \
<div class="columns2">\
<strong class="SortableTitle">'+translt.choicetitle+'</strong>\
<strong class="SortableTitle">'+aRankingTranslations.choicetitle+'</strong>\
<div class="ui-state-default dragDropChoices"> \
<ul id="sortable-choice-'+qID+'" class="connectedSortable'+qID+' dragDropChoiceList"> \
<li>'+translt.choicetitle+'</li> \
<li>'+aRankingTranslations.choicetitle+'</li> \
</ul> \
</div> \
</div>\
<div class="columns2">\
<strong class="SortableTitle">'+translt.ranktitle+'</strong>\
<strong class="SortableTitle">'+aRankingTranslations.ranktitle+'</strong>\
<div class="ui-state-default dragDropRanks"> \
<ol id="sortable-rank-'+qID+'" class="connectedSortable'+qID+' dragDropRankList selectionSortable"> \
<li>'+translt.ranktitle+'</li> \
<li>'+aRankingTranslations.ranktitle+'</li> \
</ol> \
</div> \
</div> \
Expand Down

0 comments on commit 32bc454

Please sign in to comment.