#!/usr/bin/perl

#use utf8;
use strict;
use CGI;

use Opals::Context;
use Opals::Template qw(
    tmpl_read
    tmpl_write
    tmpl_rangedPageList
);

use Opals::Rating qw(
    cmntRating_getTeacherList
);
use Opals::Locale qw(
    loc_getMsgFile
    loc_write
);
use JSON;
my $dbh = Opals::Context->dbh();
END { $dbh->disconnect(); }

my $cgi         = CGI->new;
my $input       = $cgi->Vars();
my $libType = Opals::Context->preference('libraryType')|| 'k-12';

my ($permission, $cookie, $template) = tmpl_read(
        {
            dbh             => $dbh,
            cgi             => $cgi,
            tmplFile        => 'rating/reviewUserComment.tmpl',
            reqPermission   => 'rating',
        }
);
my $teacherList =  cmntRating_getTeacherList($dbh);
$template->param(libType    =>$libType ,
                teacherList =>to_json($teacherList,{pretty=>1}),
                );


#Tue, Jan 12, 2010 @ 10:31:41 EST
my $msgValMap ={};
my $msgMap            =loc_getMsgFile('report/reports.msg',$msgValMap);
loc_write($template,$msgMap);
tmpl_write($dbh, $cgi, $cookie, $template);
