Skip to content

Commit

Permalink
Bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
oiuv committed Mar 22, 2018
1 parent f4dd10b commit 55154b5
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 6 deletions.
2 changes: 2 additions & 0 deletions app/exam/controller/exam.phone.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ private function selectquestions()
$questionids = $this->question->selectQuestions($examid,$this->data['currentbasic']);
$questions = array();
$questionrows = array();
if (is_array($questionids['question']))
foreach($questionids['question'] as $key => $p)
{
$ids = "";
Expand All @@ -527,6 +528,7 @@ private function selectquestions()
$questions[$key] = $this->exam->getQuestionListByIds($ids);
}
}
if (is_array($questionids['questionrow']))
foreach($questionids['questionrow'] as $key => $p)
{
$ids = "";
Expand Down
2 changes: 2 additions & 0 deletions app/exam/controller/exampaper.phone.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ private function selectquestions()
$questions = array();
$questionrows = array();
$str = '';
if (is_array($questionids['question']))
foreach($questionids['question'] as $key => $p)
{
$ids = "";
Expand All @@ -437,6 +438,7 @@ private function selectquestions()
$questions[$key] = $this->exam->getQuestionListByIds($ids);
}
}
if (is_array($questionids['questionrow']))
foreach($questionids['questionrow'] as $key => $p)
{
$ids = "";
Expand Down
14 changes: 12 additions & 2 deletions app/exam/controller/exercise.phone.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,20 +425,29 @@ private function index()
$snumber = 0;
foreach($args['number'] as $key => $v)
{
if (!is_numeric($v)) $v = 0;
$snumber += $v;
if($snumber > 100)
{
$message = array(
'statusCode' => 300,
"message" => "强化练习最多一次只能抽取100道题"
"message" => "强化练习一次最多只能抽取100道题"
);
$this->G->R($message);
}
} elseif(!$snumber)
{
$message = array(
'statusCode' => 300,
"message" => "请选择章节并至少抽取1道题"
);
$this->G->R($message);
}
}
$dt = key($args['number']);
$questionids = $this->question->selectQuestionsByKnows($args['knowsid'],$args['number'],$dt);
$questions = array();
$questionrows = array();
if (is_array($questionids['question']))
foreach($questionids['question'] as $key => $p)
{
$ids = "";
Expand All @@ -453,6 +462,7 @@ private function index()
$questions[$key] = $this->exam->getQuestionListByIds($ids);
}
}
if (is_array($questionids['questionrow']))
foreach($questionids['questionrow'] as $key => $p)
{
$ids = "";
Expand Down
12 changes: 10 additions & 2 deletions app/exam/tpls/phone/exam_paper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,22 @@
<dt class="float_l"><h4 class="title">{x2;$ols[v:oid]}{x2;$questype[v:quest]['questype']}</h4></dt>
<dd class="tableindex">
{x2;eval: v:tid = 0}
{x2;if:is_array($sessionvars['examsessionquestion']['questions'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questions'][v:quest],question,qnid}
{x2;eval: v:tid++}
{x2;eval: v:qmid++}
<a style="margin-bottom:0.5rem;" id="sign_{x2;v:question['questionid']}" href="javascript:;" onclick="javascript:$.leftMenu($('#questionbar'));gotoquestion('{x2;v:question['questionid']}');$('#form1').toggle();" class="btn btn-default{x2;if:$sessionvars['examsessionsign'][v:question['questionid']]} btn-danger{x2;endif}">{x2;v:tid}</a>
{x2;endtree}
{x2;endif}
{x2;if:is_array($sessionvars['examsessionquestion']['questionrows'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questionrows'][v:quest],questionrow,qrid}
{x2;eval: v:tid++}
{x2;tree:v:questionrow['data'],data,did}
{x2;eval: v:qmid++}
<a style="margin-bottom:0.5rem;" id="sign_{x2;v:data['questionid']}" href="javascript:;" onclick="javascript:$.leftMenu($('#questionbar'));gotoquestion('{x2;v:data['questionid']}');$('#form1').toggle();" class="btn btn-default{x2;if:$sessionvars['examsessionsign'][v:data['questionid']]} btn-danger{x2;endif}">{x2;v:tid}-{x2;v:did}</a>
{x2;endtree}
{x2;endtree}
{x2;endif}
</dd>
{x2;endif}
{x2;endif}
Expand All @@ -59,6 +63,7 @@
{x2;eval: v:oid++}
<h4 class="title questionpanel" id="questype_{x2;v:quest}">{x2;$ols[v:oid]}{x2;$questype[v:quest]['questype']}{x2;$sessionvars['examsessionsetting']['examsetting']['questype'][v:quest]['describe']}</h4>
{x2;eval: v:tid = 0}
{x2;if:is_array($sessionvars['examsessionquestion']['questions'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questions'][v:quest],question,qnid}
{x2;eval: v:tid++}
{x2;eval: v:qcid++}
Expand All @@ -67,12 +72,12 @@
{x2;v:tid}
<span class="pull-right">
<a class="btn {x2;if:$sessionvars['examsessionsign'][v:question['questionid']]}text-danger{x2;else}text-info{x2;endif} qicon" href="javascript:;" onclick="javascript:signQuestion('{x2;v:question['questionid']}',this);"><i class="glyphicon glyphicon-bookmark"></i></a>
<a name="question_{x2;v:question['questionid']}">
<a name="question_{x2;v:question['questionid']}"></a>
<input id="time_{x2;v:question['questionid']}" type="hidden" name="time[{x2;v:question['questionid']}]"/>
</span>
</h4>
<div class="choice">
</a>{x2;realhtml:v:question['question']}
{x2;realhtml:v:question['question']}
</div>
{x2;if:!$questype[v:quest]['questsort']}
{x2;if:v:question['questionselect'] && $questype[v:quest]['questchoice'] != 5}
Expand Down Expand Up @@ -115,6 +120,8 @@
</div>
</div>
{x2;endtree}
{x2;endif}
{x2;if:is_array($sessionvars['examsessionquestion']['questionrows'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questionrows'][v:quest],questionrow,qrid}
{x2;eval: v:tid++}
{x2;tree:v:questionrow['data'],data,did}
Expand Down Expand Up @@ -180,6 +187,7 @@
{x2;endtree}
{x2;endif}
{x2;endif}
{x2;endif}
{x2;endtree}
</form>
</div>
Expand Down
8 changes: 8 additions & 0 deletions app/exam/tpls/phone/exampaper_paper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,22 @@
<dt class="float_l"><h4 class="title">{x2;$ols[v:oid]}{x2;$questype[v:quest]['questype']}</h4></dt>
<dd class="tableindex">
{x2;eval: v:tid = 0}
{x2;if:is_array($sessionvars['examsessionquestion']['questions'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questions'][v:quest],question,qnid}
{x2;eval: v:tid++}
{x2;eval: v:qmid++}
<a style="margin-bottom:0.5rem;" id="sign_{x2;v:question['questionid']}" href="javascript:;" onclick="javascript:$.leftMenu($('#questionbar'));gotoquestion('{x2;v:question['questionid']}');$('#form1').toggle();" class="btn btn-default{x2;if:$sessionvars['examsessionsign'][v:question['questionid']]} btn-danger{x2;endif}">{x2;v:tid}</a>
{x2;endtree}
{x2;endif}
{x2;if:is_array($sessionvars['examsessionquestion']['questionrows'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questionrows'][v:quest],questionrow,qrid}
{x2;eval: v:tid++}
{x2;tree:v:questionrow['data'],data,did}
{x2;eval: v:qmid++}
<a style="margin-bottom:0.5rem;" id="sign_{x2;v:data['questionid']}" href="javascript:;" onclick="javascript:$.leftMenu($('#questionbar'));gotoquestion('{x2;v:data['questionid']}');$('#form1').toggle();" class="btn btn-default{x2;if:$sessionvars['examsessionsign'][v:data['questionid']]} btn-danger{x2;endif}">{x2;v:tid}-{x2;v:did}</a>
{x2;endtree}
{x2;endtree}
{x2;endif}
</dd>
{x2;endif}
{x2;endif}
Expand All @@ -59,6 +63,7 @@
{x2;eval: v:oid++}
<h4 class="title questionpanel" id="questype_{x2;v:quest}">{x2;$ols[v:oid]}{x2;$questype[v:quest]['questype']}{x2;$sessionvars['examsessionsetting']['examsetting']['questype'][v:quest]['describe']}</h4>
{x2;eval: v:tid = 0}
{x2;if:is_array($sessionvars['examsessionquestion']['questions'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questions'][v:quest],question,qnid}
{x2;eval: v:tid++}
{x2;eval: v:qcid++}
Expand Down Expand Up @@ -116,6 +121,8 @@
</div>
</div>
{x2;endtree}
{x2;endif}
{x2;if:is_array($sessionvars['examsessionquestion']['questionrows'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questionrows'][v:quest],questionrow,qrid}
{x2;eval: v:tid++}
{x2;tree:v:questionrow['data'],data,did}
Expand Down Expand Up @@ -182,6 +189,7 @@
{x2;endtree}
{x2;endif}
{x2;endif}
{x2;endif}
{x2;endtree}
</form>
</div>
Expand Down
8 changes: 8 additions & 0 deletions app/exam/tpls/phone/exercise_paper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,22 @@
<dt class="float_l"><h4 class="title">{x2;$ols[v:oid]}{x2;$questype[v:quest]['questype']}</h4></dt>
<dd class="tableindex">
{x2;eval: v:tid = 0}
{x2;if:is_array($sessionvars['examsessionquestion']['questions'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questions'][v:quest],question,qnid}
{x2;eval: v:tid++}
{x2;eval: v:qmid++}
<a style="margin-bottom:0.5rem;" id="sign_{x2;v:question['questionid']}" href="javascript:;" onclick="javascript:$.leftMenu($('#questionbar'));gotoquestion('{x2;v:question['questionid']}');$('#form1').toggle();" class="btn btn-default{x2;if:$sessionvars['examsessionsign'][v:question['questionid']]} btn-danger{x2;endif}">{x2;v:tid}</a>
{x2;endtree}
{x2;endif}
{x2;if:is_array($sessionvars['examsessionquestion']['questionrows'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questionrows'][v:quest],questionrow,qrid}
{x2;eval: v:tid++}
{x2;tree:v:questionrow['data'],data,did}
{x2;eval: v:qmid++}
<a style="margin-bottom:0.5rem;" id="sign_{x2;v:data['questionid']}" href="javascript:;" onclick="javascript:$.leftMenu($('#questionbar'));gotoquestion('{x2;v:data['questionid']}');$('#form1').toggle();" class="btn btn-default{x2;if:$sessionvars['examsessionsign'][v:data['questionid']]} btn-danger{x2;endif}">{x2;v:tid}-{x2;v:did}</a>
{x2;endtree}
{x2;endtree}
{x2;endif}
</dd>
{x2;endif}
{x2;endif}
Expand All @@ -59,6 +63,7 @@
{x2;eval: v:oid++}
<h4 class="title questionpanel" id="questype_{x2;v:quest}">{x2;$ols[v:oid]}{x2;$questype[v:quest]['questype']}{x2;$sessionvars['examsessionsetting']['examsetting']['questype'][v:quest]['describe']}</h4>
{x2;eval: v:tid = 0}
{x2;if:is_array($sessionvars['examsessionquestion']['questions'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questions'][v:quest],question,qnid}
{x2;eval: v:tid++}
{x2;eval: v:qcid++}
Expand Down Expand Up @@ -116,6 +121,8 @@
</div>
</div>
{x2;endtree}
{x2;endif}
{x2;if:is_array($sessionvars['examsessionquestion']['questionrows'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questionrows'][v:quest],questionrow,qrid}
{x2;eval: v:tid++}
{x2;tree:v:questionrow['data'],data,did}
Expand Down Expand Up @@ -182,6 +189,7 @@
{x2;endtree}
{x2;endif}
{x2;endif}
{x2;endif}
{x2;endtree}
</form>
</div>
Expand Down
8 changes: 6 additions & 2 deletions app/exam/tpls/phone/history_examview.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
{x2;eval: v:oid++}
<h4 class="title questionpanel" id="questype_{x2;v:quest}">{x2;$ols[v:oid]}{x2;$questype[v:quest]['questype']}{x2;$sessionvars['examsessionsetting']['examsetting']['questype'][v:quest]['describe']}</h4>
{x2;eval: v:tid = 0}
{x2;if:is_array($sessionvars['examsessionquestion']['questions'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questions'][v:quest],question,qnid}
{x2;eval: v:tid++}
{x2;eval: v:qcid++}
Expand All @@ -26,12 +27,12 @@
{x2;v:tid}
<span class="pull-right">
<a class="btn text-primary qicon" onclick="javascript:favorquestion('{x2;v:question['questionid']}');"><i class="glyphicon glyphicon-heart-empty"></i></a>
<a name="question_{x2;v:question['questionid']}">
<a name="question_{x2;v:question['questionid']}"></a>
<input id="time_{x2;v:question['questionid']}" type="hidden" name="time[{x2;v:question['questionid']}]"/>
</span>
</h4>
<div class="choice">
</a>{x2;realhtml:v:question['question']}
{x2;realhtml:v:question['question']}
</div>
{x2;if:!$questype[v:quest]['questsort']}
{x2;if:v:question['questionselect'] && $questype[v:quest]['questchoice'] != 5}
Expand Down Expand Up @@ -80,6 +81,8 @@
</div>
</div>
{x2;endtree}
{x2;endif}
{x2;if:is_array($sessionvars['examsessionquestion']['questionrows'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questionrows'][v:quest],questionrow,qrid}
{x2;eval: v:tid++}
<div class="paperexamcontent" id="questions_{x2;v:data['questionid']}" rel="{x2;v:quest}" style="clear:both;overflow:hidden;background:#FFFFFF;margin-top:0.5rem;padding:1rem;">
Expand Down Expand Up @@ -151,6 +154,7 @@
{x2;endtree}
{x2;endif}
{x2;endif}
{x2;endif}
{x2;endtree}
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions app/exam/tpls/phone/history_exerciseview.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
{x2;eval: v:oid++}
<h4 class="title questionpanel" id="questype_{x2;v:quest}">{x2;$ols[v:oid]}{x2;$questype[v:quest]['questype']}{x2;$sessionvars['examsessionsetting']['examsetting']['questype'][v:quest]['describe']}</h4>
{x2;eval: v:tid = 0}
{x2;if:is_array($sessionvars['examsessionquestion']['questions'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questions'][v:quest],question,qnid}
{x2;eval: v:tid++}
{x2;eval: v:qcid++}
Expand Down Expand Up @@ -71,6 +72,8 @@
</div>
</div>
{x2;endtree}
{x2;endif}
{x2;if:is_array($sessionvars['examsessionquestion']['questionrows'][v:quest])}
{x2;tree:$sessionvars['examsessionquestion']['questionrows'][v:quest],questionrow,qrid}
{x2;eval: v:tid++}
<div class="paperexamcontent" id="questions_{x2;v:data['questionid']}" rel="{x2;v:quest}" style="clear:both;overflow:hidden;background:#FFFFFF;margin-top:0.5rem;padding:1rem;">
Expand Down Expand Up @@ -132,6 +135,7 @@
{x2;endtree}
{x2;endif}
{x2;endif}
{x2;endif}
{x2;endtree}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions lib/category.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public function getChildCategory($id)

public function getChildCategoryString($id,$withself = 1)
{
if (is_array($this->getChildCategory($id)))
$s = implode(',',$this->getChildCategory($id));
if($withself)
{
Expand Down

0 comments on commit 55154b5

Please sign in to comment.