Актуализация

parent 45bb1afd
......@@ -17,7 +17,13 @@ def navigator_catalog(context, session):
resultJSON = {"group":{"@id": "catalogNav",
"@name": u"Каталог ЭОР",
"level1":[]}}
#Заблокировано для cetif_class редактирование БТЗ должно производится в основном приложении
if (1==1):
levelText = {'@id': 'levelText',
'@name': 'Доступно в главном приложении СДО (certif)',
}
resultJSON["group"]["level1"].append(levelText)
return resultJSON
sid = session['sessioncontext']['sid']
if not userHasPermission(context, sid, "navigatorAuthor"):
context.error(u"У пользователя нет доступа")
......@@ -74,7 +80,7 @@ def navigator_catalog(context, session):
{"main_context": ""},
{"datapanel":{"@type": "author.datapanel.datapanel_author.catalogPracticalDatapanel.cl"}}]}}
resultJSON["group"]["level1"].append(itemsPractical)
#resultJSON["group"]["level1"].append(itemsPractical)
else:
isCorrect = checkUrlParams(session, context)
if isCorrect:
......
# coding: utf-8
'''
Created on 27.07.2015
☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦
@author: tr0glo)|(I╠╣
☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦☦
'''
from java.sql import Timestamp
from java.util import Date
from java.util import Calendar
from time import time
import json
import random
from uuid import uuid4
from qt._qt_orm import TestingVariantAssignCursor, QtiVariantCursor, \
QtiVariantQuestionCursor, QtiVariantAnswerCursor, ContentCursor, \
Content_AttributeValueCursor, listAttributeContentCursor, \
QtiPackageAttributeCursor, QtiQuestionCursor, QtiDestructorCursor, \
QtiVariantDestructorCursor, QtiVariantDestructorAnswerCursor,\
QtiResourceCursor, QtiVariantParamsCursor
from ru.curs.celesta.showcase.utils import XMLJSONConverter
from qt.functions import completeTest, getImageById, getShowCorrectAnswerPermission,\
getPrevNextQuestionId, getAttributeValue
try:
from ru.curs.showcase.core.jython import JythonDTO
from ru.curs.showcase.core.jython import JythonDownloadResult
except:
from ru.curs.celesta.showcase import JythonDTO
def cardData(context, main=None, add=None, filterinfo=None, session=None, elementId=None):
u'''Карточка вопрса-классификации. '''
begin = time()
session = json.loads(session)
TVA = TestingVariantAssignCursor(context)
QtiVariant = QtiVariantCursor(context)
QtiPackageAttribute = QtiPackageAttributeCursor(context)
QtiQuestion = QtiQuestionCursor(context)
QtiVariantQuestion = QtiVariantQuestionCursor(context)
QtiVariantAnswer = QtiVariantAnswerCursor(context)
QtiDestructor = QtiDestructorCursor(context)
QtiVariantDestructor = QtiVariantDestructorCursor(context)
QtiVariantDestructorAnswer = QtiVariantDestructorAnswerCursor(context)
QtiResource = QtiResourceCursor(context)
Content = ContentCursor(context)
Content_Attribute = Content_AttributeValueCursor(context)
listAttributeContent = listAttributeContentCursor(context)
variantQuestionId = main
QtiVariantQuestion.get(variantQuestionId)
variantId = QtiVariantQuestion.VariantID
QtiVariantQuestion.setRange('VariantID',variantId)
QtiVariantQuestion.orderBy('QuestionNumber')
questionNumber = QtiVariantQuestion.QuestionNumber
questionCount = QtiVariantQuestion.count()
QtiQuestion.get(QtiVariantQuestion.QuestionID)
print 'start', time() - begin
questionHtml = QtiQuestion.QuestionHtml if QtiQuestion.QuestionHtml is not None else ''
questionHtml2 = QtiQuestion.QuestionHtml2 if QtiQuestion.QuestionHtml2 is not None else ''
questionImg = '''<br/>%s'''%(getImageById(QtiResource,QtiQuestion.QuestionImg))
print 'load', time() - begin
# answerCount = 0
# for question in QtiVariantQuestion.iterate():
# QtiVariantDestructor.setRange('VariantQuestionID',question.VariantQuestionID)
# for VariantDestructor in QtiVariantDestructor.iterate():
# QtiVariantDestructorAnswer.setRange('VariantDestructorID',VariantDestructor.VariantDestructorID)
# if QtiVariantDestructorAnswer.count() > 0:
# answerCount += 1
print 'countquest', time() - begin
TVA.get(variantId)
if TVA.AlgorithmTestingID == 1:
testingAlgorithm = u'Тестирование для самоконтроля'
elif TVA.AlgorithmTestingID == 2:
testingAlgorithm = u'Аудиторное тестирование'
else:
testingAlgorithm = u'Тестирование'
questionHeader = u'Вопрос %s из %s'%(questionNumber,questionCount)
print 'header', time() - begin
#Определение идентификаторов следующего и предыдушго вопросов
# QtiVariantQuestion.setRange("QuestionNumber",1)
# QtiVariantQuestion.first()
#
# firstVariantQuestionId = QtiVariantQuestion.VariantQuestionID
#
# QtiVariantQuestion.setRange("QuestionNumber")
# QtiVariantQuestion.get(variantQuestionId)
#
# nextVariantQuestionId = 'ID_FINISH'
# if QtiVariantQuestion.navigate('>'):
# nextVariantQuestionId = QtiVariantQuestion.VariantQuestionID
#
# prevVariantQuestionId = firstVariantQuestionId
# QtiVariantQuestion.get(variantQuestionId)
# if QtiVariantQuestion.navigate('<'):
# prevVariantQuestionId = QtiVariantQuestion.VariantQuestionID
prevVariantQuestionId, nextVariantQuestionId = getPrevNextQuestionId(context, QtiVariantQuestion, variantQuestionId)
QtiVariantQuestion.close()
QtiVariantAnswer.setRange('VariantID',variantId)
QtiVariantAnswer.first()
#Проверка на завершение времени тестирования
timeEnd = QtiVariantAnswer.TimeEnd
timeout = '1' if QtiVariantAnswer.TimeEnd < Date() else '0'
if QtiVariantAnswer.TimeFinish is None and QtiVariantAnswer.TimeEnd < Date():
testingStatus = '2'
elif QtiVariantAnswer.TimeFinish is not None:
testingStatus = '1'
else:
testingStatus = '0'
QtiVariantDestructor.setRange('VariantQuestionID',variantQuestionId)
optionList = []
resultList = []
letter = ord('A')
QtiVariantDestructor.orderBy('VariantDestructorID')
print 'prequest', time() - begin
answerList = list()
answerTextSet = set()
#Нужно ли показывать правильные ответы
correctAnswerFlag = getShowCorrectAnswerPermission(context, session, variantId)
#Формируем список вариантов для классификации и список классификаторов
for QtiVariantDestructor in QtiVariantDestructor.iterate():
QtiDestructor.get(QtiVariantDestructor.DestructorID)
variantDestructorId = QtiVariantDestructor.VariantDestructorID
destructorHtml = QtiDestructor.DestructorHtml if QtiDestructor.DestructorHtml is not None else ''
destructorHtml2 = QtiDestructor.DestructorHtml2 if QtiDestructor.DestructorHtml2 is not None else ''
destructorImg = getImageById(QtiResource,QtiDestructor.DestructorImg)
answerDestructorId = ''
answerText = ''
QtiVariantDestructorAnswer.setRange('VariantDestructorID',QtiVariantDestructor.VariantDestructorID)
if QtiVariantDestructorAnswer.tryFirst():
answerDestructorId = QtiVariantDestructorAnswer.DestructorID
QtiDestructor.get(answerDestructorId)
answerText = QtiDestructor.AnswerText
optionList.append({"@id":variantDestructorId,
"@letter":chr(letter),
"opt": destructorHtml + destructorImg + destructorHtml2,
"answ":{"@DestructorID":answerDestructorId,
"#text":answerText}
})
QtiDestructor.get(QtiVariantDestructor.DestructorID)
if correctAnswerFlag:
optionList[-1]['correctAnsw'] = {"@DestructorID":QtiDestructor.DestructorID,
"#text":QtiDestructor.AnswerText}
if QtiDestructor.AnswerText not in answerTextSet:
answerList.append({"@DestructorID":QtiVariantDestructor.DestructorID,
"#text":QtiDestructor.AnswerText
})
answerTextSet.add(QtiDestructor.AnswerText)
letter += 1
print 'calcList', time() - begin
calNow = Calendar.getInstance()
timeNow = Date()
calNow.setTime(timeNow)
calEnd = Calendar.getInstance()
calEnd.setTime(timeEnd)
print 'quest', time() - begin
js = '''javascript:prepareClassifDnD();injectCounter(new Date(%s,%s,%s,%s,%s,%s),new Date(%s,%s,%s,%s,%s,%s))'''%\
(calEnd.get(Calendar.YEAR),calEnd.get(Calendar.MONTH),calEnd.get(Calendar.DAY_OF_MONTH),\
calEnd.get(Calendar.HOUR_OF_DAY),calEnd.get(Calendar.MINUTE),calEnd.get(Calendar.SECOND),\
calNow.get(Calendar.YEAR),calNow.get(Calendar.MONTH),calNow.get(Calendar.DAY_OF_MONTH),\
calNow.get(Calendar.HOUR_OF_DAY),calNow.get(Calendar.MINUTE),calNow.get(Calendar.SECOND))
QtiVariantParams = QtiVariantParamsCursor(context)
skipQuestions = getAttributeValue(QtiVariantParams, variantId, 'SkipQuestions')
QtiVariantParams.close()
xformsdata = {"schema":{"@xmlns":"",
"description": {
"testingAlgorithm": testingAlgorithm,
"js":js,
"questionHeader":questionHeader,
"questionType":'6',
'variantId': variantId,
"skipQuestions": skipQuestions,
"testingStatus": testingStatus,
"showCorrect":'true' if correctAnswerFlag else 'false',
"question":
{"@number": questionNumber,
"@isLastQuestion":'1' if nextVariantQuestionId == 'ID_FINISH' else '0',
"@timeout":timeout,
"#text":questionHtml + questionImg# + questionHtml2 + ']]>'
},
"options":{"option":optionList},
"answers":{"answer":answerList}},
"result":''}}
xformssettings = {"properties":{"event":[{"@name":"single_click",
"@linkId": "1",
"action":{
"#sorted": [
{"navigator":
{"@element": prevVariantQuestionId}
}]}
},
{"@name":"single_click",
"@linkId": "2",
"action":{
"#sorted": [
{"navigator":
{"@element": nextVariantQuestionId}
}]}
},
{"@name":"single_click",
"@linkId": "3",
"action":{
"#sorted": [
{"navigator":
{"@element": "ID_FINISH"}
}]}
},
{"@name":"single_click",
"@linkId": "4",
"action":{
"#sorted": [
{"navigator":
{"@element": "ID_CONTENTS"}
}]}
}
]
}
}
#print XMLJSONConverter(input=xformsdata).parse(), XMLJSONConverter(input=xformssettings).parse()
data = XMLJSONConverter.jsonToXml(json.dumps(xformsdata))
data = data.replace('&nbsp;','&amp;nbsp;')
settings = XMLJSONConverter.jsonToXml(json.dumps(xformssettings))
# data = data.replace('&lt;','<')
# data = data.replace('&gt','>')
# raise Exception(data)
# raise Exception(settings)
print 'finish', time() - begin
return JythonDTO(data, settings)
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLschema" xmlns:fs="http://www.curs.ru/ns/FormServer" xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<xf:model id="xformId_mainModel">
<xf:instance id="xformId_mainInstance">
<schema xmlns="">
<info>
<typeans name=""></typeans>
</info>
</schema>
</xf:instance>
<xf:instance id="xformId_ButtonDisabledInstance">
<schema xmlns="">
<save active="1"></save>
<work active="1"></work>
<file active="1"></file>
</schema>
</xf:instance>
<xf:bind> </xf:bind>
<xf:action ev:event="xforms-subform-ready">
<xf:load show="replace">
<xf:resource value="instance('xformId_mainInstance')/description/js"></xf:resource>
</xf:load>
</xf:action>
<xf:action ev:event="xforms-subform-ready">
<xf:load resource="javascript:alert('ready');"></xf:load>
</xf:action>
</xf:model>
</head>
<body>
<div insertTemplate="timerAndButtonsPart.xml"></div>
<div>
<div class="answers" style="border: 1px solid #DDDDDD;width:96%;min-height:80px"></div>
<table id="tblQuestion" style="border-spacing: 0; width:48%;float:left"></table>
<xf:group ref="instance('xformId_mainInstance')/description[showCorrect='true']">
<table id="tblCorrectQuestion" style="border-spacing: 0; width:48%;"></table>
</xf:group>
</div>
<!-- <div class="break">
<xf:output value="serialize(instance('xformId_mainInstance'))" />
</div>-->
</body>
</html>
\ No newline at end of file
create view nci.speciality_commission_view as (select distinct on (spec.uid) uid, name, shortname, education_level, sort, is_actual, spec.recversion,
case when com.id is null then false else true end as "giaReport",
case when com2.id is null then false else true end as "certReport"
from umk.speciality spec
left join nci.speciality_commissions com on spec.uid = com.speciality_id and com.member_fio is not Null and com.member_fio != '' and com.report_type = 'giaReport'
left join nci.speciality_commissions com2 on spec.uid = com2.speciality_id and com2.member_fio is not Null and com2.member_fio != '' and com2.report_type = 'certReport')
\ No newline at end of file
......@@ -158,8 +158,10 @@ create table educational_group (
status INT DEFAULT 0,
package_id VARCHAR(36),
kafedra_name VARCHAR(255),
stud_spec_id VARCHAR(36),
stud_spec_name VARCHAR(255),
edu_level_name VARCHAR(100),
report_type VARCHAR(100),
CONSTRAINT pk_education_group PRIMARY KEY (group_id)
);
CREATE INDEX idx_speciality ON educational_group(speciality);
......
......@@ -19,7 +19,7 @@ from qt._qt_orm import QtiVariantAnswerCursor, QtiVariantCursor,\
QtiDestructorCursor
from common.numbersseries.getNextNo import getSeriesParams
from umk._umk_orm import specialityCursor
from nci._nci_orm import personCursor, test_matrixCursor
from nci._nci_orm import personCursor, test_matrixCursor, speciality_commissionsCursor
try:
from ru.curs.showcase.core.jython import JythonDTO, JythonDownloadResult, JythonErrorResult
except:
......@@ -78,8 +78,14 @@ def getTreeData(context, main, add, filterinfo, session, elementId, sortColumnLi
for group in groupsCur.iterate():
row = {}
row[_header["id"][1]] = group.group_id
if (group.report_type == 'certReport'):
report_type = u'Сертификация (ДПО)'
elif (group.report_type == 'giaReport'):
report_type = u'ГИА'
else:
report_type = u'ВО';
# row[_header["name"][1]] = u'{}. {}'.format(group.group_id, group.group_name)
row[_header["name"][1]] = string.join(filter(None, [group.group_name, group.kafedra_name, group.stud_spec_name, group.edu_level_name]), ', ')
row[_header["name"][1]] = string.join(filter(None, [group.group_name, group.kafedra_name, group.stud_spec_name, report_type]), ', ')
row[_header["create_date"][1]] = SimpleDateFormat("dd.MM.yyyy").format(group.create_date)
status = group.status
status_name = _statuses[group.status]
......@@ -494,15 +500,39 @@ def getStudentAppealData(context, speciality_id, recordId):
def downloadStudentFile(context, main=None, add=None, filterinfo=None, session=None, elementId=None, recordId=None):
u'''процедура получения файлов'''
grainPath = context.grain.getGrainPath().toString()
try:
spec_commission = None
groupCur = educational_groupCursor(context)
report_type = None
is_group = recordId.find('.')
groupId = None
if is_group != -1:
row = recordId.split('.')
group_person_id = row[0]
group_personsCur = edu_group_personsCursor(context)
if group_personsCur.tryGet(group_person_id):
groupId = group_personsCur.group_id
group_personsCur.close()
else:
groupId = recordId
if groupCur.tryGet(groupId):
report_type = groupCur.report_type
spec_commission = getSpecCommission(context, groupCur.stud_spec_id, report_type)
if (report_type == 'certReport'):
templateName = 'certif_protocol'
elif (report_type == 'giaReport'):
templateName = 'gia_protocol'
else:
templateName = 'protocol'
groupCur.close()
try:
if is_group == -1:
template = FileInputStream(grainPath + '/template/protocolGroup.docx')
data = getStudentsGroupData(context, main, recordId)
template = FileInputStream(grainPath + '/template/' + templateName + '_group.docx')
data = getStudentsGroupData(context, main, recordId, spec_commission)
fileName = u'{}.docx'.format(data['group']['name']).replace(':', '_').replace(',', '_').replace(' ', '_')
else:
template = FileInputStream(grainPath + '/template/protocol.docx')
data = getStudentData(context, main, recordId)
template = FileInputStream(grainPath + '/template/'+ templateName + '.docx')
data = getStudentData(context, main, recordId, spec_commission)
fileName = u'{}-{}.docx'.format(data['student']['group'], data['student']['fio']).replace(':', '_').replace(',', '_').replace(' ', '_')
if template:
......@@ -542,8 +572,7 @@ def downloadStudentFile(context, main=None, add=None, filterinfo=None, session=N
except SAXException as err:
return context.error(u"Ошибка: %s" % format(err))
def getStudentsGroupData(context, speciality_id, recordId):
def getStudentsGroupData(context, speciality_id, recordId, spec_commission):
group_id = recordId
group_name = u''
groupCur = educational_groupCursor(context)
......@@ -563,7 +592,7 @@ def getStudentsGroupData(context, speciality_id, recordId):
for person in group_personsCur.iterate():
i += 1
row_id = "{}.{}".format(person.group_person_id, person.person_id)
student_data = getStudentData(context, speciality_id, row_id)
student_data = getStudentData(context, speciality_id, row_id, spec_commission)
student_data['student']['index'] = i
group_data['group']['students'].append(student_data['student'])
group_data['group']['scount'] = i
......@@ -571,7 +600,7 @@ def getStudentsGroupData(context, speciality_id, recordId):
return group_data
def getStudentData(context, speciality_id, recordId):
def getStudentData(context, speciality_id, recordId, spec_commission):
speciality_name = u''
fio = u''
group_name = u''
......@@ -582,6 +611,7 @@ def getStudentData(context, speciality_id, recordId):
testing_score = '0'
edu_level_name = ''
stud_spec_name = ''
stud_spec_id = ''
kafedra_name = ''
positive_count = '0'
mark = 'неудовлетворительно'
......@@ -609,13 +639,13 @@ def getStudentData(context, speciality_id, recordId):
variant_id = group_personsCur.variant_id
group_id = group_personsCur.group_id
group_personsCur.close()
if group_id:
groupCur = educational_groupCursor(context)
if groupCur.tryGet(group_id):
group_name = groupCur.group_name
kafedra_name = groupCur.kafedra_name
stud_spec_name = groupCur.stud_spec_name
stud_spec_id = groupCur.stud_spec_id
edu_level_name = groupCur.edu_level_name
params = json.loads(groupCur.params)
testing_date_by_group = SimpleDateFormat("dd.MM.yyyy").format(groupCur.control_date)
......@@ -707,10 +737,32 @@ def getStudentData(context, speciality_id, recordId):
'positive_count': positive_count,
'mark': mark,
'total_count': len(questions['row']),
'questions': questions}}
'questions': questions,
'spec_commission': spec_commission}}
#raise Exception(data)
return data
def getSpecCommission(context, spec_id, report_type):
#raise Exception(spec_id, report_type)
speciality_commission = speciality_commissionsCursor(context)
speciality_commission.setRange("speciality_id", spec_id)
speciality_commission.setRange("report_type", report_type)
commission = {'chairman':[], 'other':[], 'all':[]}
if (speciality_commission.count() > 0):
for row in speciality_commission.iterate():
if (row.chairman == True):
commission['chairman'].append({'member_fio':row.member_fio, 'member_position': row.member_position, 'chairman': row.chairman})
else:
commission['other'].append({'member_fio':row.member_fio, 'member_position': row.member_position, 'chairman': row.chairman})
commission['all'].append({'member_fio':row.member_fio, 'member_position': row.member_position, 'chairman': row.chairman})
else:
commission['chairman'].append({'member_fio':'', 'member_position': '', 'chairman': ''})
commission['other'].append({'member_fio':'', 'member_position': '', 'chairman': ''})
commission['other'].append({'member_fio':'', 'member_position': '', 'chairman': ''})
#так потому что xdocreport и потому что в отчете по ГИА нужен только chairman
commission['all'].extend(commission['chairman'])
return commission
# def gridPartialUpdate(context, main, add, filterinfo, session, elementId, sortColumnList, firstrecord, pagesize, parentId=None):
# u"""Частичное обновление грида"""
# data = {"records":{"rec":[]}}
......
......@@ -271,7 +271,8 @@ def reports(context, session):
"level1": []}}
sid = json.loads(session)['sessioncontext']['sid']
if secfun.userHasPermission(context, sid, 'reports'):
#Заблокировано для certif_class
if secfun.userHasPermission(context, sid, 'reports' and 1!=1):
resultJSON['group']['level1'].append({
'@id': 'reportsPanel',
'@name': u'Отчёты',
......
......@@ -16,6 +16,7 @@ except:
from ru.curs.celesta.showcase import JythonDTO
from edu._edu_orm import educational_groupCursor
from nci._nci_orm import education_levelCursor
def cardData(context, main=None, add=None, filterinfo=None, session=None, elementId=None):
......@@ -31,8 +32,10 @@ def cardData(context, main=None, add=None, filterinfo=None, session=None, elemen
"speciality_id": speciality_id,
"speciality_name": speciality_name,
"kafedra_name": "",
"stud_spec_name": "",
"stud_spec_id": speciality_id,
"stud_spec_name": speciality_name,
"edu_level_name": "",
"report_type": "",
"control_date": SimpleDateFormat("yyyy-MM-dd").format(datetime.now()),
"control_time": u'09:00'}}
......@@ -59,8 +62,15 @@ def cardDataSave(context, main=None, add=None, filterinfo=None, session=None, el
speciality_id = data_dict['speciality_id']
kafedra_name = data_dict['kafedra_name']
stud_spec_name = data_dict['stud_spec_name']
edu_level_name = data_dict['edu_level_name']
stud_spec_id = data_dict['stud_spec_id']
edu_level_name = ''
report_type = data_dict['report_type']
if (stud_spec_id != None):
specialityCur = specialityCursor(context)
if (specialityCur.tryGet(stud_spec_id)):
eduLevelCur = education_levelCursor(context)
if (eduLevelCur.tryGet(specialityCur.education_level)):
edu_level_name = eduLevelCur.name
control_date = datetime.strptime(data_dict['control_date'], "%Y-%m-%d")
group_name = u'{}, {} {}'.format(data_dict['speciality_name'], SimpleDateFormat("dd.MM.yyyy").format(control_date), data_dict['control_time'])
......@@ -78,5 +88,7 @@ def cardDataSave(context, main=None, add=None, filterinfo=None, session=None, el
groupCur.kafedra_name = kafedra_name
groupCur.stud_spec_name = stud_spec_name
groupCur.edu_level_name = edu_level_name
groupCur.stud_spec_id = stud_spec_id
groupCur.report_type = report_type
groupCur.insert()
......@@ -2,7 +2,7 @@
"name":"Справочники",
"1":"Основные"
}*/
CREATE GRAIN nci VERSION '1.09';
CREATE GRAIN nci VERSION '1.10';
--Адреса, которые мы используем для организаций, ссылка на фиас
/**{"name":"Адреса организаций, ссылка на фиас","folderId":"1","dirTypeId":"1","isHierarchical":"false"}*/
CREATE TABLE org_address(
......@@ -258,7 +258,7 @@ CREATE TABLE cycle_address(
/**{"name":"Физлица","folderId":"1","dirTypeId":"1","isHierarchical":"false"}*/
CREATE TABLE person(
/**{"name":"ИД","fieldTypeId":"9","visualLength":"NULL","fieldOrderInSort":"1"}*/
uid VARCHAR(30) NOT NULL,
uid VARCHAR(255) NOT NULL,
/**{"name":"СНИЛС","fieldTypeId":"9","visualLength":"NULL","fieldOrderInSort":"2"}*/
snils VARCHAR(255),
/**{"name":"Фамилия","fieldTypeId":"9","visualLength":"NULL","fieldOrderInSort":"3"}*/
......@@ -291,7 +291,7 @@ CREATE TABLE person_edu_organization(
/**{"name":"ИД","fieldTypeId":"9","visualLength":"NULL","fieldOrderInSort":"1"}*/
uid VARCHAR(36) NOT NULL,
/**{"name":"Физ.лицо","fieldTypeId":"7","refTable":"person","refTableColumn":"fullname","visualLength":"NULL","fieldOrderInSort":"2"}*/
person_id VARCHAR(30) NOT NULL,
person_id VARCHAR(255) NOT NULL,
/**{"name":"Физ.лицо","fieldTypeId":"7","refTable":"edu_organization","refTableColumn":"name","visualLength":"NULL","fieldOrderInSort":"3"}*/
edu_organization_id VARCHAR(36) NOT NULL,
-- "staff": "Сотрудник организации", "supervised_student": "Курируемый слушатель"
......@@ -507,3 +507,25 @@ select
offname
from fias.addrobj
where aolevel=7;
create table speciality_commissions (
id INT NOT NULL IDENTITY,
speciality_id varchar(36) not null,
report_type varchar(255) not null,
member_fio varchar(36) null,
member_position varchar(255) null,
chairman BIT DEFAULT 'FALSE',
constraint pk_speciality_commissions primary key (id)
);
CREATE TABLE speciality_commissions_view(
uid VARCHAR(36) NOT NULL,
name TEXT,
shortname TEXT,
education_level INT,
sort TEXT,
gia_report INT,
cert_report INT,
CONSTRAINT pk_speciality_commissions_view PRIMARY KEY (uid)
);
# coding: utf-8
'''
'''
import json
from ru.curs.celesta.showcase.utils import XMLJSONConverter
from common.htmlhints.htmlHint import htmlHintElement
def datapanel(context, main=None, session=None):
data = {
'datapanel': {
'tab': []
}
}
tab1 = {
'@id': 1,
'@name': u'Состав Комиссий по специальностям',
'element': []
}
grid = {
'@id': 'specCommissionGrid',
'@type': 'grid',
'@subtype': 'JS_PAGE_GRID',
'@plugin': 'pageDGrid',
'@proc': 'nci.grid.specCommission.gridData.celesta',
'@hideOnLoad':'false',
'proc': [
{
'@id':'proc1',
'@name':'nci.grid.specCommission.gridMeta.celesta',
'@type':'METADATA'
},
# {
# '@id':'proc2',
# '@name':'nci.grid.specCommission.gridToolBar.celesta',
# '@type':'TOOLBAR'
# }
]
}
card = {
'@id': 'specCommissionCard',
'@type': 'xforms',
'@proc': 'nci.xform.specCommission.cardData.celesta',
'@template':'nci/specCommission.xml',
'@hideOnLoad':'true',
'proc': {
'@id':'save',
'@name':'nci.xform.specCommission.cardSave.celesta',
'@type':'SAVE'
},
'related': {
'@id':'specCommissionGrid'
}
}
tab1['element'].append(htmlHintElement('specCommission_datapanel'))
tab1['element'].append(grid)
tab1['element'].append(card)
data['datapanel']['tab'].extend([tab1])
return XMLJSONConverter.jsonToXml(json.dumps(data))
# coding: utf-8
import json
from common.sysfunctions import toHexForXml, getGridHeight
from nci._nci_orm import education_levelCursor, speciality_commissions_viewCursor
from nci.xform.specialitiesDeleteCard import checkSpecialitiesUsage
from ru.curs.celesta.showcase.utils import XMLJSONConverter
from umk._umk_orm import specialityCursor
try:
from ru.curs.showcase.core.jython import JythonDTO
from ru.curs.showcase.app.api import MessageType, UserMessage
except:
from ru.curs.celesta.showcase import JythonDTO
def gridData(context, main, add=None, filterinfo=None, session=None, elementId=None,
sortColumnList=None, firstrecord=None, pagesize=None):
specialities = speciality_commissions_viewCursor(context)
education_level = education_levelCursor(context)
# Заголовки
_header = {
'uid': ['~~id', 'uid'],
'name': [u'Название', 'name'],
'shortname': [u'Короткое название', 'shortname'],
'education_level': [u'Уровень образования', 'education_level'],
'commission': [u'Комиссия', 'commission'],
'properties': [u'properties', 'properties']
}
for column in _header:
_header[column].append(toHexForXml(_header[column][0]))
specialities.orderBy('name')
specialities.limit(firstrecord - 1, pagesize)
grid_data = {
'records': {
'rec':[]
}
}
for row in specialities.iterate():
currentrow = {}
currentrow[_header['uid'][2]] = row.uid
currentrow[_header['name'][2]] = row.name
currentrow[_header['shortname'][2]] = row.shortname
if specialities.education_level:
education_level.get(specialities.education_level)
currentrow[_header['education_level'][2]] = education_level.name
else:
currentrow[_header['education_level'][2]] = ''
count = u"Редактировать (" + str(specialities.cert_report) + "/" + str(specialities.gia_report) + ")"
currentrow[_header['commission'][2]] = {'div':{'ins':{'font':{"@style": "cursor: pointer !important",
'@color': 'blue',
'@title': count,
'#text': count}}}}
currentrow[_header['properties'][2]] = {'event': {
'@name': 'cell_single_click',
'@column': _header['commission'][0],
'action': {
'@show_in': 'MODAL_WINDOW',
'#sorted': [
{'main_context': 'current'},
{'modalwindow': {
'@caption': u'{}: Редактирование Комиссиии'.format(row.name),
'@height': '420',
'@width': '1000'}},
{'datapanel': {
'@type': 'current',
'@tab': 'current',
'element': {
'@id': 'specCommissionCard',
'add_context': json.dumps({'action': 'add', 'speciality': row.name, 'speciality_id': row.uid})}}}]}}}
grid_data['records']['rec'].append(currentrow)
return JythonDTO(XMLJSONConverter.jsonToXml(json.dumps(grid_data)),
None)
def gridMeta(context, main=None, add=None, filterinfo=None, session=None, elementId=None,
sortColumnList=None):
specialities = specialityCursor(context)
# Заголовки
_header = {
'uid': ['~~id', 'uid'],
'name': [u'Название', 'name'],
'shortname': [u'Короткое название', 'shortname'],
'education_level': [u'Уровень образования', 'education_level'],
'commission': [u'Комиссия', 'commission'],
'properties': [u'properties', 'properties']
}
for column in _header:
_header[column].append(toHexForXml(_header[column][0]))
grid_settings = {}
grid_settings['gridsettings'] = {
'labels': {
'header': 'Специальности'
},
'columns': {
'col': []
},
'properties': {
'@pagesize': 50,
'@gridWidth': '100%',
'@gridHeight': getGridHeight(session, numberOfGrids=1, gridHeaderHeight=55, delta=59),
'@totalCount': specialities.count(),
'@profile': 'default.properties'
},
}
# Добавляем поля для отображения в gridsettingss
grid_settings['gridsettings']['columns']['col'].append({'@id': _header['name'][0]})
grid_settings['gridsettings']['columns']['col'].append({'@id': _header['shortname'][0],
'@width': '50px'})
grid_settings['gridsettings']['columns']['col'].append({'@id': _header['education_level'][0],
'@width': '50px'})
grid_settings['gridsettings']['columns']['col'].append({"@id":_header["commission"][0], "@width":"200px", "@horAlign": 'CENTER'})
return JythonDTO(None,
XMLJSONConverter.jsonToXml(json.dumps(grid_settings)))
def gridToolBar(context, main=None, add=None, filterinfo=None, session=None, elementId=None):
session_json = json.loads(session)['sessioncontext']
grid_context = session_json['related']['gridContext']
string_bool = lambda x: x and 'true' or 'false'
add_style = string_bool(False)
edit_style = (string_bool(False) if 'currentRecordId' in grid_context
else string_bool(True))
delete_style = string_bool(checkSpecialitiesUsage(context, grid_context['currentRecordId'])
if 'currentRecordId' in grid_context else True)
grid_toolbar = {
'gridtoolbar': {
'#sorted': [
{
'item': {
'@text': u'Добавить',
'@hint': u'Добавить специальность',
'@disable': add_style,
'action': {
'@show_in': 'MODAL_WINDOW',
'#sorted': [
{
'main_context': 'current'
},
{
'modalwindow': {
'@caption': u'Добавить специальность',
'@height': '450',
'@width': '500'
}
},
{
'datapanel': {
'@type': 'current',
'@tab': 'current',
'element': {
'@id': 'specialitiesCard',
'add_context': 'add'
}
}
}
]
}
}
},
{
'item': {
'@text': u'Редактировать',
'@hint': u'Редактировать специальность',
'@disable': edit_style,
'action': {
'@show_in': 'MODAL_WINDOW',
'#sorted': [
{
'main_context': 'current'
},
{
'modalwindow': {
'@caption': u'Редактировать специальность',
'@height': '450',
'@width': '500'
}
},
{
'datapanel': {
'@type': 'current',
'@tab': 'current',
'element': {
'@id': 'specialitiesCard',
'add_context': 'edit'
}
}
}
]
}
}
},
{
'item': {
'@text': u'Удалить',
'@hint': u'Удалить специальность',
'@disable': delete_style,
'action': {
'@show_in': 'MODAL_WINDOW',
'#sorted': [
{
'main_context': 'current'
},
{
'modalwindow': {
'@caption': 'Удалить специальность',
'@height': '140',
'@width': '400'
}
},
{
'datapanel': {
'@type': 'current',
'@tab': 'current',
'element': {
'@id': 'specialitiesDeleteCard',
'add_context': ''
}
}
}
]
}
}
}
]
}
}
return XMLJSONConverter.jsonToXml(json.dumps(grid_toolbar))
......@@ -73,6 +73,14 @@ def navNCI(context, session):
{'datapanel': {
'@type': 'nci.datapanel.testSettingsDatapanel.datapanel.cl',
'@tab': 'firstOrCurrent'}}]}})
resultJSON['group']['level1'].append({'@id': 'spec_comission',
'@name': u'Состав комиссий',
'action': {
'#sorted': [
{'main_context': 'current'},
{'datapanel': {
'@type': 'nci.datapanel.specCommissionDatapanel.datapanel.cl',
'@tab': 'firstOrCurrent'}}]}})
if not resultJSON['group']['level1']:
resultJSON = {"group":None}
......
# coding: utf-8
import json
import uuid
from nci._nci_orm import education_levelCursor, speciality_commissionsCursor
from ru.curs.celesta.showcase.utils import XMLJSONConverter
from umk._umk_orm import specialityCursor
try:
from ru.curs.showcase.core.jython import JythonDTO
from ru.curs.showcase.core.selector import ResultSelectorData
from ru.beta2.extra.gwt.ui.selector.api import DataRecord
except:
from ru.curs.celesta.showcase import JythonDTO
def cardData(context, main=None, add=None, filterinfo=None, session=None, elementId=None):
u'''Данные для карточки.'''
spec_id = json.loads(add)['speciality_id']
speciality_commission = speciality_commissionsCursor(context)
speciality_commission.setRange("speciality_id", spec_id)
xforms_data = {
'schema': {
'@xmlns': '',
'certTemplate': {'row':{'memberFio':'', 'memberPosition':'', 'chairman': 'False'}},
'data': {'specId':spec_id,
'cert': {'row':[{'memberFio':'', 'memberPosition':'', 'chairman': 'True'},
{'memberFio':'', 'memberPosition':'', 'chairman': 'False'},]},
'gia': {'memberFio':'', 'memberPosition':'', 'chairman': 'False'}},
}
}
certRows = []
rowGia = None
for row in speciality_commission.iterate():
if (row.report_type == 'giaReport'):
rowGia = {'memberFio':row.member_fio, 'memberPosition':row.member_position, 'chairman': row.chairman}
else:
certRows.append({'memberFio':row.member_fio, 'memberPosition':row.member_position, 'chairman': row.chairman})
if (rowGia == None):
rowGia = {'memberFio':'', 'memberPosition':'', 'chairman': ''}
if (len(certRows) == 0):
certRows = [{'memberFio':'', 'memberPosition':'', 'chairman': 'True'},
{'memberFio':'', 'memberPosition':'', 'chairman': 'False'},]
xforms_data['schema']['data']['gia'] = rowGia
xforms_data['schema']['data']['cert']['row'] = certRows
# Первоначальная xforms_settings
xforms_settings = {
'properties': {
'event': [
{
'@name': 'single_click',
'@linkId': '1',
'action': {
'@keep_user_settings': 'true',
'#sorted': [
{'main_context': 'current'},
{'datapanel': {
'@type': 'current',
'@tab': 'current',
'element': {
'@id': 'specCommissionGrid',
'add_context': ''
}
}}]
}
}
]
}
}
return JythonDTO(XMLJSONConverter.jsonToXml(json.dumps(xforms_data)),
XMLJSONConverter.jsonToXml(json.dumps(xforms_settings)))
def cardSave(context, main=None, add=None, filterinfo=None, session=None, elementId=None, xformsdata=None):
u'''Сохранение карточки. '''
specialities = specialityCursor(context)
# education_level = education_levelCursor(context)
speciality_commission = speciality_commissionsCursor(context)
data_dict = json.loads(xformsdata)['schema']['data']
giaMemberFio = data_dict['gia']['memberFio']
giaMemberPosition = data_dict['gia']['memberPosition']
certList = data_dict['cert']['row']
specId = data_dict['specId']
speciality_commission.setRange('speciality_id', specId);
speciality_commission.setRange('report_type', 'giaReport');
speciality_commission.tryFirst();
speciality_commission.speciality_id = specId
speciality_commission.member_fio = giaMemberFio
speciality_commission.member_position = giaMemberPosition
if (speciality_commission.id == None):
speciality_commission.report_type = 'giaReport'
speciality_commission.speciality_id = specId
speciality_commission.insert()
else:
speciality_commission.update()
speciality_commission.setRange('speciality_id', specId)
speciality_commission.setRange('report_type', 'certReport')
speciality_commission.deleteAll()
speciality_commission.clear()
hasChairMan = False
for row in certList:
speciality_commission.member_fio = row['memberFio']
speciality_commission.member_position = row['memberPosition']
speciality_commission.member_position = row['memberPosition']
chairman = (row['chairman'])
if (chairman == 'True' or chairman == 'true'):
chairman = True
else:
chairman = False
if (chairman == True and hasChairMan == False):
hasChairMan = True
elif (chairman == True and hasChairMan == True):
chairman = False
speciality_commission.chairman = chairman
speciality_commission.report_type = 'certReport'
speciality_commission.speciality_id = specId
speciality_commission.insert()
speciality_commission.clear()
......@@ -10,6 +10,9 @@
<xf:bind nodeset="instance('xformId_mainInstance')/speciality_name" required="true()" ></xf:bind>
<xf:bind nodeset="instance('xformId_mainInstance')/control_date" required="true()" type="date"/>
<xf:bind nodeset="instance('xformId_mainInstance')/control_time" required="true()"/>
<xf:bind nodeset="instance('xformId_mainInstance')/stud_spec_id" required="true()"/>
<xf:bind nodeset="instance('xformId_mainInstance')/stud_spec_name" required="true()"/>
<xf:bind nodeset="instance('xformId_mainInstance')/report_type" required="true()"/>
</xf:bind>
</xf:model>
</head>
......@@ -29,23 +32,38 @@
<xf:label>Наименование кафедры:</xf:label>
</xf:input>
</div>
<div class="baseInput400">
<div class="break selectorShort400">
<xf:input ref="instance('xformId_mainInstance')/stud_spec_name">
<xf:label>Специальность:</xf:label>
<xf:label>Специальность</xf:label>
</xf:input>
<xf:selector
buttonLabel="..."
procListAndCount="'umk.selectors.specialities.procListAndCount.celesta'"
generalFilters="''"
currentValue="''"
windowCaption="'Выберите уровень обучения'"
xpathMapping="{
'XPath(instance(quot(xformId_mainInstance))/stud_spec_id)' : 'id',
'XPath(instance(quot(xformId_mainInstance))/stud_spec_name)' : 'name',
}">
</xf:selector>
</div>
<div class="baseInput400">
<xf:label>Вид обучения:</xf:label>
<xf:label>Вид тестирования:</xf:label>
<div class="baseInput400">
<xf:select1 ref="instance('xformId_mainInstance')/edu_level_name">
<xf:select1 ref="instance('xformId_mainInstance')/report_type">
<xf:item>
<xf:label>Сертификация (ДПО)</xf:label>
<xf:value>certReport</xf:value>
</xf:item>
<xf:item>
<xf:label>Ординатура</xf:label>
<xf:value>Ординатура</xf:value>
<xf:label>ГИА</xf:label>
<xf:value>giaReport</xf:value>
</xf:item>
<xf:item>
<xf:label>Аспирантура</xf:label>
<xf:value>Аспирантура</xf:value>
<xf:label>Высшее образование</xf:label>
<xf:value>voReport</xf:value>
</xf:item>
</xf:select1>
</div>
......
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsd="http://www.w3.org/2001/XMLschema"
xmlns:fs="http://www.curs.ru/ns/FormServer"
xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<style type="text/css">
.ScrollPanel {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: none;
height: 250px;
overflow-x: hidden;
overflow-y: auto;
padding: 0px;
width: 100%;
}
.persons {
padding: 2px 4px 1px 4px !important;
}
.marginTop2 {
margin-top: 2px !important;
}
.btztable {
border-collapse: collapse;
border: none;
}
.btztable td.cell {
background-color: #c3d9d9;
border: 1px solid gray;
text-align: center;
}
.btztable td.button {
background: none;
border: none;
text-align: right;
}
.textCenter .xforms-value {
text-align: center !important;
}
.textRight .xforms-value {
text-align: right !important;
}
.error .xforms-value {
color: red !important;
font-weight: bold;
}
</style>
<xf:model id="xformId_mainModel">
<xf:instance id="xformId_mainInstance">
<schema xmlns="">
<data>
<!--<year label="" value=""/>-->
</data>
</schema>
</xf:instance>
<xf:bind>
</xf:bind>
<xf:action ev:event="xforms-ready">
<xf:toggle case="gia"></xf:toggle>
</xf:action>
</xf:model>
</head>
<body>
<!--xf:output value="serialize(instance('xformId_mainInstance'))"/-->
<div style="float: left">
<table cellpadding="0px" cellspacing="1px" width="620px">
<tr>
<!-- Вкладка "Классификация события" -->
<td style="height: 24px; width: 50%; text-align: center">
<div class="caseButtonCurrent" id="Tab10Button">
<xf:trigger>
<xf:label>Сертификация ДПО</xf:label>
<xf:action ev:event="DOMActivate">
<xf:load resource="javascript:document.getElementById('Tab10Button').className = 'caseButtonCurrent';"/>
<xf:load resource="javascript:document.getElementById('Tab20Button').className = 'caseButton';"/>
<xf:toggle case="cert"/>
</xf:action>
</xf:trigger>
</div>
</td>
<!-- Вкладка "Финансовая оценка" -->
<td style="height: 24px; width: 50%; text-align: center">
<div class="caseButton" id="Tab20Button">
<xf:trigger>
<xf:label>ГИА</xf:label>
<xf:action ev:event="DOMActivate">
<xf:load resource="javascript:document.getElementById('Tab10Button').className = 'caseButton';"/>
<xf:load resource="javascript:document.getElementById('Tab20Button').className = 'caseButtonCurrent';"/>
<xf:toggle case="gia"></xf:toggle>
</xf:action>
</xf:trigger>
</div>
</td>
</tr>
<tr>
<td colspan="2" style="height: 2px; background-color: grey;"></td>
</tr>
</table>
</div>
<xf:group ref="instance('xformId_mainInstance')">
<xf:switch>
<xf:case id = "cert">
<div class="group" style="margin: 0 0 2px 0; padding: 2px 0 2px 2px; width: 950px !important;">
<table class="btztable">
<tr>
<td class="cell" rowspan="2" width="394px">ФИО</td>
<td class="cell" rowspan="2" width="397px">Должность</td>
<td class="cell" rowspan="2" width="97px">Председатель</td>
<td class="button" rowspan="2" width="32px">
<xf:trigger class="button30 floatRight">
<xf:label>+</xf:label>
<xf:action ev:event="DOMActivate">
<xf:insert nodeset="instance('xformId_mainInstance')/data/cert/row" at="last()" position="after" origin="instance('xformId_mainInstance')/certTemplate/row"/>
<xf:recalculate model="xformId_mainModel"/>
</xf:action>
</xf:trigger>
</td>
</tr>
</table>
<xf:repeat class="break ScrollPanel" id="xformId_themes" nodeset="instance('xformId_mainInstance')/data/cert/row">
<div class="break">
<xf:input class="baseInput400" ref="memberFio"/>
<xf:input class="baseInput400" ref="memberPosition"/>
<xf:output class="baseInput100" value="if(chairman = 'True', 'Да', 'Нет')"/>
<xf:group ref=".[count(../row) &gt; 1 and chairman = 'False']">
<xf:trigger class="button30 marginTop2">
<xf:label>-</xf:label>
<xf:action ev:event="DOMActivate">
<xf:delete nodeset="."/>
</xf:action>
</xf:trigger>
</xf:group>
</div>
</xf:repeat>
</div>
</xf:case>
<xf:case id = "gia">
<div class="group" style="margin: 0 0 2px 0; padding: 2px 0 2px 2px; width: 950px !important;">
<table class="btztable">
<tr>
<td class="cell" rowspan="2" width="394px">ФИО</td>
<td class="cell" rowspan="2" width="397px">Должность</td>
</tr>
</table>
<div class="break">
<xf:input class="baseInput400" ref="instance('xformId_mainInstance')/data/gia/memberFio"/>
<xf:input class="baseInput400" ref="instance('xformId_mainInstance')/data/gia/memberPosition"/>
</div>
</div>
</xf:case>
</xf:switch>
</xf:group>
<div class="break button200">
<xf:trigger id="xformId_Tab10">
<xf:label>Сохранить и закрыть</xf:label>
<xf:action ev:event="DOMActivate" if="(is-valid(instance('xformId_mainInstance'))=false())">
<xf:message>Не заполнено обязательное поле!</xf:message>
</xf:action>
<xf:action ev:event="DOMActivate" if="(is-valid(instance('xformId_mainInstance'))=true())">
<xf:load resource="javascript:gwtXFormSave('xformId','1', Writer.toString(getSubformInstanceDocument('xformId_mainModel', 'xformId_mainInstance')))"/>
</xf:action>
</xf:trigger>
</div>
<div class="button100">
<xf:trigger id="xformId_Tab20">
<xf:label>Закрыть</xf:label>
<xf:action ev:event="DOMActivate">
<xf:load resource="javascript:gwtXFormUpdate('xformId','1', null)" />
</xf:action>
</xf:trigger>
</div>
</body>
</html>
......@@ -248,7 +248,7 @@ pageEncoding="UTF-8"%>
<div id="credentials" style="display: table; position: absolute; bottom: 30px; right: 30px;">
<!-- <div style="display: table-cell; vertical-align: bottom;">
E-mail: support-sdo@ranepa.ru
E-mail: sdo@rmapo.ru
</div>-->
</div>
<img src="<%=authGifSrc%>" alt=" " id="authenticationImage" style="visibility:hidden" />
......
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLschema" xmlns:fs="http://www.curs.ru/ns/FormServer" xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<xf:model id="xformId_mainModel">
<xf:instance id="xformId_mainInstance">
<schema xmlns="">
<info>
<typeans name=""></typeans>
</info>
</schema>
</xf:instance>
<xf:instance id="xformId_ButtonDisabledInstance">
<schema xmlns="">
<save active="1"></save>
<work active="1"></work>
<file active="1"></file>
</schema>
</xf:instance>
<xf:bind> </xf:bind>
<xf:action ev:event="xforms-subform-ready">
<xf:load show="replace">
<xf:resource value="instance('xformId_mainInstance')/description/js"></xf:resource>
</xf:load>
</xf:action>
<xf:action ev:event="xforms-subform-ready">
<xf:load resource="javascript:alert('ready');"></xf:load>
</xf:action>
</xf:model>
</head>
<body>
<!-- <xf:output value="serialize(instance('xformId_mainInstance'))" /> -->
<div insertTemplate="timerAndButtonsPart.xml"></div>
<div>
<div class="answers" style="border: 1px solid #DDDDDD;width:96%;min-height:80px"></div>
<table id="tblQuestion" style="border-spacing: 0; width:48%;float:left">
</table>
<xf:group ref="instance('xformId_mainInstance')/description[showCorrect='true']">
<table id="tblCorrectQuestion" style="border-spacing: 0; width:48%;">
</table>
</xf:group>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLschema" xmlns:fs="http://www.curs.ru/ns/FormServer" xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<xf:model id="xformId_mainModel">
<xf:instance id="xformId_mainInstance">
<schema xmlns="">
<info>
<typeans name=""></typeans>
</info>
</schema>
</xf:instance>
<xf:instance id="xformId_ButtonDisabledInstance">
<schema xmlns="">
<save active="1"/>
<work active="1"/>
<file active="1"/>
<next active="1"/>
<option active="1"/>
<questions active="1"/>
</schema>
</xf:instance>
<xf:instance id="xformId_notAsweredQuestions">
<schema xmlns="">
<count>0</count>
</schema>
</xf:instance>
<xf:bind> </xf:bind>
<xf:action ev:event="xforms-subform-ready">
<xf:load show="replace">
<xf:resource value="instance('xformId_mainInstance')/description/js"></xf:resource>
</xf:load>
</xf:action>
<xf:action ev:event="xforms-subform-ready">
<xf:load resource="javascript:alert('ready');"></xf:load>
</xf:action>
</xf:model>
</head>
<body>
<div class="test-content mdl-color-text--grey-600">
<div class="section--center mdl-card mdl-card__question mdl-grid mdl-grid--no-spacing mdl-shadow--2dp">
<div class="mdl-card__actions mdl-card--border mdl-grid mdl-grid--no-spacing">
<table cellspacing="0" cellpadding="0" border="0" style="width: 100%">
<tr>
<td align="left" width="100%">
<div class="subpageheader">
<xf:output class="clean mdl-typography--title" value="instance('xformId_mainInstance')/description/questionHeader"/>
</div>
</td>
<td align="right">
<xf:group ref="instance('xformId_mainInstance')/description/testingStatus[.='0']">
<div id="timerDiv"/>
</xf:group>
</td>
</tr>
</table>
</div>
<xf:group class="mdl-card__actions mdl-card--border mdl-grid mdl-grid--no-spacing" ref="instance('xformId_mainInstance')/description/testingStatus[.='2']">
<font color="red">Время истекло! Тест доступен только для просмотра</font>
</xf:group>
<xf:group class="mdl-card__actions mdl-card--border mdl-grid mdl-grid--no-spacing" ref="instance('xformId_mainInstance')/description/testingStatus[.='1']">
<B>Тестирование завершено. Тест доступен только для просмотра</B>
</xf:group>
<div class="mdl-card__supporting-text mdl-grid mdl-grid--no-spacing">
<div class="mdl-cell mdl-card--border mdl-cell--8-col mdl-cell--8-col-tablet mdl-cell--8-col-phone mdl-grid">
<xf:output class="clean mdl-typography--title mdl-cell mdl-cell--12-col" value="instance('xformId_mainInstance')/description/question" mediatype="application/xhtml+xml"/>
<xf:repeat class="mdl-cell mdl-cell--12-col mdl-grid question-images" id="xformId_question_images" nodeset="instance('xformId_mainInstance')/description/images/image_file">
<a class="mdl-cell mdl-cell--6-col" href="{.}" data-lightbox="questionGalery">
<img class="mdl-cell mdl-cell--12-col" src="{.}"/>
</a>
</xf:repeat>
<table id="tblQuestion" class="mdl-cell mdl-cell--12-col" cellspacing="0" cellpadding="0"></table>
</div>
<div class="mdl-cell mdl-cell--4-col mdl-cell--8-col-tablet mdl-cell--8-col-phone mdl-grid">
<div class="mdl-typography--title mdl-cell mdl-cell--12-col">Варианты ответа</div>
<div class="mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--8-col-phone" style="height: 100%;">
<div class="answers">
</div>
</div>
</div>
</div>
<div class="mdl-card__actions">
<div insertTemplate="timerAndButtonsPart.xml"></div>
</div>
</div>
</div>
<!-- <div insertTemplate="timerAndButtonsPart.xml"></div>
<div>
<div class="answers" style="border: 1px solid #DDDDDD;width:96%;min-height:80px"></div>
<table id="tblQuestion" style="border-spacing: 0; width:48%;float:left"></table>
<xf:group ref="instance('xformId_mainInstance')/description[showCorrect='true']">
<table id="tblCorrectQuestion" style="border-spacing: 0; width:48%;"></table>
</xf:group>
</div>-->
<!--<xf:output class="bsaInput800 break IndentTop10" value="serialize(instance('xformId_mainInstance'))"/> -->
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLschema" xmlns:fs="http://www.curs.ru/ns/FormServer" xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<style type="text/css">
.xforms-value {
background-color:#fff;
color:#000;
border: none !important;
width: 100% !important;
float: left;
}
table.main, table.main2 {
border-collapse: collapse;
}
table.main th {
background-color:#5A8BC3;
color: #FFF;
text-align: center;
border: 2px solid white;
}
th .xforms-repeat-item {
border-right: 2px solid white;
}
td .xforms-repeat-item {
padding: 0 0 0 0;
}
th .xforms-value {
background-color:#5A8BC3;
color:#FFF;
width: 123px !important;
float: left;
min-height: 35px;
}
td .xforms-value {
}
.t1 {
}
#Info {
margin-bottom: 10px;
}
#Info .xforms-output {
display:block;
float: left;
width:100%;
}
.baseInput .xforms-value {
display: block;
float: left;
width:100%;
border: none;
background-color: #DDD;
min-height: 13px;
margin: 6px 0 0;
padding: 2px 0 2px 5px;
}
.values .xforms-value {
text-align: left !important;
}
.values .xforms-input .xforms-value, .values select.xforms-value {
background-color: #ffff99; /*#E5F2FF;*/
}
.values .xforms-output .xforms-value,
.values .xforms-readonly .xforms-value {
background-color: :#fff;
}
.newbutton button {
width: 100% !important;
}
.line {
border-top: 1px dashed #000; /* Параметры линии */
height: 18px; /* Высота блока */
background: url(images/scissors.png) no-repeat 10px -18px; /* Параметры фона */
}
</style>
<xf:model id="xformId_mainModel">
<xf:instance id="xformId_mainInstance">
<schema xmlns="">
<info>
<typeans name=""></typeans>
</info>
</schema>
</xf:instance>
<xf:instance id="xformId_CheckInstance">
<schema xmlns="">
<id>8AEE4310-5CE5-4C8D-8AAA-888381612239</id>
</schema>
</xf:instance>
<xf:bind>
</xf:bind>
</xf:model>
</head>
<body>
<div style="height: 20px;"></div>
<div style="width: 620px; margin-top:20;">
<xf:output ref="instance('xformId_mainInstance')/description/question"></xf:output>
</div>
<div style="height: 50px;"></div>
<table class="main2" cellspacing="0" cellpadding="5px" width="100%">
<tr>
<td style="width: 60%">
<table width="100%">
<tr>
<td></td>
</tr>
</table>
<table width="100%">
<tr>
<td></td>
</tr>
</table>
<table width="100%">
<tr>
<td></td>
</tr>
</table>
<table class="main2" cellspacing="0" cellpadding="5px" width="100%">
<xf:repeat id="xformId_from" nodeset="instance('xformId_mainInstance')/result/option">
<tr>
<td class="t1" width="20px" style=" border-top: 2px solid #DDDDDD;">
<div class="values" style="width: 15px;">
<xf:output ref="instance('xformId_mainInstance')/description/from/option[@id=current()/@id]/@letter"></xf:output>
</div>
</td>
<td class="t1" style=" border-top: 2px solid #DDDDDD;">
<div class="values" style="width: 100%; float-left;white-space: normal !important">
<xf:output ref="instance('xformId_mainInstance')/description/from/option[@id=current()/@id]" mediatype="application/xhtml+xml"></xf:output>
</div>
</td>
<td class="t1" width="40px" style=" border-top: 2px solid #DDDDDD;">
<xf:select1 appearance="minimal" ref="@to">
<xf:item>
<xf:label>-</xf:label>
<xf:value>-</xf:value>
</xf:item>
<xf:itemset nodeset="instance('xformId_mainInstance')/description/to/option">
<xf:label ref="@letter"></xf:label>
<xf:value ref="@id"></xf:value>
</xf:itemset>
</xf:select1>
</td>
</tr>
</xf:repeat>
</table>
<table width="100%">
<tr>
<td rowspan="4" style=" border-top: 2px solid #DDDDDD;width: 100%">-</td>
</tr>
</table>
</td>
<td style="width: 40%">
<table class="main2" cellspacing="0" cellpadding="5px" width="100%">
<xf:repeat id="xformId_to" nodeset="instance('xformId_mainInstance')/description/to/option">
<tr>
<td style="width: 100%">
<xf:group ref=".[@id = instance('xformId_mainInstance')/result/option[index('xformId_from')]/@to]">
<table width="100%">
<tr>
<td style="border: 2px solid green; width: 100%; float-left;white-space: normal !important">
<xf:output ref="." mediatype="application/xhtml+xml"></xf:output>
</td>
</tr>
</table>
</xf:group>
<xf:group ref=".[@id != instance('xformId_mainInstance')/result/option[index('xformId_from')]/@to]">
<table width="100%">
<tr>
<td>
<div class="values" style="width: 100%; float-left;white-space: normal !important">
<xf:output ref="." mediatype="application/xhtml+xml"></xf:output>
</div>
</td>
</tr>
</table>
</xf:group>
</td>
</tr>
</xf:repeat>
</table>
</td>
</tr>
</table>
<!--<xf:output class="bsaInput800 break IndentTop10" value="serialize(instance('xformId_mainInstance'))"/> -->
</body>
</html>
\ No newline at end of file
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