Image copyright Getty Images Image caption Even in the wreckage of Eastern Ghouta, there are students who refuse to stop studying

In the rubble of Syria's long war, there are all kinds of images of destruction and despair.

But despite all the odds, in the depths of the siege of Eastern Ghouta, there are young people still trying to study and plan for a future.

Such students rely on universities offering online degrees - and as well as the challenges of staying alive, they have to find access to electricity and internet connections.

Mahmoud, a 20-year-old in Eastern Ghouta, has been studying computer science with the US-based University of the People, which offers degrees to people out of reach of conventional higher education.

'Heavy shelling'

He took classes at secondary school in Eastern Ghouta through years of civil war and the siege - but then had nowhere to continue his studies into university.

Image caption The shattered home of a student in Eastern Ghouta. He survived by being elsewhere at the time it was hit.

"When I finished high school I couldn't find a university that offered computer science degrees," he tells the BBC.

Studying and getting a degree are important as a way of looking forward, says Mahmoud, a symbol of something better in the future.

"I think I've put my first step on the road," he says.

The University of the People is billed as the alternative university for people with no other alternative. It was used by Syrian students during the battle for Aleppo when the city's own university was hit by rockets.

Image copyright Getty Images Image caption Rescuing a child after an air strike during the siege

It allows students to study for an accredited degree entirely online, with support from the likes of Google and the Gates Foundation, and staffed by volunteer academics and retired university lecturers.

In Eastern Ghouta, described by the UN secretary general as "hell on earth", the university has about 10 students still following courses.

'Survival' and 'hope'

But how can anyone focus on studying during such attacks?

"Of course there are a lot of psychological effects because of what is happening around us," says Mahmoud.

"When the bombardment, the shelling, gets very heavy, the only thing we think about is our survival.

"And then when the bombardment gets better, even for a short amount of time, we go back to thinking about our jobs, our studies, what are we going to do in the future.

"I think personally that this dilemma is a psychological problem in itself.

Image copyright Getty Images Image caption Moving through the smoking ruins after an attack last week

"Because our minds wander between two separate lives - the life of a young person trying to complete his studies and achieve his goals - and the life of a 20-year-old just trying to get through the day and to survive again to see another day."

But having the opportunity to study, in a place cut off and encircled, is a rare source of "optimism", he says.

"I want to graduate, to have a degree. For us under siege that's a very big opportunity. It gives students hope."

It's a remarkable type of determination.

"I'm motivated to learn and want to keep learning. If I have the chance, I want to be part of the process of rebuilding the country again," says Mahmoud.

'We've had a bloody day today'

But it's far from easy.

Until last month, it was "difficult but manageable" to keep up his studies, relying for power on local generators.

Image caption Mariam - a student who worked by candlelight during the battle for Aleppo

"Things like electricity, internet connection, everything I need for my virtual study was hard to get because of the siege and sometimes not available at all."

But the situation has worsened.

All the families in his building have had to move down to take shelter together in the basement, he says.

Another computer studies student, Majed, has had his home demolished by an air raid. He has been struggling with unreliable internet connection and problems charging his phone.

While many students around the world are preparing for exams, he sent a message last week to say: "We've had a bloody day today. Dozens of air strikes."

On Tuesday, Majed said a ceasefire for negotiations seemed to be holding.

Image copyright Getty Images Image caption Families emerging from underground shelters earlier this week

But food and power remained scarce and very expensive and people had moved to makeshift bomb shelters to escape the shelling.

He fears for Syria's next generation, missing out on education and with the risk of "ignorance and child labour".

While other students are counting down the days to final exams, he has been counting the numbers of victims.

But Majed says he still has "faith" and is looking to the future. He wants to get a PhD.

"Our lives should continue, the war should not prevent us. In the end we're the ones to rebuild the country and repair the damage.

"I believe education will help us build our future."

More from Global education

The editor of Global education is sean.coughlan@bbc.co.uk