Custom Reports

Custom Reports

EduBrite provides some detailed reports and analytics. These are accessed from the menu Site Admin -> Reports. These reports are divided into three categories Site Reports, Course Reports and Program Reports. However not all reporting requirements for every user can be met using any standard reports. EduBrite therefore provides necessary data objects which allows the site administrators to create custom reports. Some amount of HTML and programming experience is necessary to create and configure any custom report. Such custom reports can be created using either Javascript or Velocity template engine. Here we show an example of how to create a completely custom report for the result of a test taken by a user. The report script is in Velocity template engine.

 

Report Script

The script is a pure HTML code with embedded Velocity scripts to populate the actual data. The velocity script code fetches run time data from data objects which are made available by EduBrite platform.

<table width="100%">
    <tbody>
        <tr align="center">
            <td colspan="2"><b>${testInstance.getTest().getName()} Report</b>
        </tr>
        <tr>
            <td><b>Exam Date:</b> $DateFormatter.getFormattedDate($testInstance.getStartedOn(), "dd/MM/yyyy")</td>
            <td><b>Time Duration:</b> #set ($minute = ${testInstance.getTest().getDuration()}/1000/60)${minute} min
            </td>
        </tr>
        <tr>
            <td><b>Candidate Name:</b> ${testInstance.getStudent().getFullNameString()} (${testInstance.getStudent().getNonPrefixedUserName()})</td>
            <td colspan="2"><b>Module Name:</b> ${testInstance.getTest().getMdWidget().getSelectedSubjectsAsString()}</td>
        </tr>
    </tbody>
</table>
<table width="100%" class="grid" border="1">
    <tbody>
        <tr>
            <td><b>Total Questions</b></td>
            <td><b>Total Points</b></td>
            <td><b>Passing Points</b></td>
            <td><b>Negative Points</b></td>
            <td><b>Answered</b></td>
            <td><b>Correct</b></td>
            <td><b>Incorrect</b></td>
            <td><b>Points Obtained</b></td>
            <td><b>% Score</b></td>
            <td><b>Result</b></td>
            <td><b>Grade</b></td>
        </tr>
        <tr>
            <td>${testInstance.getTest().getTotalQuestions()}</td>
            <td>${testInstance.getTest().getTotalMarks()}</td>
            <td>${testInstance.getTest().getPassingMarks()}</td>
            <td>${testInstance.getTest().getNegativeMarksPerQuestion()}</td>
            <td>${testInstance.getNoOfAttempted()}</td>
            <td>${testInstance.getNoOfCorrect()}</td>
            <td>${testInstance.getNoOfIncorrect()}</td>
            <td>${testInstance.getTotalScore()}</td>
            <td>
                #set ($percentTotal = ${testInstance.getTotalScore()} * 100 / ${testInstance.getTest().getTotalMarks()})
                #set ($percent = $Utility.formatFloat($percentTotal, 2, 2))
                ${percent}
            </td>
            <td>#if (${testInstance.isResult()} == true)
                    Pass
                #elseif (${testInstance.isResult()} == false)                                         
                    Fail                                 
                #end
            </td>
            <td>
                #if ($percent > 70)                                         
                    A+                                 
                #elseif ($percent > 60)                                         
                    A                                 
                #elseif ($percent > 50)                                         
                    B                                 
                #elseif ($percent > 40)                                         
                    C
                #else                                         
                    Fail                                 
                #end
            </td>
        </tr>
    </tbody>
</table>
<p>
<br/>Grading system is as follows:<br/>
>70% = A+ <br/>
>60%-70% = A<br/>
>50%-60% = B<br/>
>40%-50% = C<br/>
<40% = Fail
</p>
<p>This is a computer generated report, does not require any signature</p>
#if (!$UIContext.isInner())
<p><input type="button" onClick="printReport()" value="Print" /></p>
<script>
function printReport(){
      g_navigateTo('../site/report.do?${UIContext.getQueryString()}&rendition=PDF&OLTAjax=true&inner=true');
}
</script>
#end

===== PDFStyles =====
body,size,2
 

 

Setting up the Report

Go to the CMS browser (Site Admin -> CMS) . Create new "Report Template". Give any suitable title and paste the above code inside this Report Template. Save and publish. Now go back to the CMS browser and click on the report template that has just been created. Note the browser URL. It would be something like

.../oltpublish/site/document.do?id=<templateid>&dispatch=show

Note the value for the parameter id. It would be report template id. Now go to Site Admin -> Site Details -> Customizations and specify CUSTOM_TEST_INSTANCE_REPORT_TEMPLATE=<Template Id>

 

Accessing the Report

Create a test and allow any user to take the test. Open the result page for the test taken by the user. The result page can be opened by the user himself/herself through the menu item My Items -> Test History. The administrator can access it by using Test -> View Tests and clicking on the Attempts link.

 

Click the "Detailed Report" link to access the custom report that we created.


Rating: