Commit dcdb27b2 authored by Denis Khachko's avatar Denis Khachko

Resent tasks.

parent 9df1ac1b
......@@ -134,6 +134,7 @@ void Plugin::selectNext(KumZadanie* task)
actor->loadActorData(field_data);
}
}
void Plugin::checkNext(KumZadanie* task)
{
......@@ -141,6 +142,10 @@ void Plugin::checkNext(KumZadanie* task)
selectNext(task);
gui->startTesting();
};
void Plugin::loadCource(QString file)
{
MW->loadCourseFromFile(file);
}
void Plugin::startProgram(QVariant param,KumZadanie* task)
{
field_no=0;
......
......@@ -39,9 +39,9 @@ public:
{
mainWindow()->showNormal();
}
inline void activateCourseFromList(QString file) { Q_UNUSED(file); }
inline void activateCourseFromList(QString file) { loadCource(file); }
inline QStringList getListOfCourses() const {
return mySettings()->value("Courses/LastFiles","").toString().split(";");
return mySettings()->value("Courses/LastFiles","").toString().split(";",QString::SkipEmptyParts);
}
public slots:
void setEnabled(bool value);
......@@ -60,6 +60,7 @@ private /*methods*/:
void updateSettings(const QStringList & keys);
private /*fields*/:
void loadCource(QString file);
AI * getActor(QString name);
QWidget* mainWindow_;
QAction* actionPerformCheck_;
......
......@@ -222,7 +222,42 @@ for(int i=0;i<prgElListT.count();i++)
};
};
void MainWindowTask::loadCourseFromFile(const QString & file)
{QFileInfo fi(file);
if(!fi.exists())
{
return;
};
baseKursFile=fi;
curDir=fi.absolutePath ();
settings->setValue("Directories/Kurs", curDir);
qDebug()<<"curDir"<<curDir;
QString fileName=file;
progChange.clear();
if(fileName.right(9)==".work.xml")//Загрузка оценок и программ
{
loadMarks(fileName);
this->show();
return;
}else
cursWorkFile.setFileName("");
loadCourseData(fileName);
QString cText=course->courceDescr();
if(cText.right(4)==".htm" ||cText.right(5)==".html" )
{
loadHtml(cText);
}else ui->webView->setHtml(cText);
// if(isTeacher)ui->actionEdit->setEnabled(true);
setWindowTitle(course->name()+trUtf8(" - Практикум"));
updateLastFiles(fileName);
interface->lockContrls();
ui->checkTask->setEnabled(false);
this->show();
};
void MainWindowTask::loadCourse()
{
......
......@@ -92,6 +92,7 @@ public slots:
void aboutToQuit ();
void loadCourse();
void loadCourseFromFile(const QString & file);
void returnTested();
void saveCourse();
void saveCourseFile();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment