src/AppBundle/Component/Export/Course/OverviewTestpaperTaskDetailExporter.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace AppBundle\Component\Export\Course;
use AppBundle\Common\ArrayToolkit;
use AppBundle\Component\Export\Exporter;
class OverviewTestpaperTaskDetailExporter extends Exporter
{
public function canExport()
{
$user = $this->getUser();
$task = $this->getTaskService()->getTask($this->parameter['courseTaskId']);
try {
$tryManageCourse = $this->getCourseService()->tryManageCourse($task['courseId']);
} catch (\Exception $e) {
return false;
}
return $user->isAdmin() || !empty($tryManageCourse);
}
public function getCount()
{
return $this->getTaskResultService()->countTaskResults($this->conditions);
}
public function getTitles()
{
return array(
'task.learn_data_detail.nickname',
'task.learn_data_detail.createdTime',
'course.task.finish_time',
'task.learn_data_detail.testpaper_firstUsedTime',
'task.learn_data_detail.testpaper_firstScore',
'task.learn_data_detail.testpaper_maxScore',
);
}
public function getContent($start, $limit)
{
$task = $this->getTaskService()->getTask($this->parameter['courseTaskId']);
$activity = $this->getActivityService()->getActivity($task['activityId'], true);
$testpaper = $this->getTestpaperService()->getTestpaperByIdAndType($activity['ext']['mediaId'], $activity['mediaType']);
$taskResults = $this->getTaskResultService()->searchTaskResults(
$this->conditions,
array('createdTime' => 'ASC'),
$start,
$limit
);
$userIds = ArrayToolkit::column($taskResults, 'userId');
$users = $this->getUserService()->findUsersByIds($userIds);
$testpaperResults = $this->getTestpaperService()->findTestResultsByTestpaperIdAndUserIds($userIds, $testpaper['id']);
$datas = array();
foreach ($taskResults as $taskResult) {
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。