src/Biz/Course/Copy/Chain/TestpaperCopy.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Biz\Course\Copy\Chain;

use AppBundle\Common\ArrayToolkit;
use Biz\Course\Copy\AbstractEntityCopy;
use Biz\Question\Service\QuestionService;
use Biz\Testpaper\Service\TestpaperService;

class TestpaperCopy extends AbstractEntityCopy
{
    /**
     * 复制链说明:
     * Testpaper 试卷/作业/练习
     * - TestpaperItem 题目列表
     *   - Question 题目内容.
     */

    /*
     * type='course-set'
     * - $source = originalCourse
     * - $config : newCourseSet
     *
     * type='course'
     * - $source = originalCourse
     * - $config : newCourse
     * */
    protected function copyEntity($source, $config = array())
    {
        return null;
    }

    protected function getFields()
    {
        return array(
            'name',
            'description',
            'limitedTime',
            'pattern',
            'status',
            'score',
            'passedCondition',
            'itemCount',
            'metas',
            'type',
        );
    }

    protected function baseCopyTestpaper($testpaper, $isCopy)
    {
        $newTestpaper = $this->filterFields($testpaper);

        $newTestpaper['lessonId'] = 0;
        $newTestpaper['createdUserId'] = $this->biz['user']['id'];
        $newTestpaper['copyId'] = $isCopy ? $testpaper['id'] : 0;

        return $newTestpaper;
    }

    protected function doCopyTestpaperItems($testpaperIds, $newTestpapers, $isCopy)

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。