示例#1
0
<?php

require_once '../../../../config.php';
require_once $CFG->dirroot . "/lib/pdflib.php";
require_once $CFG->dirroot . "/mod/assign/feedback/editpdf/fpdi/fpdi_bridge.php";
require_once $CFG->dirroot . '/mod/assign/feedback/editpdf/fpdi/fpdi.php';
//require_once('../../../../lib/tcpdf/tcpdf.php');
require_once 'ans_pdf_open.php';
// for more documentation, see the top of this file
// Variables to be assigned
$exam = "Cumulative Assessment 10-B";
$grade = "Grade 4";
$teacher = "Mr. Smithman";
$subject = "Language Arts";
$instancedate = "Fall 2009";
$exam_id = "786B";
$student_code = "1870654129";
$student_name = "Rosales, Jose";
// Create a new BubPdf object.
$BubPdf = new BubPdf('P', 'in', 'LETTER', true);
// NewExam sets the margins, etc
BP_NewExam($BubPdf, $CorrectAnswersProvided = FALSE);
BP_StudentAnswerSheetStart($BubPdf);
// A simple 12 question exam
BP_AddAnswerBubbles($BubPdf, 'A', 5, 12, FALSE, FALSE);
BP_StudentAnswerSheetComplete($BubPdf);
// the CreateExam call can be used to retrieve an array of the zone assignments
$myZones = BP_CreateExam($BubPdf);
//display the PDF of the Exam
$BubPdf->Output("exam_" . $exam_id . ".pdf");
// NOTE: "Save a Copy" in the acrobat plugin seems to ignore the name, though "File->Save As..." in the browser does not.
示例#2
0
$exam = "Cumulative Assessment 10-B";
$grade = "Grade 4";
$teacher = "Mr. Smithman";
$subject = "Language Arts";
$instancedate = "Fall 2009";
$exam_id = "786B";
$student_code = "1870654129";
$student_name = "Rosales, Jose";
// Create a new BubPdf object.
$BubPdf = new BubPdf('P', 'in', 'LETTER', true);
// NewExam sets the margins, etc
BP_NewExam($CorrectAnswersProvided = FALSE);
BP_StudentAnswerSheetStart();
// 12 questions
BP_AddAnswerBubbles('A', 5, 12, FALSE, FALSE);
// 6 questions, True, False
BP_AddAnswerBubbles('T', 2, 6, FALSE, FALSE);
// 10 questions, alternating
BP_AddAnswerBubbles('A', 4, 10, TRUE, FALSE);
// 10 questions, yes/no
BP_AddAnswerBubbles('Y', 2, 10, FALSE, FALSE);
// 20 questions, numerical
BP_AddAnswerBubbles('1', 5, 20, FALSE, FALSE);
// 22 questions, alternating
BP_AddAnswerBubbles('A', 4, 22, TRUE, FALSE);
BP_StudentAnswerSheetComplete();
// the CreateExam call can be used to retrieve an array of the zone assignments
$myZones = BP_CreateExam();
//display the PDF of the Exam
$BubPdf->Output("exam_" . $exam_id . ".pdf");
// NOTE: "Save a Copy" in the acrobat plugin seems to ignore the name, though "File->Save As..." in the browser does not.
示例#3
0
/**
 *
 * @param string $answers            
 * @return BubPdf
 */
function emarking_create_omr_answer_sheet($answers = null)
{
    global $CFG;
    require_once $CFG->libdir . '/tcpdf/tcpdf.php';
    // for more documentation, see the top of this file
    require_once $CFG->dirroot . '/mod/emarking/lib/openbub/ans_pdf_open.php';
    // for more documentation, see the top of this file
    // Create a new BubPdf object.
    $BubPdf = new BubPdf('P', 'in', 'LETTER', true);
    $BubPdf->SetPrintHeader(false);
    $BubPdf->SetPrintFooter(false);
    // NewExam sets the margins, etc
    BP_NewExam($BubPdf, $CorrectAnswersProvided = TRUE);
    BP_StudentAnswerSheetStart($BubPdf);
    // A simple 12 question exam
    foreach ($answers as $options) {
        BP_AddAnswerBubbles($BubPdf, 'A', $options, 1, FALSE, FALSE);
    }
    BP_StudentAnswerSheetComplete($BubPdf);
    // the CreateExam call can be used to retrieve an array of the zone assignments
    $myZones = BP_CreateExam($BubPdf);
    return $BubPdf;
}