mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
port quota full and complete questionsx
This commit is contained in:
@@ -629,18 +629,15 @@ function limesurvey_is_quota_full($case_id)
|
|||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$lime_sid = get_lime_sid($case_id);
|
$sql = "SELECT questionnaire_id, token
|
||||||
if ($lime_sid == false) return false;
|
FROM `case`
|
||||||
|
WHERE case_id = '$case_id'";
|
||||||
|
|
||||||
$sql = "SELECT t.completed
|
$rs = $db->GetRow($sql);
|
||||||
FROM " . LIME_PREFIX . "tokens_$lime_sid as t, `case` as c
|
|
||||||
WHERE c.case_id = '$case_id'
|
|
||||||
AND c.token = t.token";
|
|
||||||
|
|
||||||
$r = $db->GetRow($sql);
|
|
||||||
|
|
||||||
if (!empty($r))
|
$r = get_token_value($rs['questionnaire_id'],$rs['token'], 'completed');
|
||||||
if ($r['completed'] == 'Q') return true;
|
|
||||||
|
if ($r == 'Q') return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -657,18 +654,16 @@ function limesurvey_is_completed($case_id)
|
|||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$lime_sid = get_lime_sid($case_id);
|
$sql = "SELECT questionnaire_id, token
|
||||||
if ($lime_sid == false) return false;
|
FROM `case`
|
||||||
|
WHERE case_id = '$case_id'";
|
||||||
|
|
||||||
$sql = "SELECT t.completed
|
$rs = $db->GetRow($sql);
|
||||||
FROM " . LIME_PREFIX . "tokens_$lime_sid as t, `case` as c
|
|
||||||
WHERE c.case_id = '$case_id'
|
|
||||||
AND t.token = c.token";
|
|
||||||
|
|
||||||
$r = $db->GetRow($sql);
|
|
||||||
|
|
||||||
if (!empty($r))
|
$r = get_token_value($rs['questionnaire_id'],$rs['token'], 'completed');
|
||||||
if ($r['completed'] != 'N' && $r['completed'] != 'Q') return true;
|
|
||||||
|
//hasn't failed, not quota filled or not marked as incomplete
|
||||||
|
if ($r !== false && $r != 'Q' && $r != 'N') return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user