Jump to content

Recommended Posts

Posted

I just googled, and got back an awnser from Geoff !

http://www.edugeek.net/forums/virtual-learning-platforms/25090-moodle-sql-server-2005-a.html

 

2. Make sure MS SQL Server can accept incoming TCP/IP connections on port 1433 (the standard one).

 

You might need to explicitly allow this in your Windows firewall (see the Control Panel). You may also need to edit options in the :SQL Server Configuration Manager -> Network Configuration -> Protocols -> TCP/IP enabled

Posted (edited)

Ok think I'm getting closer to the issue..

 

1) SQL Server installed on a non standard port!!

2) FreeTDS now connects and I can see the DBs when using the tsql command

 

but....

 

In Moodle I enter the "enrol_dbhost" as

\,

Which, when I echo it in the view.php returns

[b]\\[/b],

 

Heres the strange bit - If I escape the \ ini "enrol_dbhost" in Moodle, it returns with

\\\\,

 

It looks like PHP is sensing it needs to escape the \ but then escapes the escape character!! ( so \ becomes \\ , \\ becomes \\\\ and so on...)

 

Any thoughts here?

Edited by Gatt
Posted
Ok think I'm getting closer to the issue..

 

1) SQL Server installed on a non standard port!!

2) FreeTDS now connects and I can see the DBs when using the tsql command

 

but....

 

In Moodle I enter the "enrol_dbhost" as

\,

Which, when I echo it in the view.php returns

[b]\\[/b],

 

Heres the strange bit - If I escape the \ ini "enrol_dbhost" in Moodle, it returns with

\\\\,

 

It looks like PHP is sensing it needs to escape the \ but then escapes the escape character!! ( so \ becomes \\ , \\ becomes \\\\ and so on...)

 

Any thoughts here?

 

Hi,

 

out setup up for enrol_dbhost is

 

,

 

no need for the instance

Posted

Got it working!! :D

 

1) In FreeTDS - Set TDS version to 9.0

2) In Moodle - Removed Instance

3) In Moodle - Removed Port

 

Also re-arranged the table array and labels for periods..

Posted
Got it working!! :D

 

1) In FreeTDS - Set TDS version to 9.0

2) In Moodle - Removed Instance

3) In Moodle - Removed Port

 

Also re-arranged the table array and labels for periods..

 

what did you re-arrange? as i will update the documentation if needs be.

Posted

Changed the following line:

 $periods = array("" => 1,"1" => 2,"2"=> 3,"Reg"=> 4,"3"=> 5,"E4"=> 6,"L4"=> 7,"5"=> 8,"TWL"=> 9);

to

$periods = array("Reg" => 1,"1" => 2,"2"=> 3,"3"=> 4,"4"=> 5,"5"=> 6,"6"=> 7,""=> 8,""=> 9);

also changed the table headers for Periods from:

 $periods_labels = array("","1","2","Reg","3","E4","L4","5","TWL");

to

$periods_labels = array("Reg","1","2","3","4","5","6","","");

 

and finally to remove empty rows i changed

for($i = 1; $i <= 9; ++$i) 

to

for($i = 1; $i <= 7; ++$i) 

 

Obviously, some of this will be different depending on how schools work their timetables

Posted
Changed the following line:

 $periods = array("" => 1,"1" => 2,"2"=> 3,"Reg"=> 4,"3"=> 5,"E4"=> 6,"L4"=> 7,"5"=> 8,"TWL"=> 9);

to

$periods = array("Reg" => 1,"1" => 2,"2"=> 3,"3"=> 4,"4"=> 5,"5"=> 6,"6"=> 7,""=> 8,""=> 9);

also changed the table headers for Periods from:

 $periods_labels = array("","1","2","Reg","3","E4","L4","5","TWL");

to

$periods_labels = array("Reg","1","2","3","4","5","6","","");

 

and finally to remove empty rows i changed

for($i = 1; $i <= 9; ++$i) 

to

for($i = 1; $i <= 7; ++$i) 

 

Obviously, some of this will be different depending on how schools work their timetables

 

Thanks Gatt,

 

I will update the documentation to draw people attention to the label issue.

Posted
Changed the following line:

 $periods = array("" => 1,"1" => 2,"2"=> 3,"Reg"=> 4,"3"=> 5,"E4"=> 6,"L4"=> 7,"5"=> 8,"TWL"=> 9);

to

$periods = array("Reg" => 1,"1" => 2,"2"=> 3,"3"=> 4,"4"=> 5,"5"=> 6,"6"=> 7,""=> 8,""=> 9);

also changed the table headers for Periods from:

 $periods_labels = array("","1","2","Reg","3","E4","L4","5","TWL");

to

$periods_labels = array("Reg","1","2","3","4","5","6","","");

 

and finally to remove empty rows i changed

for($i = 1; $i <= 9; ++$i) 

to

for($i = 1; $i <= 7; ++$i) 

 

Obviously, some of this will be different depending on how schools work their timetables

 

Hi Gatt,

 

I noticed from the picture of your timetable you are missing registration from your timetable.

 

Is this intentional?

Posted

Ok just rechecked my dbo.dml_student_timetable view on the SQL server - there is no sign of any registration periods

 

they all say fri:1 , Mon:5 , thu:5 etc...

Posted

Hi Gatt,

 

try these settings

 

$periods = array("" => 1,"Reg" => 2,"1"=> 3,"2"=> 4,"3"=> 5,"4"=> 6,"5"=> 7,"6"=> 8,""=> 9);

$periods_labels = array("","Reg","1","2","3","4","5","6","");

for($i = 1; $i <= 8; ++$i)

 

This should display registration

Posted

Ta - though i dont think Reg has been dumped to the timetable views for Staff or pupils..

 

Did the following query on the mdl_student_timetable view..

 

SELECT     period_name, class_name, unique_pupil_no, staff_initials, room_name
FROM         mdl_student_timetable
WHERE     (unique_pupil_no = 'upn_of pupil_removed')
ORDER BY period_name

 

This results in :

 

Fri:1 - 7y/Ma1
Fri:2 - 7y/Sc1
Fri:3 - 7y/Tt3
Fri:4 - 7y/Tt3
Fri:5 - 7y/Gg3
Fri:6 - 7y/Pe3
Mon:1 - 7y/It3
Mon:2 - 7y/En1
.
.
.
.

 

(Only copied 1st two columns btw)

 

No sign of any registrations...

Posted
Ta - though i dont think Reg has been dumped to the timetable views for Staff or pupils..

 

Did the following query on the mdl_student_timetable view..

 

SELECT     period_name, class_name, unique_pupil_no, staff_initials, room_name
FROM         mdl_student_timetable
WHERE     (unique_pupil_no = 'upn_of pupil_removed')
ORDER BY period_name

 

This results in :

 

Fri:1 - 7y/Ma1
Fri:2 - 7y/Sc1
Fri:3 - 7y/Tt3
Fri:4 - 7y/Tt3
Fri:5 - 7y/Gg3
Fri:6 - 7y/Pe3
Mon:1 - 7y/It3
Mon:2 - 7y/En1
.
.
.
.

 

(Only copied 1st two columns btw)

 

No sign of any registrations...

 

I doubt your school has timetabled the registration period. a question to ask your timetabler.

 

if it not then $period should be

 

$periods = array("" => 1,"1" => 2,"2"=> 3,"3"=> 4,"4"=> 5,"5"=> 6,"6"=> 7,""=> 8,""=> 9);

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...