Skip to content

Commit 900d5d7

Browse files
committed
新增OSS配置,修正阅卷问题
1 parent 32427d9 commit 900d5d7

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

.php_cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ $config = PhpCsFixer\Config::create()
2020
'@PSR2' => true,
2121
'header_comment' => ['header' => $header],
2222
'binary_operator_spaces' => ['operators' => ['=>' => 'align']],
23+
'trailing_comma_in_multiline_array' => true,
2324
// 'no_useless_else' => true,
2425
// 'no_useless_return' => true,
2526
])

app/exam/tpls/master/basic_examview.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@
3131
{x2;eval: v:tid++}
3232
<a id="sign_{x2;v:question['questionid']}" href="#question_{x2;v:question['questionid']}" class="btn btn-default">{x2;v:tid}</a>
3333
{x2;endtree}
34+
{x2;if:is_array($sessionvars['examsessionquestion']['questionrows'][v:quest])}
3435
{x2;tree:$sessionvars['examsessionquestion']['questionrows'][v:quest],questionrow,qrid}
3536
{x2;eval: v:tid++}
3637
{x2;tree:v:questionrow['data'],data,did}
3738
<a id="sign_{x2;v:data['questionid']}" href="#question_{x2;v:data['questionid']}" class="btn btn-default">{x2;v:tid}-{x2;v:did}</a>
3839
{x2;endtree}
3940
{x2;endtree}
41+
{x2;endif}
4042
</div>
4143
{x2;endif}
4244
{x2;endif}
@@ -99,6 +101,7 @@
99101
</div>
100102
</div>
101103
{x2;endtree}
104+
{x2;if:is_array($sessionvars['examsessionquestion']['questionrows'][v:quest])}
102105
{x2;tree:$sessionvars['examsessionquestion']['questionrows'][v:quest],questionrow,qrid}
103106
{x2;eval: v:tid++}
104107
<div class="box itembox paperexamcontent">
@@ -149,6 +152,7 @@
149152
{x2;endtree}
150153
{x2;endif}
151154
{x2;endif}
155+
{x2;endif}
152156
{x2;endtree}
153157
</div>
154158
</div>

app/exam/tpls/master/basic_scorelist.tpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,16 @@
6969
<th>名次</th>
7070
{x2;endif}
7171
<th>考生用户名</th>
72+
{x2;if:is_array($fields)}
7273
{x2;tree:$fields,field,fid}
7374
<th>{x2;v:field['fieldtitle']}</th>
7475
{x2;endtree}
76+
{x2;endif}
7577
<th>分数</th>
7678
<th>考试名称</th>
7779
<th>考试时间</th>
7880
<th>考试用时</th>
79-
<th width="100">操作</th>
81+
<th style="width:100px;">操作</th>
8082
</tr>
8183
</thead>
8284
<tbody>
@@ -93,9 +95,11 @@
9395
<td>
9496
{x2;v:exam['ehusername']}
9597
</td>
98+
{x2;if:is_array($fields)}
9699
{x2;tree:$fields,field,fid}
97100
<th>{x2;v:exam[v:field['field']]}</th>
98101
{x2;endtree}
102+
{x2;endif}
99103
<td>
100104
{x2;v:exam['ehscore']}
101105
</td>

lib/config.inc.example.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
} else {
2727
define('WP', '//'.$_SERVER['SERVER_NAME'].'/');
2828
}
29-
define('OPENOSS', false);
3029

3130
/* 数据库设置 */
3231
define('SQLDEBUG', 1);
@@ -43,6 +42,13 @@
4342
'database' => 9, //Redis数据库(0-15)
4443
]);
4544

45+
/* 阿里云OSS设置 */
46+
define('OPENOSS', false);
47+
define('OSSKEYID', 'LTAI1gDYPJhtZlIh');
48+
define('OSSKEYSECRET', 'bmLtFONC9OVSfS9NAWYtelVsWMzCEp');
49+
define('OSSENDPOINT', 'http://oss-cn-beijing.aliyuncs.com');
50+
define('OSSBUCKET', 'ossforphpems');
51+
4652
/* 微信相关设置 */
4753
define('USEWX', false); //微信使用开关,绑定用户
4854
define('WXAUTOREG', false); //微信开启自动注册

lib/oss.cls.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ public function __construct(&$G)
2424

2525
public function upload($filepath)
2626
{
27-
$accessKeyId = 'LTAI1gDYPJhtZlIh';
28-
$accessKeySecret = 'bmLtFONC9OVSfS9NAWYtelVsWMzCEp';
29-
$endpoint = 'http://oss-cn-beijing.aliyuncs.com';
30-
$bucket = 'ossforphpems';
27+
$accessKeyId = OSSKEYID;
28+
$accessKeySecret = OSSKEYSECRET;
29+
$endpoint = OSSENDPOINT;
30+
$bucket = OSSBUCKET;
3131
$object = date('Ymd').'/'.basename($filepath);
3232
$filePath = $filepath;
3333

@@ -36,7 +36,7 @@ public function upload($filepath)
3636

3737
$rs = $ossClient->uploadFile($bucket, $object, $filePath);
3838
$path = $rs['oss-request-url'];
39-
$path = str_ireplace('����1', '����2', $path);
39+
$path = str_ireplace('url1', 'url2', $path);
4040
} catch (OssException $e) {
4141
//printf(__FUNCTION__ . ": FAILED\n");
4242
//printf($e->getMessage() . "\n");

0 commit comments

Comments
 (0)